58 lines
662 B
ArmAsm
58 lines
662 B
ArmAsm
|
|
|
||
|
|
|
||
|
|
/*
|
||
|
|
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
|