From 36c98549433ec4bf6a664ab621951cae4adcfc67 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Sat, 29 Jan 2000 04:27:49 +0000 Subject: separate clock init, to be called upon resume from apm sleeps --- sys/arch/i386/isa/clock.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'sys/arch/i386/isa') 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 -- cgit v1.2.3