diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2005-02-28 23:37:35 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2005-02-28 23:37:35 +0000 |
| commit | c29f1e2b3b549c7aa51efc0efa3ab520b33d6171 (patch) | |
| tree | cbf1056653b0a15ba5ee28bf92b70393252caed4 /sys/amd64/isa/clock.c | |
| parent | 0c5397aa69fa4319f9ed02489301e2273bdff9d6 (diff) | |
Notes
Diffstat (limited to 'sys/amd64/isa/clock.c')
| -rw-r--r-- | sys/amd64/isa/clock.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index de0d7d5279e5..d4bf5765dfcb 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -70,9 +70,7 @@ __FBSDID("$FreeBSD$"); #include <machine/intr_machdep.h> #include <machine/md_var.h> #include <machine/psl.h> -#ifdef SMP -#include <machine/smp.h> -#endif +#include <machine/apicvar.h> #include <machine/specialreg.h> #include <amd64/isa/isa.h> @@ -113,6 +111,7 @@ static u_int32_t i8254_lastcount; static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; +static int using_lapic_timer; static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR; @@ -151,10 +150,8 @@ clkintr(struct clockframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - hardclock(frame); -#ifdef SMP - forward_hardclock(); -#endif + if (!using_lapic_timer) + hardclock(frame); } int @@ -221,9 +218,6 @@ rtcintr(struct clockframe *frame) } if (pscnt == psdiv) statclock(frame); -#ifdef SMP - forward_statclock(); -#endif } } @@ -730,7 +724,8 @@ cpu_initclocks() { int diag; - if (statclock_disable) { + using_lapic_timer = lapic_setup_clock(); + if (statclock_disable || using_lapic_timer) { /* * The stat interrupt mask is different without the * statistics clock. Also, don't set the interrupt @@ -756,7 +751,7 @@ cpu_initclocks() writertc(RTC_STATUSB, RTCSB_24HR); /* Don't bother enabling the statistics clock. */ - if (!statclock_disable) { + if (!statclock_disable && !using_lapic_timer) { diag = rtcin(RTC_DIAG); if (diag != 0) printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); @@ -775,6 +770,8 @@ void cpu_startprofclock(void) { + if (using_lapic_timer) + return; rtc_statusa = RTCSA_DIVIDER | RTCSA_PROF; writertc(RTC_STATUSA, rtc_statusa); psdiv = pscnt = psratio; @@ -784,6 +781,8 @@ void cpu_stopprofclock(void) { + if (using_lapic_timer) + return; rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; writertc(RTC_STATUSA, rtc_statusa); psdiv = pscnt = 1; |
