001-get_c0_compare_irq_function.patch 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. Allow boards to provide their own function for reading the timer IRQ number
  2. Signed-off-by: Gabor Juhos <[email protected]>
  3. --- a/arch/mips/kernel/traps.c
  4. +++ b/arch/mips/kernel/traps.c
  5. @@ -47,6 +47,7 @@
  6. #include <asm/mmu_context.h>
  7. #include <asm/types.h>
  8. #include <asm/stacktrace.h>
  9. +#include <asm/time.h>
  10. extern void check_wait(void);
  11. extern asmlinkage void r4k_wait(void);
  12. @@ -1514,6 +1515,8 @@ void __cpuinit per_cpu_trap_init(void)
  13. */
  14. if (cpu_has_mips_r2) {
  15. cp0_compare_irq = (read_c0_intctl() >> 29) & 7;
  16. + if (get_c0_compare_irq)
  17. + cp0_compare_irq = get_c0_compare_irq();
  18. cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7;
  19. if (cp0_perfcount_irq == cp0_compare_irq)
  20. cp0_perfcount_irq = -1;
  21. --- a/arch/mips/include/asm/time.h
  22. +++ b/arch/mips/include/asm/time.h
  23. @@ -53,6 +53,7 @@ extern int (*perf_irq)(void);
  24. #ifdef CONFIG_CEVT_R4K
  25. extern int mips_clockevent_init(void);
  26. extern unsigned int __weak get_c0_compare_int(void);
  27. +extern unsigned int __weak get_c0_compare_irq(void);
  28. #else
  29. static inline int mips_clockevent_init(void)
  30. {