irq.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * include/asm-v850/irq.h -- Machine interrupt handling
  3. *
  4. * Copyright (C) 2001,02,04 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,04 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #ifndef __V850_IRQ_H__
  14. #define __V850_IRQ_H__
  15. #include <asm/machdep.h>
  16. /* Default NUM_MACH_IRQS. */
  17. #ifndef NUM_MACH_IRQS
  18. #define NUM_MACH_IRQS NUM_CPU_IRQS
  19. #endif
  20. /* NMIs have IRQ numbers from FIRST_NMI to FIRST_NMI+NUM_NMIS-1. */
  21. #define FIRST_NMI NUM_MACH_IRQS
  22. #define IRQ_NMI(n) (FIRST_NMI + (n))
  23. /* v850 processors have 3 non-maskable interrupts. */
  24. #define NUM_NMIS 3
  25. /* Includes both maskable and non-maskable irqs. */
  26. #define NR_IRQS (NUM_MACH_IRQS + NUM_NMIS)
  27. #ifndef __ASSEMBLY__
  28. struct pt_regs;
  29. struct hw_interrupt_type;
  30. struct irqaction;
  31. #define irq_canonicalize(irq) (irq)
  32. /* Initialize irq handling for IRQs.
  33. BASE_IRQ, BASE_IRQ+INTERVAL, ..., BASE_IRQ+NUM*INTERVAL
  34. to IRQ_TYPE. An IRQ_TYPE of 0 means to use a generic interrupt type. */
  35. extern void
  36. init_irq_handlers (int base_irq, int num, int interval,
  37. struct hw_interrupt_type *irq_type);
  38. typedef void (*irq_handler_t)(int irq, void *data, struct pt_regs *regs);
  39. /* Handle interrupt IRQ. REGS are the registers at the time of ther
  40. interrupt. */
  41. extern unsigned int handle_irq (int irq, struct pt_regs *regs);
  42. /* Enable interrupt handling on an irq. */
  43. extern void enable_irq(unsigned int irq);
  44. /* Disable an irq and wait for completion. */
  45. extern void disable_irq (unsigned int irq);
  46. /* Disable an irq without waiting. */
  47. extern void disable_irq_nosync (unsigned int irq);
  48. extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
  49. #endif /* !__ASSEMBLY__ */
  50. #endif /* __V850_IRQ_H__ */