irq.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef __irq_h
  2. #define __irq_h
  3. /*
  4. * Please do not include this file in generic code. There is currently
  5. * no requirement for any architecture to implement anything held
  6. * within this file.
  7. *
  8. * Thanks. --rmk
  9. */
  10. #include <linux/config.h>
  11. #if !defined(CONFIG_ARCH_S390)
  12. #include <linux/linkage.h>
  13. #include <linux/cache.h>
  14. #include <linux/spinlock.h>
  15. #include <linux/cpumask.h>
  16. #include <asm/irq.h>
  17. #include <asm/ptrace.h>
  18. /*
  19. * IRQ line status.
  20. */
  21. #define IRQ_INPROGRESS 1 /* IRQ handler active - do not enter! */
  22. #define IRQ_DISABLED 2 /* IRQ disabled - do not enter! */
  23. #define IRQ_PENDING 4 /* IRQ pending - replay on enable */
  24. #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */
  25. #define IRQ_AUTODETECT 16 /* IRQ is being autodetected */
  26. #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */
  27. #define IRQ_LEVEL 64 /* IRQ level triggered */
  28. #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */
  29. #define IRQ_PER_CPU 256 /* IRQ is per CPU */
  30. /*
  31. * Interrupt controller descriptor. This is all we need
  32. * to describe about the low-level hardware.
  33. */
  34. struct hw_interrupt_type {
  35. const char * typename;
  36. unsigned int (*startup)(unsigned int irq);
  37. void (*shutdown)(unsigned int irq);
  38. void (*enable)(unsigned int irq);
  39. void (*disable)(unsigned int irq);
  40. void (*ack)(unsigned int irq);
  41. void (*end)(unsigned int irq);
  42. void (*set_affinity)(unsigned int irq, cpumask_t dest);
  43. /* Currently used only by UML, might disappear one day.*/
  44. #ifdef CONFIG_IRQ_RELEASE_METHOD
  45. void (*release)(unsigned int irq, void *dev_id);
  46. #endif
  47. };
  48. typedef struct hw_interrupt_type hw_irq_controller;
  49. /*
  50. * This is the "IRQ descriptor", which contains various information
  51. * about the irq, including what kind of hardware handling it has,
  52. * whether it is disabled etc etc.
  53. *
  54. * Pad this out to 32 bytes for cache and indexing reasons.
  55. */
  56. typedef struct irq_desc {
  57. hw_irq_controller *handler;
  58. void *handler_data;
  59. struct irqaction *action; /* IRQ action list */
  60. unsigned int status; /* IRQ status */
  61. unsigned int depth; /* nested irq disables */
  62. unsigned int irq_count; /* For detecting broken interrupts */
  63. unsigned int irqs_unhandled;
  64. spinlock_t lock;
  65. } ____cacheline_aligned irq_desc_t;
  66. extern irq_desc_t irq_desc [NR_IRQS];
  67. #include <asm/hw_irq.h> /* the arch dependent stuff */
  68. extern int setup_irq(unsigned int irq, struct irqaction * new);
  69. #ifdef CONFIG_GENERIC_HARDIRQS
  70. extern cpumask_t irq_affinity[NR_IRQS];
  71. extern int no_irq_affinity;
  72. extern int noirqdebug_setup(char *str);
  73. extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
  74. struct irqaction *action);
  75. extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
  76. extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
  77. int action_ret, struct pt_regs *regs);
  78. extern int can_request_irq(unsigned int irq, unsigned long irqflags);
  79. extern void init_irq_proc(void);
  80. #endif
  81. extern hw_irq_controller no_irq_type; /* needed in every arch ? */
  82. #endif
  83. #endif /* __irq_h */