aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2006-10-07 08:01:11 -0400
committerMatthew Wilcox <willy@parisc-linux.org>2006-10-07 08:01:11 -0400
commitc7753f18711782738936f224aaa421468e87f6ed (patch)
tree7152347bb02452a54beb67a1f553db968c2c5615 /arch
parentbbd6330ea1154fc13a351263160d4f9cca2ff5d9 (diff)
[PARISC] More pt_regs removal
Remove pt_regs from ipi_interrupt and timer_interrupt. Inline smp_do_timer() into its only caller, and unify the SMP and non-SMP paths. Fixes a profiling bug. Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/smp.c15
-rw-r--r--arch/parisc/kernel/time.c24
2 files changed, 12 insertions, 27 deletions
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index faad338f310e..4a23a97b06cd 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -154,7 +154,7 @@ halt_processor(void)
154 154
155 155
156irqreturn_t 156irqreturn_t
157ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) 157ipi_interrupt(int irq, void *dev_id)
158{ 158{
159 int this_cpu = smp_processor_id(); 159 int this_cpu = smp_processor_id();
160 struct cpuinfo_parisc *p = &cpu_data[this_cpu]; 160 struct cpuinfo_parisc *p = &cpu_data[this_cpu];
@@ -414,19 +414,6 @@ smp_flush_tlb_all(void)
414 on_each_cpu(flush_tlb_all_local, NULL, 1, 1); 414 on_each_cpu(flush_tlb_all_local, NULL, 1, 1);
415} 415}
416 416
417
418void
419smp_do_timer(struct pt_regs *regs)
420{
421 int cpu = smp_processor_id();
422 struct cpuinfo_parisc *data = &cpu_data[cpu];
423
424 if (!--data->prof_counter) {
425 data->prof_counter = data->prof_multiplier;
426 update_process_times(user_mode(regs));
427 }
428}
429
430/* 417/*
431 * Called by secondaries to update state and initialize CPU registers. 418 * Called by secondaries to update state and initialize CPU registers.
432 */ 419 */
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 8c9b8a7ef244..bad7d1eb62b9 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -34,10 +34,6 @@
34 34
35static unsigned long clocktick __read_mostly; /* timer cycles per tick */ 35static unsigned long clocktick __read_mostly; /* timer cycles per tick */
36 36
37#ifdef CONFIG_SMP
38extern void smp_do_timer(struct pt_regs *regs);
39#endif
40
41/* 37/*
42 * We keep time on PA-RISC Linux by using the Interval Timer which is 38 * We keep time on PA-RISC Linux by using the Interval Timer which is
43 * a pair of registers; one is read-only and one is write-only; both 39 * a pair of registers; one is read-only and one is write-only; both
@@ -55,13 +51,14 @@ extern void smp_do_timer(struct pt_regs *regs);
55 * held off for an arbitrarily long period of time by interrupts being 51 * held off for an arbitrarily long period of time by interrupts being
56 * disabled, so we may miss one or more ticks. 52 * disabled, so we may miss one or more ticks.
57 */ 53 */
58irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 54irqreturn_t timer_interrupt(int irq, void *dev_id)
59{ 55{
60 unsigned long now; 56 unsigned long now;
61 unsigned long next_tick; 57 unsigned long next_tick;
62 unsigned long cycles_elapsed, ticks_elapsed; 58 unsigned long cycles_elapsed, ticks_elapsed;
63 unsigned long cycles_remainder; 59 unsigned long cycles_remainder;
64 unsigned int cpu = smp_processor_id(); 60 unsigned int cpu = smp_processor_id();
61 struct cpuinfo_parisc *cpuinfo = &cpu_data[cpu];
65 62
66 /* gcc can optimize for "read-only" case with a local clocktick */ 63 /* gcc can optimize for "read-only" case with a local clocktick */
67 unsigned long cpt = clocktick; 64 unsigned long cpt = clocktick;
@@ -69,7 +66,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
69 profile_tick(CPU_PROFILING); 66 profile_tick(CPU_PROFILING);
70 67
71 /* Initialize next_tick to the expected tick time. */ 68 /* Initialize next_tick to the expected tick time. */
72 next_tick = cpu_data[cpu].it_value; 69 next_tick = cpuinfo->it_value;
73 70
74 /* Get current interval timer. 71 /* Get current interval timer.
75 * CR16 reads as 64 bits in CPU wide mode. 72 * CR16 reads as 64 bits in CPU wide mode.
@@ -120,7 +117,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
120 */ 117 */
121 next_tick = now + cycles_remainder; 118 next_tick = now + cycles_remainder;
122 119
123 cpu_data[cpu].it_value = next_tick; 120 cpuinfo->it_value = next_tick;
124 121
125 /* Skip one clocktick on purpose if we are likely to miss next_tick. 122 /* Skip one clocktick on purpose if we are likely to miss next_tick.
126 * We want to avoid the new next_tick being less than CR16. 123 * We want to avoid the new next_tick being less than CR16.
@@ -131,18 +128,19 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
131 next_tick += cpt; 128 next_tick += cpt;
132 129
133 /* Program the IT when to deliver the next interrupt. */ 130 /* Program the IT when to deliver the next interrupt. */
134 /* Only bottom 32-bits of next_tick are written to cr16. */ 131 /* Only bottom 32-bits of next_tick are written to cr16. */
135 mtctl(next_tick, 16); 132 mtctl(next_tick, 16);
136 133
137 134
138 /* Done mucking with unreliable delivery of interrupts. 135 /* Done mucking with unreliable delivery of interrupts.
139 * Go do system house keeping. 136 * Go do system house keeping.
140 */ 137 */
141#ifdef CONFIG_SMP 138
142 smp_do_timer(regs); 139 if (!--cpuinfo->prof_counter) {
143#else 140 cpuinfo->prof_counter = cpuinfo->prof_multiplier;
144 update_process_times(user_mode(regs)); 141 update_process_times(user_mode(get_irq_regs()));
145#endif 142 }
143
146 if (cpu == 0) { 144 if (cpu == 0) {
147 write_seqlock(&xtime_lock); 145 write_seqlock(&xtime_lock);
148 do_timer(ticks_elapsed); 146 do_timer(ticks_elapsed);