From b563e748a9fe1f08ff11ade92b0caa52d3ea1b47 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 1 Jul 1997 01:18:38 +0000 Subject: [PATCH] Added ifdefs so that this compiles when neither I586_CPU nor I586_CPU is defined, or SMP is defined. It is silly to configure PERFMON when it can't work (it will be disabled at runtime), but I like to leave the PERFMON configuration alone when I temporarily disable support for modern CPUs to run regression tests. Removed an unused #include. --- sys/i386/i386/perfmon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/i386/i386/perfmon.c b/sys/i386/i386/perfmon.c index 0c13773b7ddf..5542173ccf2f 100644 --- a/sys/i386/i386/perfmon.c +++ b/sys/i386/i386/perfmon.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: perfmon.c,v 1.10 1997/02/22 09:32:35 peter Exp $ */ #include "opt_cpu.h" @@ -34,11 +34,12 @@ #include #include #include -#include +#ifndef SMP #include #include #include +#endif #include static int perfmon_inuse; @@ -57,6 +58,7 @@ static int writectl6(int); void perfmon_init(void) { +#ifndef SMP switch(cpu_class) { case CPUCLASS_586: perfmon_cpuok = 1; @@ -79,6 +81,7 @@ perfmon_init(void) perfmon_cpuok = 0; break; } +#endif /* SMP */ } int @@ -339,6 +342,7 @@ perfmon_ioctl(dev_t dev, int cmd, caddr_t param, int flags, struct proc *p) rv = perfmon_read(pmcd->pmcd_num, &pmcd->pmcd_value); break; +#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) case PMIOTSTAMP: pmct = (struct pmc_tstamp *)param; /* XXX interface loses precision. */ @@ -346,6 +350,7 @@ perfmon_ioctl(dev_t dev, int cmd, caddr_t param, int flags, struct proc *p) pmct->pmct_value = rdtsc(); rv = 0; break; +#endif default: rv = ENOTTY;