]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/irq.h
libata: switch to using block layer tagging support
[linux-2.6-omap-h63xx.git] / include / linux / irq.h
index cbf471aee1cee8a69680f0ae1d449527749d4b3a..d058c57be02d3508e27382e63980bfb593658649 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/spinlock.h>
 #include <linux/cpumask.h>
 #include <linux/irqreturn.h>
+#include <linux/irqnr.h>
 #include <linux/errno.h>
 
 #include <asm/irq.h>
@@ -127,7 +128,6 @@ struct irq_chip {
        const char      *typename;
 };
 
-struct timer_rand_state;
 /**
  * struct irq_desc - interrupt descriptor
  *
@@ -154,15 +154,6 @@ struct timer_rand_state;
  */
 struct irq_desc {
        unsigned int            irq;
-#ifdef CONFIG_HAVE_SPARSE_IRQ
-       struct irq_desc         *next;
-       struct timer_rand_state *timer_rand_state;
-#endif
-#ifdef CONFIG_HAVE_DYN_ARRAY
-       unsigned int            *kstat_irqs;
-#else
-       unsigned int            kstat_irqs[NR_CPUS];
-#endif
        irq_flow_handler_t      handle_irq;
        struct irq_chip         *chip;
        struct msi_desc         *msi_desc;
@@ -181,7 +172,7 @@ struct irq_desc {
        cpumask_t               affinity;
        unsigned int            cpu;
 #endif
-#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
+#ifdef CONFIG_GENERIC_PENDING_IRQ
        cpumask_t               pending_mask;
 #endif
 #ifdef CONFIG_PROC_FS
@@ -190,13 +181,13 @@ struct irq_desc {
        const char              *name;
 } ____cacheline_internodealigned_in_smp;
 
-extern struct irq_desc *irq_to_desc(unsigned int irq);
-#ifndef CONFIG_HAVE_DYN_ARRAY
-/* could be removed if we get rid of all irq_desc reference */
+
 extern struct irq_desc irq_desc[NR_IRQS];
-#endif
-#define kstat_irqs_this_cpu(DESC) \
-       ((DESC)->kstat_irqs[smp_processor_id()])
+
+static inline struct irq_desc *irq_to_desc(unsigned int irq)
+{
+       return (irq < nr_irqs) ? irq_desc + irq : NULL;
+}
 
 /*
  * Migration helpers for obsolete names, they will go away:
@@ -217,13 +208,13 @@ extern int setup_irq(unsigned int irq, struct irqaction *new);
 
 #ifdef CONFIG_SMP
 
-#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
+#ifdef CONFIG_GENERIC_PENDING_IRQ
 
 void set_pending_irq(unsigned int irq, cpumask_t mask);
 void move_native_irq(int irq);
 void move_masked_irq(int irq);
 
-#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */
+#else /* CONFIG_GENERIC_PENDING_IRQ */
 
 static inline void move_irq(int irq)
 {
@@ -250,14 +241,6 @@ static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
 
 #endif /* CONFIG_SMP */
 
-#ifdef CONFIG_IRQBALANCE
-extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
-#else
-static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
-{
-}
-#endif
-
 extern int no_irq_affinity;
 
 static inline int irq_balancing_disabled(unsigned int irq)
@@ -295,10 +278,8 @@ extern unsigned int __do_IRQ(unsigned int irq);
  * irqchip-style controller then we call the ->handle_irq() handler,
  * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
  */
-static inline void generic_handle_irq(unsigned int irq)
+static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
-       struct irq_desc *desc = irq_to_desc(irq);
-
 #ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
        desc->handle_irq(irq, desc);
 #else
@@ -309,6 +290,11 @@ static inline void generic_handle_irq(unsigned int irq)
 #endif
 }
 
+static inline void generic_handle_irq(unsigned int irq)
+{
+       generic_handle_irq_desc(irq, irq_to_desc(irq));
+}
+
 /* Handling of unhandled and spurious interrupts: */
 extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
                           int action_ret);
@@ -372,6 +358,7 @@ extern void set_irq_noprobe(unsigned int irq);
 extern void set_irq_probe(unsigned int irq);
 
 /* Handle dynamic irq creation and destruction */
+extern unsigned int create_irq_nr(unsigned int irq_want);
 extern int create_irq(void);
 extern void destroy_irq(unsigned int irq);