irq.h 2.0 KB

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