summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/aim/clock.c')
-rw-r--r--sys/powerpc/aim/clock.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/powerpc/aim/clock.c b/sys/powerpc/aim/clock.c
index 0a5391f..a60878c 100644
--- a/sys/powerpc/aim/clock.c
+++ b/sys/powerpc/aim/clock.c
@@ -95,8 +95,7 @@ static struct timecounter decr_timecounter = {
void
decr_intr(struct trapframe *frame)
{
- long tick;
- int nticks;
+ int32_t tick, nticks;
/*
* Check whether we are initialized.
@@ -112,13 +111,17 @@ decr_intr(struct trapframe *frame)
for (nticks = 0; tick < 0; nticks++)
tick += ticks_per_intr;
mtdec(tick);
+if (nticks > 5) printf("BIG NTICKS on CPU %d: %x\n",PCPU_GET(cpuid),nticks);
- if (PCPU_GET(cpuid) == 0) {
- while (nticks-- > 0)
+ while (nticks-- > 0) {
+ if (PCPU_GET(cpuid) == 0)
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
- } else {
- while (nticks-- > 0)
+ else
hardclock_cpu(TRAPF_USERMODE(frame));
+
+ statclock(TRAPF_USERMODE(frame));
+ if (profprocs != 0)
+ profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
}
}
@@ -145,6 +148,8 @@ decr_init(void)
ticks_per_intr = ticks_per_sec / hz;
mtdec(ticks_per_intr);
+ set_cputicker(mftb, ticks_per_sec, 0);
+
mtmsr(msr);
}
OpenPOWER on IntegriCloud