]> Pileus Git - ~andy/linux/blobdiff - kernel/irq/handle.c
[PATCH] genirq: doc: handle_IRQ_event() and __do_IRQ() comments
[~andy/linux] / kernel / irq / handle.c
index c29f83c16497cff719b118bf1a8fabfb78076cd2..7fc7bc33d497334205f014b7d8b8abb179c3256e 100644 (file)
@@ -18,7 +18,7 @@
  * Linux has a controller-independent interrupt architecture.
  * Every controller has a 'controller-template', that is used
  * by the main code to do the right thing. Each driver-visible
- * interrupt source is transparently wired to the apropriate
+ * interrupt source is transparently wired to the appropriate
  * controller. Thus drivers need not be aware of the
  * interrupt-controller.
  *
  *
  * Controller mappings for all interrupt sources:
  */
-irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
+struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned = {
        [0 ... NR_IRQS-1] = {
                .status = IRQ_DISABLED,
-               .handler = &no_irq_type,
-               .lock = SPIN_LOCK_UNLOCKED
+               .chip = &no_irq_type,
+               .lock = SPIN_LOCK_UNLOCKED,
+#ifdef CONFIG_SMP
+               .affinity = CPU_MASK_ALL
+#endif
        }
 };
 
@@ -73,13 +76,19 @@ irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs)
        return IRQ_NONE;
 }
 
-/*
- * Have got an event to handle:
+/**
+ * handle_IRQ_event - irq action chain handler
+ * @irq:       the interrupt number
+ * @regs:      pointer to a register structure
+ * @action:    the interrupt action chain for this irq
+ *
+ * Handles the action chain of an irq event
  */
-fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
-                               struct irqaction *action)
+irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
+                            struct irqaction *action)
 {
-       int ret, retval = 0, status = 0;
+       irqreturn_t ret, retval = IRQ_NONE;
+       unsigned int status = 0;
 
        if (!(action->flags & SA_INTERRUPT))
                local_irq_enable();
@@ -99,32 +108,41 @@ fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
        return retval;
 }
 
-/*
- * do_IRQ handles all normal device IRQ's (the special
+/**
+ * __do_IRQ - original all in one highlevel IRQ handler
+ * @irq:       the interrupt number
+ * @regs:      pointer to a register structure
+ *
+ * __do_IRQ handles all normal device IRQ's (the special
  * SMP cross-CPU interrupts have their own specific
  * handlers).
+ *
+ * This is the original x86 implementation which is used for every
+ * interrupt type.
  */
 fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
-       irq_desc_t *desc = irq_desc + irq;
-       struct irqaction * action;
+       struct irq_desc *desc = irq_desc + irq;
+       struct irqaction *action;
        unsigned int status;
 
        kstat_this_cpu.irqs[irq]++;
-       if (desc->status & IRQ_PER_CPU) {
+       if (CHECK_IRQ_PER_CPU(desc->status)) {
                irqreturn_t action_ret;
 
                /*
                 * No locking required for CPU-local interrupts:
                 */
-               desc->handler->ack(irq);
+               if (desc->chip->ack)
+                       desc->chip->ack(irq);
                action_ret = handle_IRQ_event(irq, regs, desc->action);
-               desc->handler->end(irq);
+               desc->chip->end(irq);
                return 1;
        }
 
        spin_lock(&desc->lock);
-       desc->handler->ack(irq);
+       if (desc->chip->ack)
+               desc->chip->ack(irq);
        /*
         * REPLAY is when Linux resends an IRQ that was dropped earlier
         * WAITING is used by probe to mark irqs that are being tested
@@ -184,7 +202,7 @@ out:
         * The ->end() handler has to deal with interrupts which got
         * disabled while the handler was running.
         */
-       desc->handler->end(irq);
+       desc->chip->end(irq);
        spin_unlock(&desc->lock);
 
        return 1;