irq.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2006 Atmark Techno, Inc.
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. */
  8. #ifndef _ASM_MICROBLAZE_IRQ_H
  9. #define _ASM_MICROBLAZE_IRQ_H
  10. #define NR_IRQS 32
  11. #include <asm-generic/irq.h>
  12. #include <linux/interrupt.h>
  13. /* This type is the placeholder for a hardware interrupt number. It has to
  14. * be big enough to enclose whatever representation is used by a given
  15. * platform.
  16. */
  17. typedef unsigned long irq_hw_number_t;
  18. extern unsigned int nr_irq;
  19. #define NO_IRQ (-1)
  20. struct pt_regs;
  21. extern void do_IRQ(struct pt_regs *regs);
  22. /**
  23. * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
  24. * @device: Device node of the device whose interrupt is to be mapped
  25. * @index: Index of the interrupt to map
  26. *
  27. * This function is a wrapper that chains of_irq_map_one() and
  28. * irq_create_of_mapping() to make things easier to callers
  29. */
  30. struct device_node;
  31. extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index);
  32. /** FIXME - not implement
  33. * irq_dispose_mapping - Unmap an interrupt
  34. * @virq: linux virq number of the interrupt to unmap
  35. */
  36. static inline void irq_dispose_mapping(unsigned int virq)
  37. {
  38. return;
  39. }
  40. struct irq_host;
  41. /**
  42. * irq_create_mapping - Map a hardware interrupt into linux virq space
  43. * @host: host owning this hardware interrupt or NULL for default host
  44. * @hwirq: hardware irq number in that host space
  45. *
  46. * Only one mapping per hardware interrupt is permitted. Returns a linux
  47. * virq number.
  48. * If the sense/trigger is to be specified, set_irq_type() should be called
  49. * on the number returned from that call.
  50. */
  51. extern unsigned int irq_create_mapping(struct irq_host *host,
  52. irq_hw_number_t hwirq);
  53. /**
  54. * irq_create_of_mapping - Map a hardware interrupt into linux virq space
  55. * @controller: Device node of the interrupt controller
  56. * @inspec: Interrupt specifier from the device-tree
  57. * @intsize: Size of the interrupt specifier from the device-tree
  58. *
  59. * This function is identical to irq_create_mapping except that it takes
  60. * as input informations straight from the device-tree (typically the results
  61. * of the of_irq_map_*() functions.
  62. */
  63. extern unsigned int irq_create_of_mapping(struct device_node *controller,
  64. u32 *intspec, unsigned int intsize);
  65. #endif /* _ASM_MICROBLAZE_IRQ_H */