summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/time.c
diff options
context:
space:
mode:
authorGrant Grundler <grundler@gsyprf11.external.hp.com>2006-09-03 00:02:16 -0700
committerMatthew Wilcox <willy@parisc-linux.org>2006-10-04 06:48:07 -0600
commit56f335c89e28c488b1bfea3e5e697fce805c784d (patch)
tree3e1d01e70b85f57a49fb10e60703dafb15b626fc /arch/parisc/kernel/time.c
parent7908a0c72ee78ba5476c2a773d808c77593719c6 (diff)
[PARISC] Add new function to start local Interval Timer, start_cpu_itimer()
I couldn't find where the itimer was getting started for slave CPUs. CPU 0 (master) itimer was started in time_init() (arch/parisc/kernel/time.c). start_cpu_itimer() code was striped from time_init(). Slaves now start their itimer in smp_cpu_init(). This is a first step towards making gettimeoffset() work for SMP. Next step will be to determine the CR16 (cycle counter) offsets for each CPU relative to the master (CPU 0). Signed-off-by: Grant Grundler <grundler@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc/kernel/time.c')
-rw-r--r--arch/parisc/kernel/time.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index ab641d67f55..47831c2cd09 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -223,22 +223,24 @@ unsigned long long sched_clock(void)
}
+void __init start_cpu_itimer(void)
+{
+ unsigned int cpu = smp_processor_id();
+ unsigned long next_tick = mfctl(16) + clocktick;
+
+ mtctl(next_tick, 16); /* kick off Interval Timer (CR16) */
+
+ cpu_data[cpu].it_value = next_tick;
+}
+
void __init time_init(void)
{
- unsigned long next_tick;
static struct pdc_tod tod_data;
clocktick = (100 * PAGE0->mem_10msec) / HZ;
halftick = clocktick / 2;
- /* Setup clock interrupt timing */
-
- next_tick = mfctl(16);
- next_tick += clocktick;
- cpu_data[smp_processor_id()].it_value = next_tick;
-
- /* kick off Itimer (CR16) */
- mtctl(next_tick, 16);
+ start_cpu_itimer(); /* get CPU 0 started */
if(pdc_tod_read(&tod_data) == 0) {
write_seqlock_irq(&xtime_lock);