irq.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
  24. #ifdef CONFIG_PREEMPT
  25. /*
  26. * do_IRQ handles all normal device IRQ's (the special
  27. * SMP cross-CPU interrupts have their own specific
  28. * handlers).
  29. *
  30. * Ideally there should be away to get this into kernel/irq/handle.c to
  31. * avoid the overhead of a call for just a tiny function ...
  32. */
  33. #define do_IRQ(irq, regs) \
  34. do { \
  35. irq_enter(); \
  36. __do_IRQ((irq), (regs)); \
  37. irq_exit(); \
  38. } while (0)
  39. #endif
  40. extern void arch_init_irq(void);
  41. #endif /* _ASM_IRQ_H */