diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-06-20 17:27:10 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-06-20 17:27:10 -0400 |
commit | 3b1d4ed5353af04d6aa20be2701727b9cdb2ac61 (patch) | |
tree | e4a3335c925abd933f1650e1ee4786e6bfad8f35 /arch/mips/kernel | |
parent | 7c8545e98468c53809fc06788a3b9a34dff05240 (diff) |
[MIPS] Don't drag a platform specific header into generic arch code.
For some platforms it's definitions may conflict. So that's the one-liner.
The rest is 10 square kilometers of collateral damage fixup this include
used to paper over.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/smtc.c | 6 | ||||
-rw-r--r-- | arch/mips/kernel/time.c | 13 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 20 |
3 files changed, 29 insertions, 10 deletions
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 21eb5993a19f..2e011470c347 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -13,9 +13,9 @@ | |||
13 | #include <asm/system.h> | 13 | #include <asm/system.h> |
14 | #include <asm/hardirq.h> | 14 | #include <asm/hardirq.h> |
15 | #include <asm/hazards.h> | 15 | #include <asm/hazards.h> |
16 | #include <asm/irq.h> | ||
16 | #include <asm/mmu_context.h> | 17 | #include <asm/mmu_context.h> |
17 | #include <asm/smp.h> | 18 | #include <asm/smp.h> |
18 | #include <asm/mips-boards/maltaint.h> | ||
19 | #include <asm/mipsregs.h> | 19 | #include <asm/mipsregs.h> |
20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
21 | #include <asm/time.h> | 21 | #include <asm/time.h> |
@@ -614,7 +614,7 @@ int setup_irq_smtc(unsigned int irq, struct irqaction * new, | |||
614 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG | 614 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG |
615 | unsigned int vpe = current_cpu_data.vpe_id; | 615 | unsigned int vpe = current_cpu_data.vpe_id; |
616 | 616 | ||
617 | vpemask[vpe][irq - MIPSCPU_INT_BASE] = 1; | 617 | vpemask[vpe][irq - MIPS_CPU_IRQ_BASE] = 1; |
618 | #endif | 618 | #endif |
619 | irq_hwmask[irq] = hwmask; | 619 | irq_hwmask[irq] = hwmask; |
620 | 620 | ||
@@ -822,7 +822,7 @@ void ipi_decode(struct smtc_ipi *pipi) | |||
822 | switch (type_copy) { | 822 | switch (type_copy) { |
823 | case SMTC_CLOCK_TICK: | 823 | case SMTC_CLOCK_TICK: |
824 | irq_enter(); | 824 | irq_enter(); |
825 | kstat_this_cpu.irqs[MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR]++; | 825 | kstat_this_cpu.irqs[MIPS_CPU_IRQ_BASE + cp0_perfcount_irq]++; |
826 | /* Invoke Clock "Interrupt" */ | 826 | /* Invoke Clock "Interrupt" */ |
827 | ipi_timer_latch[dest_copy] = 0; | 827 | ipi_timer_latch[dest_copy] = 0; |
828 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG | 828 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG |
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 7def1ff3da94..d48d1d5bea0a 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
@@ -200,10 +200,15 @@ EXPORT_SYMBOL(null_perf_irq); | |||
200 | EXPORT_SYMBOL(perf_irq); | 200 | EXPORT_SYMBOL(perf_irq); |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * Timer interrupt | ||
204 | */ | ||
205 | int cp0_compare_irq; | ||
206 | |||
207 | /* | ||
203 | * Performance counter IRQ or -1 if shared with timer | 208 | * Performance counter IRQ or -1 if shared with timer |
204 | */ | 209 | */ |
205 | int mipsxx_perfcount_irq; | 210 | int cp0_perfcount_irq; |
206 | EXPORT_SYMBOL(mipsxx_perfcount_irq); | 211 | EXPORT_SYMBOL_GPL(cp0_perfcount_irq); |
207 | 212 | ||
208 | /* | 213 | /* |
209 | * Possibly handle a performance counter interrupt. | 214 | * Possibly handle a performance counter interrupt. |
@@ -213,12 +218,12 @@ static inline int handle_perf_irq (int r2) | |||
213 | { | 218 | { |
214 | /* | 219 | /* |
215 | * The performance counter overflow interrupt may be shared with the | 220 | * The performance counter overflow interrupt may be shared with the |
216 | * timer interrupt (mipsxx_perfcount_irq < 0). If it is and a | 221 | * timer interrupt (cp0_perfcount_irq < 0). If it is and a |
217 | * performance counter has overflowed (perf_irq() == IRQ_HANDLED) | 222 | * performance counter has overflowed (perf_irq() == IRQ_HANDLED) |
218 | * and we can't reliably determine if a counter interrupt has also | 223 | * and we can't reliably determine if a counter interrupt has also |
219 | * happened (!r2) then don't check for a timer interrupt. | 224 | * happened (!r2) then don't check for a timer interrupt. |
220 | */ | 225 | */ |
221 | return (mipsxx_perfcount_irq < 0) && | 226 | return (cp0_perfcount_irq < 0) && |
222 | perf_irq() == IRQ_HANDLED && | 227 | perf_irq() == IRQ_HANDLED && |
223 | !r2; | 228 | !r2; |
224 | } | 229 | } |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index a7a17eb9bfcd..b1233644fcca 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1350,9 +1350,6 @@ void __init per_cpu_trap_init(void) | |||
1350 | if (!secondaryTC) { | 1350 | if (!secondaryTC) { |
1351 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1351 | #endif /* CONFIG_MIPS_MT_SMTC */ |
1352 | 1352 | ||
1353 | /* | ||
1354 | * Interrupt handling. | ||
1355 | */ | ||
1356 | if (cpu_has_veic || cpu_has_vint) { | 1353 | if (cpu_has_veic || cpu_has_vint) { |
1357 | write_c0_ebase (ebase); | 1354 | write_c0_ebase (ebase); |
1358 | /* Setting vector spacing enables EI/VI mode */ | 1355 | /* Setting vector spacing enables EI/VI mode */ |
@@ -1366,6 +1363,23 @@ void __init per_cpu_trap_init(void) | |||
1366 | } else | 1363 | } else |
1367 | set_c0_cause(CAUSEF_IV); | 1364 | set_c0_cause(CAUSEF_IV); |
1368 | } | 1365 | } |
1366 | |||
1367 | /* | ||
1368 | * Before R2 both interrupt numbers were fixed to 7, so on R2 only: | ||
1369 | * | ||
1370 | * o read IntCtl.IPTI to determine the timer interrupt | ||
1371 | * o read IntCtl.IPPCI to determine the performance counter interrupt | ||
1372 | */ | ||
1373 | if (cpu_has_mips_r2) { | ||
1374 | cp0_compare_irq = (read_c0_intctl () >> 29) & 7; | ||
1375 | cp0_perfcount_irq = -1; | ||
1376 | } else { | ||
1377 | cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; | ||
1378 | cp0_perfcount_irq = (read_c0_intctl () >> 26) & 7; | ||
1379 | if (cp0_perfcount_irq != cp0_compare_irq) | ||
1380 | cp0_perfcount_irq = -1; | ||
1381 | } | ||
1382 | |||
1369 | #ifdef CONFIG_MIPS_MT_SMTC | 1383 | #ifdef CONFIG_MIPS_MT_SMTC |
1370 | } | 1384 | } |
1371 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1385 | #endif /* CONFIG_MIPS_MT_SMTC */ |