From 6a1acd962693afad8e5debc2cbefa6788d968ff9 Mon Sep 17 00:00:00 2001 From: dm Date: Sun, 20 Oct 1996 15:27:54 +0000 Subject: Truncate rdpmc result to 40 bits. Make pctr.c build with -Wall. --- sys/arch/i386/include/pctr.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sys/arch/i386/include/pctr.h') 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 -- cgit v1.2.3