summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-01-29 13:36:18 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-01-29 13:36:18 +0000
commit6ac25ce24a97b120453710a49a05d9f8515662d8 (patch)
treec30f95b9b0081fb4a20c23fbdfea810d993564fc /sys/arch/i386
parent3e231b2f9e4cbd6ea5b412aeb005d56c5e2547be (diff)
Only start using the rtc for statclock after we've received the first
interrupt. On some machines the rtc doesn't generate interrupts and we would end up not running statclock() at all. ok miod@, art@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/isa/clock.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 3e3661a2aee..dd2cc70c26a 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.41 2007/11/28 17:05:09 tedu Exp $ */
+/* $OpenBSD: clock.c,v 1.42 2009/01/29 13:36:17 kettenis Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -235,6 +235,14 @@ rtcintr(void *arg)
struct clockframe *frame = arg; /* not strictly necessary */
u_int stat = 0;
+ if (stathz == 0) {
+ extern int psratio;
+
+ stathz = 128;
+ profhz = 1024;
+ psratio = profhz / stathz;
+ }
+
/*
* If rtcintr is 'late', next intr may happen immediately.
* Get them all. (Also, see comment in cpu_initclocks().)
@@ -393,8 +401,6 @@ void
i8254_initclocks(void)
{
static struct timeout rtcdrain_timeout;
- stathz = 128;
- profhz = 1024;
/*
* XXX If you're doing strange things with multiple clocks, you might