irq.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. };
  44. typedef struct hw_interrupt_type hw_irq_controller;
  45. /*
  46. * This is the "IRQ descriptor", which contains various information
  47. * about the irq, including what kind of hardware handling it has,
  48. * whether it is disabled etc etc.
  49. *
  50. * Pad this out to 32 bytes for cache and indexing reasons.
  51. */
  52. typedef struct irq_desc {
  53. hw_irq_controller *handler;
  54. void *handler_data;
  55. struct irqaction *action; /* IRQ action list */
  56. unsigned int status; /* IRQ status */
  57. unsigned int depth; /* nested irq disables */
  58. unsigned int irq_count; /* For detecting broken interrupts */
  59. unsigned int irqs_unhandled;
  60. spinlock_t lock;
  61. } ____cacheline_aligned irq_desc_t;
  62. extern irq_desc_t irq_desc [NR_IRQS];
  63. #include <asm/hw_irq.h> /* the arch dependent stuff */
  64. extern int setup_irq(unsigned int irq, struct irqaction * new);
  65. #ifdef CONFIG_GENERIC_HARDIRQS
  66. extern cpumask_t irq_affinity[NR_IRQS];
  67. extern int no_irq_affinity;
  68. extern int noirqdebug_setup(char *str);
  69. extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
  70. struct irqaction *action);
  71. extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
  72. extern void note_interrupt(unsigned int irq, irq_desc_t *desc, int action_ret);
  73. extern void report_bad_irq(unsigned int irq, irq_desc_t *desc, int action_ret);
  74. extern int can_request_irq(unsigned int irq, unsigned long irqflags);
  75. extern void init_irq_proc(void);
  76. #endif
  77. extern hw_irq_controller no_irq_type; /* needed in every arch ? */
  78. #endif
  79. #endif /* __irq_h */