summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-05-17 18:55:42 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-05-17 18:55:42 +0000
commit51e774820720870dad14790683b2910407ab74e6 (patch)
tree809b583eaee4efb6dfb3c40bac087aeef02afa08 /sys
parent114fa1a96ee88cdd91bb650da8a9d57d3fe8f218 (diff)
properly detect the cpu model for the broken cyrix latch; better fix than pr#2661
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/machdep.c7
-rw-r--r--sys/arch/i386/isa/clock.c19
2 files changed, 8 insertions, 18 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index cdc59b4c026..70c702e7d5e 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.205 2002/05/16 15:33:05 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.206 2002/05/17 18:55:41 mickey Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -1041,6 +1041,7 @@ cyrix6x86_cpu_setup(cpu_device, model, step)
int model, step;
{
#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
+ extern int clock_broken_latch;
switch (model) {
case -1: /* M1 w/o cpuid */
@@ -1060,6 +1061,10 @@ cyrix6x86_cpu_setup(cpu_device, model, step)
printf("%s: xchg bug workaround performed\n", cpu_device);
break; /* fallthrough? */
+ case 0x440:
+ case 0x540:
+ clock_broken_latch = 1;
+ break;
}
#endif
}
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index e86cda7777c..13606cbb005 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.26 2002/05/16 15:33:10 mickey Exp $ */
+/* $OpenBSD: clock.c,v 1.27 2002/05/17 18:55:41 mickey Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -148,7 +148,7 @@ 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)
+#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
int pentium_mhz, clock_broken_latch;
#endif
@@ -227,21 +227,6 @@ initrtclock()
/* Correct rounding will buy us a better precision in timekeeping */
outb(IO_TIMER1, TIMER_DIV(hz) % 256);
outb(IO_TIMER1, TIMER_DIV(hz) / 256);
-
-#if defined(CPU_I586) || defined(CPU_I686)
- {
- extern int cpu_id;
- switch (cpu_id) {
- case 0x440: /* Cyrix MediaGX */
- case 0x540: /* Cyrix GXm */
- clock_broken_latch = 1;
- break;
- default:
- clock_broken_latch = 0;
- break;
- }
- }
-#endif
}
int