irq.h 2.6 KB

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