2007-02-04 04:47:46 +03:00
|
|
|
|
;Addresses for bits
|
|
|
|
|
|
|
|
|
|
FPU_FLAG equ 0001h ;Floating-point unit on-Chip
|
|
|
|
|
VME_FLAG equ 0002h ;Virtual Mode Extension
|
|
|
|
|
DE_FLAG equ 0004h ;Debugging Extension
|
|
|
|
|
PSE_FLAG equ 0008h ;Page Size Extension
|
|
|
|
|
TSC_FLAG equ 0010h ;Time-Stamp Counter
|
|
|
|
|
MSR_FLAG equ 0020h ;Model Specific Registers
|
|
|
|
|
PAE_FLAG equ 0040h ;Physical Address Extension
|
|
|
|
|
MCE_FLAG equ 0080h ;Machine Check Exception
|
|
|
|
|
CX8_FLAG equ 0100h ;CMPXCHG8 Instruction Supported
|
|
|
|
|
APIC_FLAG equ 0200h ;On-chip APIC Hardware Supported
|
|
|
|
|
;10_FLAG equ 0400h ;Reserved
|
|
|
|
|
SEP_FLAG equ 0800h ;Fast System Call
|
|
|
|
|
MTRR_FLAG equ 1000h ;Memory Type Range Registers
|
|
|
|
|
PGE_FLAG equ 2000h ;Page Global Enable
|
|
|
|
|
MCA_FLAG equ 4000h ;Machine Check Architecture
|
|
|
|
|
CMOV_FLAG equ 8000h ;Conditional Move Instruction Supported
|
|
|
|
|
PAT_FLAG equ 10000h ;Page Attribute Table
|
|
|
|
|
PSE36_FLAG equ 20000h ;36-bit Page Size Extension
|
|
|
|
|
PSNUM_FLAG equ 40000h ;Processor serial number present and enabled
|
|
|
|
|
CLFLUSH_FLAG equ 80000h ;CLFLUSH Instruction supported
|
|
|
|
|
;20_FLAG equ 100000h ;Reserved
|
|
|
|
|
DTS_FLAG equ 200000h ;Debug Store
|
|
|
|
|
ACPI_FLAG equ 400000h ;Thermal Monitor and Software Controlled Clock Facilities supported
|
|
|
|
|
MMX_FLAG equ 800000h ;Intel Architecture MMX technology supported
|
|
|
|
|
FXSR_FLAG equ 1000000h ;Fast floating point save and restore
|
|
|
|
|
SSE_FLAG equ 2000000h ;Streaming SIMD Extensions supported
|
|
|
|
|
SSE2_FLAG equ 4000000h ;Streaming SIMD Extensions 2
|
|
|
|
|
SS_FLAG equ 8000000h ;Self-Snoop
|
|
|
|
|
;HTT_FLAG equ 10000000h ;Hyper-Threading Technology
|
|
|
|
|
TM_FLAG equ 20000000h ;Thermal Monitor supported
|
|
|
|
|
IA64_FLAG equ 40000000h ; IA-64
|
|
|
|
|
PBE_FLAG equ 80000000h ;Pending Break Enable
|
|
|
|
|
|
|
|
|
|
; ecx cpuid(1)
|
|
|
|
|
SSE3_FLAG equ 0001h ;SSE3 0
|
|
|
|
|
MON_FLAG equ 0008h ;MON -3
|
|
|
|
|
DS_CPL_FLAG equ 0010h ;DS-CPL -4
|
|
|
|
|
VMX_FLAG equ 0020h ;VMX -5
|
|
|
|
|
EST_FLAG equ 0080h ; EST-7
|
|
|
|
|
TM2_FLAG equ 0100h ; TM2-8
|
|
|
|
|
SSSE3_FLAG equ 0200h ;SSSE3 -9
|
|
|
|
|
CNXT_ID_FLAG equ 0400h ;CID -10
|
|
|
|
|
CX16_FLAG equ 2000h ;CX16 - 13
|
|
|
|
|
ETPRD_FLAG equ 4000h ;xTPR - 14
|
|
|
|
|
DCA_FLAG equ 40000h ;DCA - 18
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; edx cpuid(8000_0001h)
|
|
|
|
|
|
|
|
|
|
SYS_FLAG equ 0800h ;11
|
|
|
|
|
|
|
|
|
|
MP_FLAG equ 80000h ;19
|
|
|
|
|
NX_FLAG equ 100000h ;20
|
|
|
|
|
MMXPi_FLAG equ 400000h ;22
|
|
|
|
|
MMXn_FLAG equ 800000h ;23
|
|
|
|
|
FXSRn_FLAG equ 1000000h ;24 it is <EFBFBD><EFBFBD><EFBFBD>+ for Cyrix
|
|
|
|
|
FFXSR_FLAG equ 2000000h ;25
|
|
|
|
|
TSCP_FLAG equ 8000000h ;27
|
|
|
|
|
LM_FLAG equ 20000000h ;29 EM64T
|
|
|
|
|
DNo_FLAG equ 40000000h ;30
|
|
|
|
|
DN_FLAG equ 80000000h ;31
|
|
|
|
|
|
|
|
|
|
; ecx cpuid(8000_0001h)
|
|
|
|
|
LAHF_FLAG equ 0001h ; LAHF 0
|
|
|
|
|
CMPL_FLAG equ 0002h ; core multi-processing legacy mode 1
|
|
|
|
|
SVM_FLAG equ 0004h ; secure virtual machine 2
|
|
|
|
|
MOVCR8_FLAG equ 0010h ;AltMovCr8 4
|
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
;//////////////////////////////////////////////
|
|
|
|
|
decode_sse3: ; is SS3 supported
|
|
|
|
|
xor eax, eax
|
|
|
|
|
inc eax
|
|
|
|
|
cpuid
|
|
|
|
|
test ecx, 1
|
|
|
|
|
setnz [sse3sup]
|
|
|
|
|
mov eax, sse3+6
|
|
|
|
|
|
|
|
|
|
write_yes_no:
|
|
|
|
|
mov dword [eax], 'no'
|
|
|
|
|
jz @f
|
|
|
|
|
mov dword [eax], 'yes'
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
show_next_bit:
|
|
|
|
|
shr edx, 1
|
|
|
|
|
write_yes_no_cf:
|
|
|
|
|
mov dword [eax], 'no'
|
|
|
|
|
jnc @f
|
|
|
|
|
mov dword [eax], 'yes'
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
|
|
|
|
;decoding standard features
|
|
|
|
|
|
|
|
|
|
decode_standard_features:
|
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
inc eax
|
|
|
|
|
cpuid
|
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, FPU+6
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, VME+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, DE+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PSE+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, TSC+6
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MSR+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PAE+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MCE+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, CX8+6
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, APIC+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
shr edx, 1 ; skip reserved bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SEP+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MTRR+6
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PGE+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MCA+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, CMOV+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PAT+6
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PSE36+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PSNUM+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, CLFLUSHn+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
shr edx, 1 ; skip reserved bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, DTS+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, ACPI+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MMX+8
|
|
|
|
|
call show_next_bit
|
|
|
|
|
mov eax, [eax]
|
|
|
|
|
mov [MMXs+7], eax
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, FXSR+6
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SSE+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SSE2+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SSn+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
shr edx, 1
|
|
|
|
|
; mov eax, HTT+8
|
|
|
|
|
; test edx, HTT_FLAG
|
|
|
|
|
; call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, TM+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, IA64+7
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, PBE+8
|
|
|
|
|
call show_next_bit
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
ret
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
|
|
|
|
;//////////////////////////////////////////////
|
|
|
|
|
decode_extended_features:
|
2007-06-04 13:21:07 +04:00
|
|
|
|
; is called immediately after decode_standard_features
|
|
|
|
|
; xor eax, eax
|
|
|
|
|
; inc eax
|
|
|
|
|
; cpuid
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SS3+8
|
|
|
|
|
test ecx, SSE3_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MON+8
|
|
|
|
|
test ecx, MON_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, DS_CPL+8
|
|
|
|
|
test ecx, DS_CPL_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, EST+8
|
|
|
|
|
test ecx, EST_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, TM2+8
|
|
|
|
|
test ecx, TM2_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, CNXT_ID+12
|
|
|
|
|
test ecx, CNXT_ID_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, CX16+12
|
|
|
|
|
test ecx, CX16_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, ETPRD+12
|
|
|
|
|
test ecx, ETPRD_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, VMX+8
|
|
|
|
|
test ecx, VMX_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SSSE3+12
|
|
|
|
|
test ecx, SSSE3_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, DCA+8
|
|
|
|
|
test ecx, DCA_FLAG
|
|
|
|
|
call write_yes_no
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
decode_extended:
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, $80000000
|
|
|
|
|
cpuid
|
|
|
|
|
mov [extc], eax ; max number of calls
|
|
|
|
|
test eax, eax
|
|
|
|
|
jns @b
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, $80000001 ;// Setup extended function 8000_0001h
|
|
|
|
|
cpuid
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MP+8
|
|
|
|
|
test edx, MP_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, NX+8
|
|
|
|
|
test edx, NX_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
|
|
|
|
;jmp Tez3 we do detection in another place, because of Cyrix specific MMX+ detection
|
2007-06-04 13:21:07 +04:00
|
|
|
|
; mov eax, MMXPi+8
|
|
|
|
|
; test edx, MMXPi_FLAG
|
|
|
|
|
; call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MMXn+8
|
|
|
|
|
test edx, MMXn_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, FXSRn+8
|
|
|
|
|
test edx, FXSRn_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, FFXSR+12
|
|
|
|
|
test edx, FFXSR_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, TSCP+12
|
|
|
|
|
test edx, TSCP_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, LM+12
|
|
|
|
|
test edx, LM_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, DNo+12
|
|
|
|
|
test edx, DNo_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, DN+12
|
|
|
|
|
test edx, DN_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
|
|
|
|
;Intel
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SYS+12
|
|
|
|
|
test edx, SYS_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, LAF+12
|
|
|
|
|
test ecx, LAHF_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, CMPL+12
|
|
|
|
|
test ecx, CMPL_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, SVM+8
|
|
|
|
|
test ecx, SVM_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
mov eax, MCR8+12
|
|
|
|
|
test ecx, MOVCR8_FLAG
|
|
|
|
|
call write_yes_no
|
2007-02-04 04:47:46 +03:00
|
|
|
|
|
2007-06-04 13:21:07 +04:00
|
|
|
|
ret
|