irq.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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/linkage.h>
  12. #include <asm/mipsmtregs.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_MIPS_MT_SMTC
  25. /*
  26. * Clear interrupt mask handling "backstop" if irq_hwmask
  27. * entry so indicates. This implies that the ack() or end()
  28. * functions will take over re-enabling the low-level mask.
  29. * Otherwise it will be done on return from exception.
  30. */
  31. #define __DO_IRQ_SMTC_HOOK() \
  32. do { \
  33. if (irq_hwmask[irq] & 0x0000ff00) \
  34. write_c0_tccontext(read_c0_tccontext() & \
  35. ~(irq_hwmask[irq] & 0x0000ff00)); \
  36. } while (0)
  37. #else
  38. #define __DO_IRQ_SMTC_HOOK() do { } while (0)
  39. #endif
  40. #ifdef CONFIG_PREEMPT
  41. /*
  42. * do_IRQ handles all normal device IRQ's (the special
  43. * SMP cross-CPU interrupts have their own specific
  44. * handlers).
  45. *
  46. * Ideally there should be away to get this into kernel/irq/handle.c to
  47. * avoid the overhead of a call for just a tiny function ...
  48. */
  49. #define do_IRQ(irq, regs) \
  50. do { \
  51. irq_enter(); \
  52. __DO_IRQ_SMTC_HOOK(); \
  53. __do_IRQ((irq), (regs)); \
  54. irq_exit(); \
  55. } while (0)
  56. #endif
  57. extern void arch_init_irq(void);
  58. extern void spurious_interrupt(struct pt_regs *regs);
  59. #ifdef CONFIG_MIPS_MT_SMTC
  60. struct irqaction;
  61. extern unsigned long irq_hwmask[];
  62. extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
  63. unsigned long hwmask);
  64. #endif /* CONFIG_MIPS_MT_SMTC */
  65. #endif /* _ASM_IRQ_H */