irq.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #include <linux/platform_device.h>
  2. #include <asm/btfixup.h>
  3. struct irq_bucket {
  4. struct irq_bucket *next;
  5. unsigned int real_irq;
  6. unsigned int irq;
  7. unsigned int pil;
  8. };
  9. #define SUN4D_MAX_BOARD 10
  10. #define SUN4D_MAX_IRQ ((SUN4D_MAX_BOARD + 2) << 5)
  11. /* Map between the irq identifier used in hw to the
  12. * irq_bucket. The map is sufficient large to hold
  13. * the sun4d hw identifiers.
  14. */
  15. extern struct irq_bucket *irq_map[SUN4D_MAX_IRQ];
  16. /* sun4m specific type definitions */
  17. /* This maps direct to CPU specific interrupt registers */
  18. struct sun4m_irq_percpu {
  19. u32 pending;
  20. u32 clear;
  21. u32 set;
  22. };
  23. /* This maps direct to global interrupt registers */
  24. struct sun4m_irq_global {
  25. u32 pending;
  26. u32 mask;
  27. u32 mask_clear;
  28. u32 mask_set;
  29. u32 interrupt_target;
  30. };
  31. extern struct sun4m_irq_percpu __iomem *sun4m_irq_percpu[SUN4M_NCPUS];
  32. extern struct sun4m_irq_global __iomem *sun4m_irq_global;
  33. /*
  34. * Platform specific irq configuration
  35. * The individual platforms assign their platform
  36. * specifics in their init functions.
  37. */
  38. struct sparc_irq_config {
  39. void (*init_timers)(irq_handler_t);
  40. unsigned int (*build_device_irq)(struct platform_device *op,
  41. unsigned int real_irq);
  42. };
  43. extern struct sparc_irq_config sparc_irq_config;
  44. unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
  45. void irq_link(unsigned int irq);
  46. void irq_unlink(unsigned int irq);
  47. void handler_irq(unsigned int pil, struct pt_regs *regs);
  48. /* Dave Redman (djhr@tadpole.co.uk)
  49. * changed these to function pointers.. it saves cycles and will allow
  50. * the irq dependencies to be split into different files at a later date
  51. * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size.
  52. * Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  53. * Changed these to btfixup entities... It saves cycles :)
  54. */
  55. BTFIXUPDEF_CALL(void, clear_clock_irq, void)
  56. BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
  57. static inline void clear_clock_irq(void)
  58. {
  59. BTFIXUP_CALL(clear_clock_irq)();
  60. }
  61. static inline void load_profile_irq(int cpu, int limit)
  62. {
  63. BTFIXUP_CALL(load_profile_irq)(cpu, limit);
  64. }
  65. #ifdef CONFIG_SMP
  66. BTFIXUPDEF_CALL(void, set_cpu_int, int, int)
  67. BTFIXUPDEF_CALL(void, clear_cpu_int, int, int)
  68. BTFIXUPDEF_CALL(void, set_irq_udt, int)
  69. #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level)
  70. #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level)
  71. #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu)
  72. /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
  73. #define SUN4D_IPI_IRQ 13
  74. extern void sun4d_ipi_interrupt(void);
  75. #endif