summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include/cpu.h
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1996-08-08 18:47:16 +0000
committerdm <dm@cvs.openbsd.org>1996-08-08 18:47:16 +0000
commitfc324e99fe923f248e62fb00affd7bd498b4de96 (patch)
treee2ffbcfe4962d0a150f82893ba1e0dcd09ec0d2e /sys/arch/i386/include/cpu.h
parent007f71c041a4844e5d9550ae4ce2db21388b283d (diff)
Added a pctr pseudo-device for accessing the Pentium performance counters,
and a program pctrctl to set the counter functions.
Diffstat (limited to 'sys/arch/i386/include/cpu.h')
-rw-r--r--sys/arch/i386/include/cpu.h40
1 files changed, 19 insertions, 21 deletions
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 4f5cbd78e41..3abe70557f5 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -99,27 +99,25 @@ void delay __P((int));
/*
* High resolution clock support (Pentium only)
*/
-#define CPU_CLOCKUPDATE(otime, ntime) \
- do { \
- if (pentium_mhz) { \
- __asm __volatile("cli\n" \
- "movl (%2), %%eax\n" \
- "movl %%eax, (%1)\n" \
- "movl 4(%2), %%eax\n" \
- "movl %%eax, 4(%1)\n" \
- "movl $0x10, %%ecx\n" \
- "xorl %%eax, %%eax\n" \
- "movl %%eax, %%edx\n" \
- ".byte 0xf, 0x30\n" \
- "sti\n" \
- "#%0%1%2" \
- : "=m" (*otime) \
- : "c" (otime), "b" (ntime) \
- : "ax", "cx", "dx"); \
- } \
- else { \
- *(otime) = *(ntime); \
- } \
+extern u_quad_t pentium_base_tsc;
+#define CPU_CLOCKUPDATE(otime, ntime) \
+ do { \
+ if (pentium_mhz) { \
+ __asm __volatile("cli\n" \
+ "movl (%3), %%eax\n" \
+ "movl %%eax, (%2)\n" \
+ "movl 4(%3), %%eax\n" \
+ "movl %%eax, 4(%2)\n" \
+ ".byte 0xf, 0x31\n" \
+ "sti\n" \
+ "#%0 %1 %2 %3" \
+ : "=m" (*otime), \
+ "=A" (pentium_base_tsc) \
+ : "c" (otime), "b" (ntime)); \
+ } \
+ else { \
+ *(otime) = *(ntime); \
+ } \
} while (0)
#endif
void delay __P((int));