+typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
+typedef void (*irq_control_t)(unsigned int);
+
+struct irqchip {
+ /*
+ * Acknowledge the IRQ.
+ * If this is a level-based IRQ, then it is expected to mask the IRQ
+ * as well.
+ */
+ void (*ack)(unsigned int);
+ /*
+ * Mask the IRQ in hardware.
+ */
+ void (*mask)(unsigned int);
+ /*
+ * Unmask the IRQ in hardware.
+ */
+ void (*unmask)(unsigned int);
+ /*
+ * Ask the hardware to re-trigger the IRQ.
+ * Note: This method _must_ _not_ call the interrupt handler.
+ * If you are unable to retrigger the interrupt, do not
+ * provide a function, or if you do, return non-zero.
+ */
+ int (*retrigger)(unsigned int);
+ /*
+ * Set the type of the IRQ.
+ */
+ int (*set_type)(unsigned int, unsigned int);
+ /*
+ * Set wakeup-enable on the selected IRQ
+ */
+ int (*set_wake)(unsigned int, unsigned int);
+
+#ifdef CONFIG_SMP
+ /*
+ * Route an interrupt to a CPU
+ */
+ void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu);
+#endif
+};
+
+struct irqdesc {
+ irq_handler_t handle;
+ struct irqchip *chip;
+ struct irqaction *action;
+ struct list_head pend;
+ void *chipdata;
+ void *data;
+ unsigned int disable_depth;
+
+ unsigned int triggered: 1; /* IRQ has occurred */
+ unsigned int running : 1; /* IRQ is running */
+ unsigned int pending : 1; /* IRQ is pending */
+ unsigned int probing : 1; /* IRQ in use for a probe */
+ unsigned int probe_ok : 1; /* IRQ can be used for probe */
+ unsigned int valid : 1; /* IRQ claimable */
+ unsigned int noautoenable : 1; /* don't automatically enable IRQ */
+ unsigned int unused :25;
+
+ struct proc_dir_entry *procdir;
+
+#ifdef CONFIG_SMP
+ cpumask_t affinity;
+ unsigned int cpu;
+#endif
+
+ /*
+ * IRQ lock detection
+ */
+ unsigned int lck_cnt;
+ unsigned int lck_pc;
+ unsigned int lck_jif;
+};
+
+extern struct irqdesc irq_desc[];
+
+/*
+ * Helpful inline function for calling irq descriptor handlers.
+ */
+static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
+{
+ desc->handle(irq, desc, regs);
+}
+