diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-12-09 07:29:38 -0500 |
---|---|---|
committer | <ralf@denk.linux-mips.net> | 2006-01-10 08:39:07 -0500 |
commit | ba339c03e2e8ede8ccd37ed6c4e564e3b1545495 (patch) | |
tree | 1a7bbfd15a9c46d5300d2d5a1890d748b81dbce2 /arch/mips/mips-boards/generic/time.c | |
parent | 0401572a9b9b2f368176b6e53f53004fd048a566 (diff) |
MIPS: Oprofile: Fixup the loose ends in the plumbing.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards/generic/time.c')
-rw-r--r-- | arch/mips/mips-boards/generic/time.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index 2830f656fe2f..93f3bf2c2b22 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c | |||
@@ -75,16 +75,29 @@ static void mips_timer_dispatch (struct pt_regs *regs) | |||
75 | do_IRQ (mips_cpu_timer_irq, regs); | 75 | do_IRQ (mips_cpu_timer_irq, regs); |
76 | } | 76 | } |
77 | 77 | ||
78 | extern int null_perf_irq(struct pt_regs *regs); | ||
79 | |||
80 | extern int (*perf_irq)(struct pt_regs *regs); | ||
81 | |||
78 | irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 82 | irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
79 | { | 83 | { |
84 | int r2 = cpu_has_mips_r2; | ||
80 | int cpu = smp_processor_id(); | 85 | int cpu = smp_processor_id(); |
81 | 86 | ||
82 | if (cpu == 0) { | 87 | if (cpu == 0) { |
83 | /* | 88 | /* |
84 | * CPU 0 handles the global timer interrupt job and process accounting | 89 | * CPU 0 handles the global timer interrupt job and process |
85 | * resets count/compare registers to trigger next timer int. | 90 | * accounting resets count/compare registers to trigger next |
91 | * timer int. | ||
86 | */ | 92 | */ |
87 | timer_interrupt(irq, dev_id, regs); | 93 | if (!r2 || (read_c0_cause() & (1 << 26))) |
94 | if (perf_irq(regs)) | ||
95 | goto out; | ||
96 | |||
97 | /* we keep interrupt disabled all the time */ | ||
98 | if (!r2 || (read_c0_cause() & (1 << 30))) | ||
99 | timer_interrupt(irq, NULL, regs); | ||
100 | |||
88 | scroll_display_message(); | 101 | scroll_display_message(); |
89 | } else { | 102 | } else { |
90 | /* Everyone else needs to reset the timer int here as | 103 | /* Everyone else needs to reset the timer int here as |
@@ -101,6 +114,7 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
101 | local_timer_interrupt (irq, dev_id, regs); | 114 | local_timer_interrupt (irq, dev_id, regs); |
102 | } | 115 | } |
103 | 116 | ||
117 | out: | ||
104 | return IRQ_HANDLED; | 118 | return IRQ_HANDLED; |
105 | } | 119 | } |
106 | 120 | ||