irq.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SH_IRQ_H
  3. #define __ASM_SH_IRQ_H
  4. #include <linux/cpumask.h>
  5. #include <asm/machvec.h>
  6. /*
  7. * Only legacy non-sparseirq platforms have to set a reasonably sane
  8. * value here. sparseirq platforms allocate their irq_descs on the fly,
  9. * so will expand automatically based on the number of registered IRQs.
  10. */
  11. #ifdef CONFIG_SPARSE_IRQ
  12. # define NR_IRQS 8
  13. #else
  14. # define NR_IRQS 512
  15. #endif
  16. /*
  17. * This is a special IRQ number for indicating that no IRQ has been
  18. * triggered and to simply ignore the IRQ dispatch. This is a special
  19. * case that can happen with IRQ auto-distribution when multiple CPUs
  20. * are woken up and signalled in parallel.
  21. */
  22. #define NO_IRQ_IGNORE ((unsigned int)-1)
  23. /*
  24. * Simple Mask Register Support
  25. */
  26. extern void make_maskreg_irq(unsigned int irq);
  27. extern unsigned short *irq_mask_register;
  28. /*
  29. * PINT IRQs
  30. */
  31. void init_IRQ_pint(void);
  32. void make_imask_irq(unsigned int irq);
  33. static inline int generic_irq_demux(int irq)
  34. {
  35. return irq;
  36. }
  37. #define irq_demux(irq) sh_mv.mv_irq_demux(irq)
  38. void init_IRQ(void);
  39. void migrate_irqs(void);
  40. asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
  41. #ifdef CONFIG_IRQSTACKS
  42. extern void irq_ctx_init(int cpu);
  43. extern void irq_ctx_exit(int cpu);
  44. # define __ARCH_HAS_DO_SOFTIRQ
  45. #else
  46. # define irq_ctx_init(cpu) do { } while (0)
  47. # define irq_ctx_exit(cpu) do { } while (0)
  48. #endif
  49. #ifdef CONFIG_INTC_BALANCING
  50. extern unsigned int irq_lookup(unsigned int irq);
  51. extern void irq_finish(unsigned int irq);
  52. #else
  53. #define irq_lookup(irq) (irq)
  54. #define irq_finish(irq) do { } while (0)
  55. #endif
  56. #include <asm-generic/irq.h>
  57. #ifdef CONFIG_CPU_SH5
  58. #include <cpu/irq.h>
  59. #endif
  60. #endif /* __ASM_SH_IRQ_H */