irq.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
  7. * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
  8. */
  9. #ifndef _ASM_IRQ_H
  10. #define _ASM_IRQ_H
  11. #include <linux/linkage.h>
  12. #include <linux/smp.h>
  13. #include <linux/irqdomain.h>
  14. #include <asm/mipsmtregs.h>
  15. #include <irq.h>
  16. #define IRQ_STACK_SIZE THREAD_SIZE
  17. extern void *irq_stack[NR_CPUS];
  18. static inline bool on_irq_stack(int cpu, unsigned long sp)
  19. {
  20. unsigned long low = (unsigned long)irq_stack[cpu];
  21. unsigned long high = low + IRQ_STACK_SIZE;
  22. return (low <= sp && sp <= high);
  23. }
  24. #ifdef CONFIG_I8259
  25. static inline int irq_canonicalize(int irq)
  26. {
  27. return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
  28. }
  29. #else
  30. #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
  31. #endif
  32. asmlinkage void plat_irq_dispatch(void);
  33. extern void do_IRQ(unsigned int irq);
  34. extern void arch_init_irq(void);
  35. extern void spurious_interrupt(void);
  36. extern int allocate_irqno(void);
  37. extern void alloc_legacy_irqno(void);
  38. extern void free_irqno(unsigned int irq);
  39. /*
  40. * Before R2 the timer and performance counter interrupts were both fixed to
  41. * IE7. Since R2 their number has to be read from the c0_intctl register.
  42. */
  43. #define CP0_LEGACY_COMPARE_IRQ 7
  44. #define CP0_LEGACY_PERFCNT_IRQ 7
  45. extern int cp0_compare_irq;
  46. extern int cp0_compare_irq_shift;
  47. extern int cp0_perfcount_irq;
  48. extern int cp0_fdc_irq;
  49. extern int get_c0_fdc_int(void);
  50. void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
  51. bool exclude_self);
  52. #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
  53. #endif /* _ASM_IRQ_H */