summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1996-10-20 15:27:54 +0000
committerdm <dm@cvs.openbsd.org>1996-10-20 15:27:54 +0000
commit6a1acd962693afad8e5debc2cbefa6788d968ff9 (patch)
tree2934d8cc9a73201eaf759cdecedd6d937ca5c8d8 /sys/arch/i386/include
parent3f0fcab7e50711e90c15674cc26c70f9ed746e06 (diff)
Truncate rdpmc result to 40 bits. Make pctr.c build with -Wall.
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/pctr.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/i386/include/pctr.h b/sys/arch/i386/include/pctr.h
index e3afcece07f..79f50cd017a 100644
--- a/sys/arch/i386/include/pctr.h
+++ b/sys/arch/i386/include/pctr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.h,v 1.4 1996/08/16 00:02:36 dm Exp $ */
+/* $OpenBSD: pctr.h,v 1.5 1996/10/20 15:27:48 dm Exp $ */
/*
* Pentium performance counter driver for OpenBSD.
@@ -96,11 +96,13 @@ struct pctrst {
})
/* Read the performance counters (Pentium Pro only) */
-#define rdpmc(ctr) \
-({ \
- pctrval v; \
- __asm __volatile (".byte 0xf, 0x33" : "=A" (v) : "c" (ctr)); \
- v; \
+#define rdpmc(ctr) \
+({ \
+ pctrval v; \
+ __asm __volatile (".byte 0xf, 0x33\n" \
+ "\tandl $0xff, %%edx" \
+ : "=A" (v) : "c" (ctr)); \
+ v; \
})
#ifdef _KERNEL