diff options
author | nyan <nyan@FreeBSD.org> | 2002-10-22 15:19:46 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-10-22 15:19:46 +0000 |
commit | 8970451e15459714141bcbef68ae72b0e93fe146 (patch) | |
tree | 1fa3c5e4fb9f7b695ae7ccc29559ea762188958a /sys/pc98 | |
parent | 675ba849a80d7c109b50ea116bddbeffad2de77b (diff) | |
download | FreeBSD-src-8970451e15459714141bcbef68ae72b0e93fe146.zip FreeBSD-src-8970451e15459714141bcbef68ae72b0e93fe146.tar.gz |
MFi386: revisions 1.189 and 1.190.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/cbus/clock.c | 22 | ||||
-rw-r--r-- | sys/pc98/cbus/pcrtc.c | 22 | ||||
-rw-r--r-- | sys/pc98/pc98/clock.c | 22 |
3 files changed, 30 insertions, 36 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 94c5771..31b8188 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -874,14 +874,6 @@ set_timer_freq(u_int freq, int intr_freq) mtx_unlock_spin(&clock_lock); } -/* - * i8254_restore is called from apm_default_resume() to reload - * the countdown register. - * this should not be necessary but there are broken laptops that - * do not restore the countdown register on resume. - * when it happnes, it messes up the hardclock interval and system clock, - * which leads to the infamous "calcru: negative time" problem. - */ static void i8254_restore(void) { @@ -898,15 +890,20 @@ static void rtc_restore(void) { - /* Reenable RTC updates and interrupts. */ - /* XXX locking is needed for RTC access? */ - writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + /* Restore all of the RTC's "status" (actually, control) registers. */ + /* XXX locking is needed for RTC access. */ + writertc(RTC_STATUSB, RTCSB_24HR); + writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, rtc_statusb); } #endif /* - * Restore all the timers atomically. + * Restore all the timers non-atomically (XXX: should be atomically). + * + * This function is called from pmtimer_resume() to restore all the timers. + * This should not be necessary, but there are broken laptops that do not + * restore all the timers on resume. */ void timer_restore(void) @@ -1431,6 +1428,7 @@ cpu_initclocks() * on the IO APIC. * Workaround: Limited variant of mixed mode. */ + crit = intr_disable(); mtx_lock_spin(&icu_lock); INTRDIS(1 << apic_8254_intr); diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 94c5771..31b8188 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -874,14 +874,6 @@ set_timer_freq(u_int freq, int intr_freq) mtx_unlock_spin(&clock_lock); } -/* - * i8254_restore is called from apm_default_resume() to reload - * the countdown register. - * this should not be necessary but there are broken laptops that - * do not restore the countdown register on resume. - * when it happnes, it messes up the hardclock interval and system clock, - * which leads to the infamous "calcru: negative time" problem. - */ static void i8254_restore(void) { @@ -898,15 +890,20 @@ static void rtc_restore(void) { - /* Reenable RTC updates and interrupts. */ - /* XXX locking is needed for RTC access? */ - writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + /* Restore all of the RTC's "status" (actually, control) registers. */ + /* XXX locking is needed for RTC access. */ + writertc(RTC_STATUSB, RTCSB_24HR); + writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, rtc_statusb); } #endif /* - * Restore all the timers atomically. + * Restore all the timers non-atomically (XXX: should be atomically). + * + * This function is called from pmtimer_resume() to restore all the timers. + * This should not be necessary, but there are broken laptops that do not + * restore all the timers on resume. */ void timer_restore(void) @@ -1431,6 +1428,7 @@ cpu_initclocks() * on the IO APIC. * Workaround: Limited variant of mixed mode. */ + crit = intr_disable(); mtx_lock_spin(&icu_lock); INTRDIS(1 << apic_8254_intr); diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c index 94c5771..31b8188 100644 --- a/sys/pc98/pc98/clock.c +++ b/sys/pc98/pc98/clock.c @@ -874,14 +874,6 @@ set_timer_freq(u_int freq, int intr_freq) mtx_unlock_spin(&clock_lock); } -/* - * i8254_restore is called from apm_default_resume() to reload - * the countdown register. - * this should not be necessary but there are broken laptops that - * do not restore the countdown register on resume. - * when it happnes, it messes up the hardclock interval and system clock, - * which leads to the infamous "calcru: negative time" problem. - */ static void i8254_restore(void) { @@ -898,15 +890,20 @@ static void rtc_restore(void) { - /* Reenable RTC updates and interrupts. */ - /* XXX locking is needed for RTC access? */ - writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + /* Restore all of the RTC's "status" (actually, control) registers. */ + /* XXX locking is needed for RTC access. */ + writertc(RTC_STATUSB, RTCSB_24HR); + writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, rtc_statusb); } #endif /* - * Restore all the timers atomically. + * Restore all the timers non-atomically (XXX: should be atomically). + * + * This function is called from pmtimer_resume() to restore all the timers. + * This should not be necessary, but there are broken laptops that do not + * restore all the timers on resume. */ void timer_restore(void) @@ -1431,6 +1428,7 @@ cpu_initclocks() * on the IO APIC. * Workaround: Limited variant of mixed mode. */ + crit = intr_disable(); mtx_lock_spin(&icu_lock); INTRDIS(1 << apic_8254_intr); |