irqchip.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * linux/include/asm-arm/mach/irq.h
  3. *
  4. * Copyright (C) 1995-2000 Russell King.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARM_MACH_IRQ_H
  11. #define __ASM_ARM_MACH_IRQ_H
  12. struct irqdesc;
  13. struct pt_regs;
  14. struct seq_file;
  15. typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
  16. typedef void (*irq_control_t)(unsigned int);
  17. struct irqchip {
  18. /*
  19. * Acknowledge the IRQ.
  20. * If this is a level-based IRQ, then it is expected to mask the IRQ
  21. * as well.
  22. */
  23. void (*ack)(unsigned int);
  24. /*
  25. * Mask the IRQ in hardware.
  26. */
  27. void (*mask)(unsigned int);
  28. /*
  29. * Unmask the IRQ in hardware.
  30. */
  31. void (*unmask)(unsigned int);
  32. /*
  33. * Re-run the IRQ
  34. */
  35. void (*rerun)(unsigned int);
  36. /*
  37. * Set the type of the IRQ.
  38. */
  39. int (*type)(unsigned int, unsigned int);
  40. };
  41. struct irqdesc {
  42. irq_handler_t handle;
  43. struct irqchip *chip;
  44. struct irqaction *action;
  45. unsigned int enabled : 1; /* IRQ is currently enabled */
  46. unsigned int triggered: 1; /* IRQ has occurred */
  47. unsigned int running : 1; /* IRQ is running */
  48. unsigned int pending : 1; /* IRQ is pending */
  49. unsigned int probing : 1; /* IRQ in use for a probe */
  50. unsigned int probe_ok : 1; /* IRQ can be used for probe */
  51. unsigned int valid : 1; /* IRQ claimable */
  52. unsigned int noautoenable : 1; /* don't automatically enable IRQ */
  53. unsigned int unused :23;
  54. unsigned int depth; /* disable depth */
  55. /*
  56. * IRQ lock detection
  57. */
  58. unsigned int lck_cnt;
  59. unsigned int lck_pc;
  60. unsigned int lck_jif;
  61. };
  62. extern struct irqdesc irq_desc[];
  63. /*
  64. * This is internal. Do not use it.
  65. */
  66. extern void (*init_arch_irq)(void);
  67. extern void init_FIQ(void);
  68. extern int show_fiq_list(struct seq_file *, void *);
  69. void __set_irq_handler(unsigned int irq, irq_handler_t, int);
  70. /*
  71. * External stuff.
  72. */
  73. #define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0)
  74. #define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1)
  75. void set_irq_chip(unsigned int irq, struct irqchip *);
  76. void set_irq_flags(unsigned int irq, unsigned int flags);
  77. #define IRQF_VALID (1 << 0)
  78. #define IRQF_PROBE (1 << 1)
  79. #define IRQF_NOAUTOEN (1 << 2)
  80. /*
  81. * Built-in IRQ handlers.
  82. */
  83. void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
  84. void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
  85. void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
  86. void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
  87. void dummy_mask_unmask_irq(unsigned int irq);
  88. #endif