[PATCH] genirq: irq: add a dynamic irq creation API
[deliverable/linux.git] / include / linux / irq.h
index b48eae32dc61c05eb5afd83c1c6c23ab4d10b85f..82dbb0e8f40b6b14921308fb832f6b30faf17e8a 100644 (file)
@@ -47,8 +47,8 @@
 #define IRQ_WAITING            0x00200000      /* IRQ not yet seen - for autodetection */
 #define IRQ_LEVEL              0x00400000      /* IRQ level triggered */
 #define IRQ_MASKED             0x00800000      /* IRQ masked - shouldn't be seen again */
+#define IRQ_PER_CPU            0x01000000      /* IRQ is per CPU */
 #ifdef CONFIG_IRQ_PER_CPU
-# define IRQ_PER_CPU           0x01000000      /* IRQ is per CPU */
 # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
 #else
 # define CHECK_IRQ_PER_CPU(var) 0
@@ -58,6 +58,8 @@
 #define IRQ_NOREQUEST          0x04000000      /* IRQ cannot be requested */
 #define IRQ_NOAUTOEN           0x08000000      /* IRQ will not be enabled on request irq */
 #define IRQ_DELAYED_DISABLE    0x10000000      /* IRQ disable (masking) happens delayed. */
+#define IRQ_WAKEUP             0x20000000      /* IRQ triggers system wakeup */
+#define IRQ_MOVE_PENDING       0x40000000      /* need to re-target IRQ destination */
 
 struct proc_dir_entry;
 
@@ -124,13 +126,13 @@ struct irq_chip {
  * @action:            the irq action chain
  * @status:            status information
  * @depth:             disable-depth, for nested irq_disable() calls
+ * @wake_depth:                enable depth, for multiple set_irq_wake() callers
  * @irq_count:         stats field to detect stalled irqs
  * @irqs_unhandled:    stats field for spurious unhandled interrupts
  * @lock:              locking for SMP
  * @affinity:          IRQ affinity on SMP
  * @cpu:               cpu index useful for balancing
  * @pending_mask:      pending rebalanced interrupts
- * @move_irq:          need to re-target IRQ destination
  * @dir:               /proc/irq/ procfs entry
  * @affinity_entry:    /proc/irq/smp_affinity procfs entry on SMP
  *
@@ -147,6 +149,7 @@ struct irq_desc {
        unsigned int            status;         /* IRQ status */
 
        unsigned int            depth;          /* nested irq disables */
+       unsigned int            wake_depth;     /* nested wake enables */
        unsigned int            irq_count;      /* For detecting broken IRQs */
        unsigned int            irqs_unhandled;
        spinlock_t              lock;
@@ -156,7 +159,6 @@ struct irq_desc {
 #endif
 #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
        cpumask_t               pending_mask;
-       unsigned int            move_irq;       /* need to re-target IRQ dest */
 #endif
 #ifdef CONFIG_PROC_FS
        struct proc_dir_entry *dir;
@@ -203,6 +205,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask)
 
 void set_pending_irq(unsigned int irq, cpumask_t mask);
 void move_native_irq(int irq);
+void move_masked_irq(int irq);
 
 #ifdef CONFIG_PCI_MSI
 /*
@@ -244,6 +247,10 @@ static inline void move_native_irq(int irq)
 {
 }
 
+static inline void move_masked_irq(int irq)
+{
+}
+
 static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
 {
 }
@@ -259,6 +266,7 @@ static inline void set_irq_info(int irq, cpumask_t mask)
 
 #define move_irq(x)
 #define move_native_irq(x)
+#define move_masked_irq(x)
 
 #endif /* CONFIG_SMP */
 
@@ -317,7 +325,9 @@ handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
  * Monolithic do_IRQ implementation.
  * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
  */
+#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
 extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
+#endif
 
 /*
  * Architectures call this to let the generic IRQ layer
@@ -329,10 +339,14 @@ static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
 {
        struct irq_desc *desc = irq_desc + irq;
 
+#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
+       desc->handle_irq(irq, desc, regs);
+#else
        if (likely(desc->handle_irq))
                desc->handle_irq(irq, desc, regs);
        else
                __do_IRQ(irq, regs);
+#endif
 }
 
 /* Handling of unhandled and spurious interrupts: */
@@ -390,8 +404,15 @@ set_irq_chained_handler(unsigned int irq,
        __set_irq_handler(irq, handle, 1);
 }
 
-/* Set/get chip/data for an IRQ: */
+/* Handle dynamic irq creation and destruction */
+extern int create_irq(void);
+extern void destroy_irq(unsigned int irq);
 
+/* Dynamic irq helper functions */
+extern void dynamic_irq_init(unsigned int irq);
+extern void dynamic_irq_cleanup(unsigned int irq);
+
+/* Set/get chip/data for an IRQ: */
 extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
 extern int set_irq_data(unsigned int irq, void *data);
 extern int set_irq_chip_data(unsigned int irq, void *data);
This page took 0.026479 seconds and 5 git commands to generate.