Commit 56f335c8 authored by Grant Grundler's avatar Grant Grundler Committed by Matthew Wilcox

[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: default avatarGrant Grundler <grundler@parisc-linux.org>
Signed-off-by: default avatarKyle McMartin <kyle@parisc-linux.org>
parent 7908a0c7
...@@ -430,8 +430,9 @@ smp_do_timer(struct pt_regs *regs) ...@@ -430,8 +430,9 @@ smp_do_timer(struct pt_regs *regs)
static void __init static void __init
smp_cpu_init(int cpunum) smp_cpu_init(int cpunum)
{ {
extern int init_per_cpu(int); /* arch/parisc/kernel/setup.c */ extern int init_per_cpu(int); /* arch/parisc/kernel/processor.c */
extern void init_IRQ(void); /* arch/parisc/kernel/irq.c */ extern void init_IRQ(void); /* arch/parisc/kernel/irq.c */
extern void start_cpu_itimer(void); /* arch/parisc/kernel/time.c */
/* Set modes and Enable floating point coprocessor */ /* Set modes and Enable floating point coprocessor */
(void) init_per_cpu(cpunum); (void) init_per_cpu(cpunum);
...@@ -457,6 +458,7 @@ smp_cpu_init(int cpunum) ...@@ -457,6 +458,7 @@ smp_cpu_init(int cpunum)
enter_lazy_tlb(&init_mm, current); enter_lazy_tlb(&init_mm, current);
init_IRQ(); /* make sure no IRQ's are enabled or pending */ init_IRQ(); /* make sure no IRQ's are enabled or pending */
start_cpu_itimer();
} }
......
...@@ -223,22 +223,24 @@ unsigned long long sched_clock(void) ...@@ -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) void __init time_init(void)
{ {
unsigned long next_tick;
static struct pdc_tod tod_data; static struct pdc_tod tod_data;
clocktick = (100 * PAGE0->mem_10msec) / HZ; clocktick = (100 * PAGE0->mem_10msec) / HZ;
halftick = clocktick / 2; halftick = clocktick / 2;
/* Setup clock interrupt timing */ start_cpu_itimer(); /* get CPU 0 started */
next_tick = mfctl(16);
next_tick += clocktick;
cpu_data[smp_processor_id()].it_value = next_tick;
/* kick off Itimer (CR16) */
mtctl(next_tick, 16);
if(pdc_tod_read(&tod_data) == 0) { if(pdc_tod_read(&tod_data) == 0) {
write_seqlock_irq(&xtime_lock); write_seqlock_irq(&xtime_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment