aboutsummaryrefslogtreecommitdiff
path: root/sys/isa
diff options
context:
space:
mode:
authorMitsuru IWASAKI <iwasaki@FreeBSD.org>2001-09-04 16:02:06 +0000
committerMitsuru IWASAKI <iwasaki@FreeBSD.org>2001-09-04 16:02:06 +0000
commitdb2077f8e1407c2f1b9b32c0221503298ae85ddd (patch)
tree8a086694659c8036602488a9827a9d6cebf5ab57 /sys/isa
parent38090f05c2998c92ac60ef6595f6b0a06d111301 (diff)
Notes
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/atrtc.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index e0a638ee08d6f..1893b197009be 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -705,7 +705,7 @@ set_timer_freq(u_int freq, int intr_freq)
* when it happnes, it messes up the hardclock interval and system clock,
* which leads to the infamous "calcru: negative time" problem.
*/
-void
+static void
i8254_restore(void)
{
@@ -716,6 +716,27 @@ i8254_restore(void)
mtx_unlock_spin(&clock_lock);
}
+static void
+rtc_restore(void)
+{
+
+ /* Reenable RTC updates and interrupts. */
+ /* XXX locking is needed for RTC access? */
+ writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
+ writertc(RTC_STATUSB, rtc_statusb);
+}
+
+/*
+ * Restore all the timers atomically.
+ */
+void
+timer_restore(void)
+{
+
+ i8254_restore(); /* restore timer_freq and hz */
+ rtc_restore(); /* reenable RTC interrupts */
+}
+
/*
* Initialize 8254 timer 0 early so that it can be used in DELAY().
* XXX initialization of other timers is unintentionally left blank.