Espresso 0.0.2a
This commit is contained in:
57
arch/x86/cpuid.s
Normal file
57
arch/x86/cpuid.s
Normal file
@ -0,0 +1,57 @@
|
||||
|
||||
|
||||
/*
|
||||
Just a bunch of CPUID stuff.
|
||||
*/
|
||||
|
||||
.extern sse_initialized
|
||||
|
||||
.section .text
|
||||
|
||||
|
||||
_init_cpuid:
|
||||
pusha
|
||||
|
||||
pushf
|
||||
pop %eax
|
||||
mov %eax, %ecx
|
||||
xor $0x200000, %eax
|
||||
push %eax
|
||||
popf
|
||||
/*pushf*/
|
||||
pop %eax
|
||||
xor %ecx, %eax
|
||||
jz .no_cpuid
|
||||
|
||||
lea _has_cpuid, %edi
|
||||
movl $1, (%edi)
|
||||
|
||||
jmp .done
|
||||
|
||||
.no_cpuid:
|
||||
lea _has_cpuid, %edi
|
||||
movl $0, (%edi)
|
||||
|
||||
jmp .done
|
||||
|
||||
.done:
|
||||
popa
|
||||
|
||||
ret
|
||||
|
||||
_sse_level:
|
||||
lea _has_sse, %edi
|
||||
lea sse_initialized, %esi
|
||||
|
||||
movl (%esi), %eax
|
||||
|
||||
movl %eax, (%edi)
|
||||
|
||||
|
||||
.section .data
|
||||
|
||||
.global _has_cpuid
|
||||
|
||||
_has_cpuid: .int 0
|
||||
_has_sse: .int 0
|
||||
_has_mmx: .int 0
|
||||
Reference in New Issue
Block a user