Changeset 7df54df in mainline for arch/amd64/src/asm_utils.S
- Timestamp:
- 2005-09-02T14:00:48Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 32f6e1bd
- Parents:
- 73838ed
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/asm_utils.S
r73838ed r7df54df 44 44 movq $halt, (%rsp) 45 45 jmp printf 46 47 .global has_cpuid 48 .global rdtsc 49 50 51 ## Determine CPUID support 52 # 53 # Return 0 in EAX if CPUID is not support, 1 if supported. 54 # 55 has_cpuid: 56 pushq %rbx 57 58 pushfq # store flags 59 popq %rax # read flags 60 movq %rax,%rbx # copy flags 61 btcl $21,%ebx # swap the ID bit 62 pushq %rbx 63 popfq # propagate the change into flags 64 pushfq 65 popq %rbx # read flags 66 andl $(1<<21),%eax # interested only in ID bit 67 andl $(1<<21),%ebx 68 xorl %ebx,%eax # 0 if not supported, 1 if supported 69 70 popq %rbx 71 ret 72 73 74 rdtsc: 75 xorq %rax,%rax 76 rdtsc 77 ret 78 46 79 47 80 # Push all general purpose registers on stack except %rbp, %rsp
Note:
See TracChangeset
for help on using the changeset viewer.