summaryrefslogtreecommitdiffstats
path: root/sys/mips/mips/tick.c
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2010-03-20 05:49:06 +0000
committerneel <neel@FreeBSD.org>2010-03-20 05:49:06 +0000
commite17e52b7e2dffab4f1200b2f010c3ef8cb1132d7 (patch)
treecacc3b5710d157a71c058bde1ec018801c05c21d /sys/mips/mips/tick.c
parentacca987bde60a7b3b11dabcb24b9870f71e22546 (diff)
downloadFreeBSD-src-e17e52b7e2dffab4f1200b2f010c3ef8cb1132d7.zip
FreeBSD-src-e17e52b7e2dffab4f1200b2f010c3ef8cb1132d7.tar.gz
Sibyte provides a 64-bit read-only counter that counts at half the processor
frequency. This counter can be accessed coherently from both cores. Use this as the preferred timecounter for the SWARM kernels. The CP0 COUNT register is unusable as the timecounter on SMP platforms because the COUNT registers on different CPUs are not guaranteed to be in sync.
Diffstat (limited to 'sys/mips/mips/tick.c')
-rw-r--r--sys/mips/mips/tick.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/mips/mips/tick.c b/sys/mips/mips/tick.c
index bf147c5..b83d83f 100644
--- a/sys/mips/mips/tick.c
+++ b/sys/mips/mips/tick.c
@@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$");
uint64_t counter_freq;
+struct timecounter *platform_timecounter;
+
static uint64_t cycles_per_tick;
static uint64_t cycles_per_usec;
static uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz;
@@ -103,6 +105,9 @@ platform_initclocks(void)
{
tc_init(&counter_timecounter);
+
+ if (platform_timecounter != NULL)
+ tc_init(platform_timecounter);
}
static uint64_t
OpenPOWER on IntegriCloud