at_wini also needs a pci_reserve() for the pci compatability device, if
[minix3.git] / lib / sysutil / read_tsc.s
blob5d45b090da8aefeb4581ac8a69fe6ffa9cc27908
1 #
2 ! sections
4 .sect .text; .sect .rom; .sect .data; .sect .bss
6 .define _read_tsc ! read the cycle counter (Pentium and up)
8 .sect .text
9 !*===========================================================================*
10 ! PUBLIC void read_tsc(unsigned long *high, unsigned long *low);
11 ! Read the cycle counter of the CPU. Pentium and up.
12 .align 16
13 _read_tsc:
14 .data1 0x0f ! this is the RDTSC instruction
15 .data1 0x31 ! it places the TSC in EDX:EAX
16 push ebp
17 mov ebp, 8(esp)
18 mov (ebp), edx
19 mov ebp, 12(esp)
20 mov (ebp), eax
21 pop ebp
22 ret