mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-11 15:09:32 +00:00
40 lines
527 B
ArmAsm
40 lines
527 B
ArmAsm
.section .text
|
|
|
|
.global asmPause
|
|
asmPause:
|
|
pause
|
|
ret
|
|
|
|
.global asmReadRdtsc
|
|
asmReadRdtsc:
|
|
rdtsc
|
|
shlq $0x20, %rdx
|
|
orq %rdx, %rax
|
|
ret
|
|
|
|
.global asmCpuid
|
|
asmCpuid:
|
|
pushq %rbx
|
|
|
|
mov %ecx, %eax
|
|
pushq %rax
|
|
|
|
pushq %rdx
|
|
cpuid
|
|
|
|
test %r9, %r9
|
|
jz .SkipEcx
|
|
mov %ecx, (%r9)
|
|
.SkipEcx:
|
|
popq %rcx
|
|
jrcxz .SkipEax
|
|
mov %eax, (%rcx)
|
|
.SkipEax:
|
|
mov %r8, %rcx
|
|
jrcxz .SkipEbx
|
|
mov %ebx, (%rcx)
|
|
.SkipEbx:
|
|
popq %rax
|
|
popq %rbx
|
|
ret
|