summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-01-29 04:27:49 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-01-29 04:27:49 +0000
commit36c98549433ec4bf6a664ab621951cae4adcfc67 (patch)
tree334c340ffb9a8512e2e53b1f5738cbc0318f4679
parent1f43b36ad03c75551a5b365356f3a17508dc4850 (diff)
separate clock init, to be called upon resume from apm sleeps
-rw-r--r--sys/arch/i386/include/cpu.h3
-rw-r--r--sys/arch/i386/isa/clock.c18
2 files changed, 14 insertions, 7 deletions
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 3cea1adab7d..b96549d3b54 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.28 1999/09/12 19:44:04 weingart Exp $ */
+/* $OpenBSD: cpu.h,v 1.29 2000/01/29 04:27:48 mickey Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -196,6 +196,7 @@ void switch_exit __P((struct proc *));
void proc_trampoline __P((void));
/* clock.c */
+void initrtclock __P((void));
void startrtclock __P((void));
/* npx.c */
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 2bc4d6ce3a2..aed8f785522 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.20 1999/10/06 07:36:55 deraadt Exp $ */
+/* $OpenBSD: clock.c,v 1.21 2000/01/29 04:27:48 mickey Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -179,17 +179,23 @@ startrtclock()
findcpuspeed(); /* use the clock (while it's free)
to find the cpu speed */
+ initrtclock();
+
+ /* Check diagnostic status */
+ if ((s = mc146818_read(NULL, NVRAM_DIAG)) != 0) /* XXX softc */
+ printf("RTC BIOS diagnostic error %b\n", (unsigned int) s,
+ NVRAM_DIAG_BITS);
+}
+
+void
+initrtclock()
+{
/* initialize 8253 clock */
outb(TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT);
/* Correct rounding will buy us a better precision in timekeeping */
outb(IO_TIMER1, TIMER_DIV(hz) % 256);
outb(IO_TIMER1, TIMER_DIV(hz) / 256);
-
- /* Check diagnostic status */
- if ((s = mc146818_read(NULL, NVRAM_DIAG)) != 0) /* XXX softc */
- printf("RTC BIOS diagnostic error %b\n", (unsigned int) s,
- NVRAM_DIAG_BITS);
}
int