diff options
-rw-r--r-- | sys/arch/i386/i386/pctr.c | 7 | ||||
-rw-r--r-- | sys/arch/i386/include/pctr.h | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/arch/i386/i386/pctr.c b/sys/arch/i386/i386/pctr.c index a31a53e22e2..c935bd3e17e 100644 --- a/sys/arch/i386/i386/pctr.c +++ b/sys/arch/i386/i386/pctr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pctr.c,v 1.6 1996/08/16 00:02:36 dm Exp $ */ +/* $OpenBSD: pctr.c,v 1.7 1996/10/20 15:27:53 dm Exp $ */ /* * Pentium performance counter driver for OpenBSD. @@ -14,6 +14,7 @@ #include <sys/errno.h> #include <sys/fcntl.h> #include <sys/ioccom.h> +#include <sys/systm.h> #include <machine/cputypes.h> #include <machine/psl.h> @@ -105,7 +106,7 @@ p5ctrsel (int fflag, u_int cmd, u_int fn) return 0; } -static inline int +static inline void p5ctrrd (struct pctrst *st) { u_int msr11; @@ -143,7 +144,7 @@ p6ctrsel (int fflag, u_int cmd, u_int fn) return 0; } -static inline int +static inline void p6ctrrd (struct pctrst *st) { st->pctr_fn[0] = rdmsr (P6MSR_CTRSEL0); 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 |