irq.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. /* The following definitions describe the individual platform features: */
  35. #define FEAT_L10_CLOCKSOURCE (1 << 0) /* L10 timer is used as a clocksource */
  36. #define FEAT_L10_CLOCKEVENT (1 << 1) /* L10 timer is used as a clockevent */
  37. #define FEAT_L14_ONESHOT (1 << 2) /* L14 timer clockevent can oneshot */
  38. /*
  39. * Platform specific configuration
  40. * The individual platforms assign their platform
  41. * specifics in their init functions.
  42. */
  43. struct sparc_config {
  44. void (*init_timers)(void);
  45. unsigned int (*build_device_irq)(struct platform_device *op,
  46. unsigned int real_irq);
  47. /* generic clockevent features - see FEAT_* above */
  48. int features;
  49. /* clock rate used for clock event timer */
  50. int clock_rate;
  51. /* one period for clock source timer */
  52. unsigned int cs_period;
  53. /* function to obtain offsett for cs period */
  54. unsigned int (*get_cycles_offset)(void);
  55. };
  56. extern struct sparc_config sparc_config;
  57. unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
  58. void irq_link(unsigned int irq);
  59. void irq_unlink(unsigned int irq);
  60. void handler_irq(unsigned int pil, struct pt_regs *regs);
  61. /* Dave Redman (djhr@tadpole.co.uk)
  62. * changed these to function pointers.. it saves cycles and will allow
  63. * the irq dependencies to be split into different files at a later date
  64. * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size.
  65. * Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  66. * Changed these to btfixup entities... It saves cycles :)
  67. */
  68. BTFIXUPDEF_CALL(void, clear_clock_irq, void)
  69. BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
  70. static inline void clear_clock_irq(void)
  71. {
  72. BTFIXUP_CALL(clear_clock_irq)();
  73. }
  74. static inline void load_profile_irq(int cpu, int limit)
  75. {
  76. BTFIXUP_CALL(load_profile_irq)(cpu, limit);
  77. }
  78. #ifdef CONFIG_SMP
  79. BTFIXUPDEF_CALL(void, set_cpu_int, int, int)
  80. BTFIXUPDEF_CALL(void, clear_cpu_int, int, int)
  81. BTFIXUPDEF_CALL(void, set_irq_udt, int)
  82. #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level)
  83. #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level)
  84. #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu)
  85. /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
  86. #define SUN4D_IPI_IRQ 13
  87. extern void sun4d_ipi_interrupt(void);
  88. #endif