summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2004-02-27 21:07:50 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2004-02-27 21:07:50 +0000
commit7e8c2ed9cc5ceb5d64086482a297efa79f805523 (patch)
tree50911006a5a38178bf12d22ae790601c86094091
parentc2cf121f1d2db9820dbc07b7c2936029064e98ae (diff)
Cleanup I[3456]86_CPU defines usage, unbreaks compilation
without some of them. Problem reported by William Culler <william@neo.rr.com>. Help from tedu@ chris@, ok tedu@ chris@ deraadt@.
-rw-r--r--sys/arch/i386/i386/machdep.c12
-rw-r--r--sys/arch/i386/isa/clock.c7
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index c33c08137ec..4adf2fbb11e 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.282 2004/02/19 23:31:58 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.283 2004/02/27 21:07:48 grange Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -351,6 +351,7 @@ cyrix_write_reg(u_char reg, u_char data)
outb(0x22, reg);
outb(0x23, data);
}
+#endif
/*
* cpuid instruction. request in eax, result in eax, ebx, ecx, edx.
@@ -369,7 +370,6 @@ cpuid(u_int32_t ax, u_int32_t *regs)
:"0" (ax), "S" (regs)
:"bx", "cx", "dx");
}
-#endif
/*
* Machine-dependent startup code
@@ -2038,9 +2038,11 @@ identifycpu()
cpu_setup(cpu_device, model, step);
#ifndef SMALL_KERNEL
+#if defined(I586_CPU) || defined(I686_CPU)
if (cpu_cpuspeed == NULL && pentium_mhz != 0)
cpu_cpuspeed = pentium_cpuspeed;
#endif
+#endif
cpu_class = class;
@@ -2133,7 +2135,8 @@ identifycpu()
}
-#if !defined(SMALL_KERNEL) && defined(I686_CPU)
+#ifndef SMALL_KERNEL
+#ifdef I686_CPU
int
p4_cpuspeed(int *freq)
{
@@ -2173,7 +2176,9 @@ p4_cpuspeed(int *freq)
return (0);
}
+#endif /* I686_CPU */
+#if defined(I586_CPU) || defined(I686_CPU)
int
pentium_cpuspeed(int *freq)
{
@@ -2181,6 +2186,7 @@ pentium_cpuspeed(int *freq)
return (0);
}
#endif
+#endif /* !SMALL_KERNEL */
#ifdef COMPAT_IBCS2
void ibcs2_sendsig(sig_t, int, int, u_long, int, union sigval);
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index aff710f4a78..2d932ad788f 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.30 2003/06/02 23:27:47 millert Exp $ */
+/* $OpenBSD: clock.c,v 1.31 2004/02/27 21:07:49 grange Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -144,8 +144,11 @@ void rtcdrain(void *);
u_int mc146818_read(void *, u_int);
void mc146818_write(void *, u_int, u_int);
+#if defined(I586_CPU) || defined(I686_CPU)
+int pentium_mhz;
+#endif
#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
-int pentium_mhz, clock_broken_latch;
+int clock_broken_latch;
#endif
#define SECMIN ((unsigned)60) /* seconds per minute */