summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-09-16 17:11:33 +0000
committermarcel <marcel@FreeBSD.org>2008-09-16 17:11:33 +0000
commit79892756cd617d3c35e4bb2a2d5d346cbec9efe4 (patch)
treeb92df969751d8d86ec28bf51b34002c591e17eca /sys
parentbe2207880385547d7271b39cb1a88f90e9af385b (diff)
downloadFreeBSD-src-79892756cd617d3c35e4bb2a2d5d346cbec9efe4.zip
FreeBSD-src-79892756cd617d3c35e4bb2a2d5d346cbec9efe4.tar.gz
o In decr_get_timecount() only read the low timebase register.
We're only returning a 32-bit counter. o In decr_intr(), manually perform LICM, so that we don't test a loop invariant condition inside a loop. o Include <machine/smp.h>
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/aim/clock.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/powerpc/aim/clock.c b/sys/powerpc/aim/clock.c
index 6b1dffa..ac6aa2d 100644
--- a/sys/powerpc/aim/clock.c
+++ b/sys/powerpc/aim/clock.c
@@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/intr.h>
#include <machine/md_var.h>
+#include <machine/smp.h>
/*
* Initially we assume a processor with a bus frequency of 12.5 MHz.
@@ -112,10 +113,11 @@ decr_intr(struct trapframe *frame)
tick += ticks_per_intr;
mtdec(tick);
- while (nticks-- > 0) {
- if (PCPU_GET(cpuid) == 0)
+ if (PCPU_GET(cpuid) == 0) {
+ while (nticks-- > 0)
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
- else
+ } else {
+ while (nticks-- > 0)
hardclock_cpu(TRAPF_USERMODE(frame));
}
}
@@ -184,7 +186,10 @@ mftb(void)
static unsigned
decr_get_timecount(struct timecounter *tc)
{
- return mftb();
+ register_t tb;
+
+ __asm __volatile("mftb %0" : "=r"(tb));
+ return (tb);
}
/*
OpenPOWER on IntegriCloud