diff options
author | attilio <attilio@FreeBSD.org> | 2010-01-15 16:04:30 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2010-01-15 16:04:30 +0000 |
commit | 1a19fc806c79b22b5f74c37f6686ea202cd20a2f (patch) | |
tree | 8e172425057929ebbd5b2388a5f0cf7ea738df03 /sys/pc98/cbus/clock.c | |
parent | fdf6718f335578395478ef7ac4837ac7e13700fa (diff) | |
download | FreeBSD-src-1a19fc806c79b22b5f74c37f6686ea202cd20a2f.zip FreeBSD-src-1a19fc806c79b22b5f74c37f6686ea202cd20a2f.tar.gz |
Handling all the three clocks (hardclock, softclock, profclock) with the
LAPIC may lead to aliasing for softclock and profclock because frequencies
are sized in order to fit mainly hardclock.
atrtc used to take care of the softclock and profclock and it does still
do, if the LAPIC can't handle the clocks properly.
Revert the change when the LAPIC started taking charge of all three of
them and let atrtc handle softclock and profclock if not explicitly
requested. Such request can be made setting != 0 the new tunable
machdep.lapic_allclocks or if the new device ATPIC is not present
within the i386 kernel config (atrtc is linked to atpic presence).
Diagnosed by: Sandvine Incorporated
Reviewed by: jhb, emaste
Sponsored by: Sandvine Incorporated
MFC: 3 weeks
Diffstat (limited to 'sys/pc98/cbus/clock.c')
-rw-r--r-- | sys/pc98/cbus/clock.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index bb651bd..7300593 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -101,7 +101,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 enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -164,7 +164,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); #ifdef KDTRACE_HOOKS /* @@ -360,7 +361,7 @@ set_i8254_freq(u_int freq, int intr_freq) i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -443,7 +444,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); |