summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-05-24 11:40:49 +0000
committermav <mav@FreeBSD.org>2010-05-24 11:40:49 +0000
commit48198e3ddd922d3260be990c8ecc8fc16f27d470 (patch)
treeba159db619ea3e7bf5e0ee0418e43865078c742f /sys/pc98/cbus
parent598285f6f9f5354c0c6d341c1c8cd78e9981c0f5 (diff)
downloadFreeBSD-src-48198e3ddd922d3260be990c8ecc8fc16f27d470.zip
FreeBSD-src-48198e3ddd922d3260be990c8ecc8fc16f27d470.tar.gz
- Implement MI helper functions, dividing one or two timer interrupts with
arbitrary frequencies into hardclock(), statclock() and profclock() calls. Same code with minor variations duplicated several times over the tree for different timer drivers and architectures. - Switch all x86 archs to new functions, simplifying the code and removing extra logic from timer drivers. Other archs are also welcome.
Diffstat (limited to 'sys/pc98/cbus')
-rw-r--r--sys/pc98/cbus/clock.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c
index 8c5a7d2..2f2c08c 100644
--- a/sys/pc98/cbus/clock.c
+++ b/sys/pc98/cbus/clock.c
@@ -129,10 +129,7 @@ int
hardclockintr(struct trapframe *frame)
{
- if (PCPU_GET(cpuid) == 0)
- hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
- else
- hardclock_cpu(TRAPF_USERMODE(frame));
+ timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
return (FILTER_HANDLED);
}
@@ -143,13 +140,6 @@ statclockintr(struct trapframe *frame)
return (FILTER_HANDLED);
}
-int
-profclockintr(struct trapframe *frame)
-{
-
- return (FILTER_HANDLED);
-}
-
static int
clkintr(struct trapframe *frame)
{
@@ -448,6 +438,7 @@ cpu_initclocks()
* timecounter to user a simpler algorithm.
*/
if (using_lapic_timer == LAPIC_CLOCK_NONE) {
+ timer1hz = hz;
intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL,
NULL, INTR_TYPE_CLK, NULL);
i8254_intsrc = intr_lookup_source(0);
@@ -460,6 +451,14 @@ cpu_initclocks()
i8254_timecounter.tc_counter_mask = 0xffff;
set_i8254_freq(i8254_freq, hz);
}
+ if (using_lapic_timer != LAPIC_CLOCK_ALL) {
+ profhz = hz;
+ if (hz < 128)
+ stathz = hz;
+ else
+ stathz = hz / (hz / 128);
+ }
+ timer2hz = 0;
init_TSC_tc();
}
OpenPOWER on IntegriCloud