irq.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __ASM_SH_IRQ_H
  2. #define __ASM_SH_IRQ_H
  3. #include <asm/machvec.h>
  4. /*
  5. * A sane default based on a reasonable vector table size, platforms are
  6. * advised to cap this at the hard limit that they're interested in
  7. * through the machvec.
  8. */
  9. #define NR_IRQS 256
  10. #define NR_IRQS_LEGACY 8 /* Legacy external IRQ0-7 */
  11. /*
  12. * This is a special IRQ number for indicating that no IRQ has been
  13. * triggered and to simply ignore the IRQ dispatch. This is a special
  14. * case that can happen with IRQ auto-distribution when multiple CPUs
  15. * are woken up and signalled in parallel.
  16. */
  17. #define NO_IRQ_IGNORE ((unsigned int)-1)
  18. /*
  19. * Convert back and forth between INTEVT and IRQ values.
  20. */
  21. #ifdef CONFIG_CPU_HAS_INTEVT
  22. #define evt2irq(evt) (((evt) >> 5) - 16)
  23. #define irq2evt(irq) (((irq) + 16) << 5)
  24. #else
  25. #define evt2irq(evt) (evt)
  26. #define irq2evt(irq) (irq)
  27. #endif
  28. /*
  29. * Simple Mask Register Support
  30. */
  31. extern void make_maskreg_irq(unsigned int irq);
  32. extern unsigned short *irq_mask_register;
  33. /*
  34. * PINT IRQs
  35. */
  36. void init_IRQ_pint(void);
  37. void make_imask_irq(unsigned int irq);
  38. static inline int generic_irq_demux(int irq)
  39. {
  40. return irq;
  41. }
  42. #define irq_demux(irq) sh_mv.mv_irq_demux(irq)
  43. void init_IRQ(void);
  44. asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
  45. #ifdef CONFIG_IRQSTACKS
  46. extern void irq_ctx_init(int cpu);
  47. extern void irq_ctx_exit(int cpu);
  48. # define __ARCH_HAS_DO_SOFTIRQ
  49. #else
  50. # define irq_ctx_init(cpu) do { } while (0)
  51. # define irq_ctx_exit(cpu) do { } while (0)
  52. #endif
  53. #ifdef CONFIG_INTC_BALANCING
  54. extern unsigned int irq_lookup(unsigned int irq);
  55. extern void irq_finish(unsigned int irq);
  56. #else
  57. #define irq_lookup(irq) (irq)
  58. #define irq_finish(irq) do { } while (0)
  59. #endif
  60. #include <asm-generic/irq.h>
  61. #ifdef CONFIG_CPU_SH5
  62. #include <cpu/irq.h>
  63. #endif
  64. #endif /* __ASM_SH_IRQ_H */