irq.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
  7. * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
  8. */
  9. #ifndef _ASM_IRQ_H
  10. #define _ASM_IRQ_H
  11. #include <linux/config.h>
  12. #include <linux/linkage.h>
  13. #include <irq.h>
  14. #ifdef CONFIG_I8259
  15. static inline int irq_canonicalize(int irq)
  16. {
  17. return ((irq == 2) ? 9 : irq);
  18. }
  19. #else
  20. #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
  21. #endif
  22. struct pt_regs;
  23. #ifdef CONFIG_PREEMPT
  24. extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
  25. #else
  26. /*
  27. * do_IRQ handles all normal device IRQ's (the special
  28. * SMP cross-CPU interrupts have their own specific
  29. * handlers).
  30. *
  31. * Ideally there should be away to get this into kernel/irq/handle.c to
  32. * avoid the overhead of a call for just a tiny function ...
  33. */
  34. #define do_IRQ(irq, regs) \
  35. do { \
  36. irq_enter(); \
  37. __do_IRQ((irq), (regs)); \
  38. irq_exit(); \
  39. } while (0)
  40. #endif
  41. extern void arch_init_irq(void);
  42. struct irqaction;
  43. int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
  44. #endif /* _ASM_IRQ_H */