WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3/5] setup_irq/request_irq/free_irq fixups

[Espen Skoglund]
> [Keir Fraser]
>> I suggest you do something like:
>>  * Rename the functions to {setup,request,free}_irq_vector().
>>  * Make {setup,request,free}_irq() be simple wrappers around the above.
>>  * Only use the new function names for the IOMMU callers for now.
>>  * Think about how to not break IA64.

>> And make a new patch, against c/s 19180 or later.

> Whoops.  Completely forgot about ia64 (my source grep command by
> default filters out non-x86 stuff).  Your suggestions make perfect
> sense.  Will post a new patch once c/s 19180 has been propagated to
> xen-unstable then.

Here's a patch which implements your suggestions.  I've renamed
free_irq() to release_irq() to avoid conflicts with the current
free_irq_vector() function.

I have not had a chance to actually test the ia64 related changes.
Hopefully someone else can do that.  The current ia64 code seems to be
a bit inconsistent with the whole irq and vector numbering scheme.
Sometimes an irq number is used in place of a vector number or vice
versa, and sometimes an irq number is translated before being used as
a vector.  In order to avoid breaking anything I have tried to keep
with the current way of using these numbers (even though in some cases
it looks wrong).  Somebody with better knowledge of the ia64 code had
better take a look this.

[Sorry about the size of this patch.  It grew a bit larger than
anticipated.]

        eSk


--
Cleanup naming for ia64 and x86 interrupt handling functions

- Append '_IRQ' to AUTO_ASSIGN, NEVER_ASSIGN, and FREE_TO_ASSIGN
- Rename {request,setup}_irq to {request,setup}_irq_vector
- Rename free_irq to release_irq_vector
- Add {request,setup,release}_irq wrappers for their
  {request,setup,release}_irq_vector counterparts
- Added generic irq_to_vector inline for ia64
- Changed ia64 to use the new naming scheme

Signed-off-by: Espen Skoglund <espen.skoglund@xxxxxxxxxxxxx>

--
diff -r 54db59753f3d xen/arch/ia64/linux-xen/iosapic.c
--- a/xen/arch/ia64/linux-xen/iosapic.c Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/ia64/linux-xen/iosapic.c Mon Feb 09 17:36:08 2009 +0000
@@ -93,6 +93,13 @@
 #include <asm/ptrace.h>
 #include <asm/system.h>
 
+static inline int iosapic_irq_to_vector (int irq)
+{
+       return irq;
+}
+
+#undef irq_to_vector
+#define irq_to_vector(irq)      iosapic_irq_to_vector(irq)
 
 #undef DEBUG_INTERRUPT_ROUTING
 
@@ -528,7 +535,7 @@ iosapic_reassign_vector (int vector)
        int new_vector;
 
        if (!list_empty(&iosapic_intr_info[vector].rtes)) {
-               new_vector = assign_irq_vector(AUTO_ASSIGN);
+               new_vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
                if (new_vector < 0)
                        panic("%s: out of interrupt vectors!\n", __FUNCTION__);
                printk(KERN_INFO "Reassigning vector %d to %d\n", vector, 
new_vector);
@@ -764,7 +771,7 @@ again:
        spin_unlock_irqrestore(&iosapic_lock, flags);
 
        /* If vector is running out, we try to find a sharable vector */
-       vector = assign_irq_vector(AUTO_ASSIGN);
+       vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
        if (vector < 0) {
                vector = iosapic_find_sharable_vector(trigger, polarity);
                if (vector < 0)
@@ -919,7 +926,7 @@ iosapic_register_platform_intr (u32 int_
                delivery = IOSAPIC_PMI;
                break;
              case ACPI_INTERRUPT_INIT:
-               vector = assign_irq_vector(AUTO_ASSIGN);
+               vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
                if (vector < 0)
                        panic("%s: out of interrupt vectors!\n", __FUNCTION__);
                delivery = IOSAPIC_INIT;
diff -r 54db59753f3d xen/arch/ia64/linux-xen/irq_ia64.c
--- a/xen/arch/ia64/linux-xen/irq_ia64.c        Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/ia64/linux-xen/irq_ia64.c        Mon Feb 09 17:36:08 2009 +0000
@@ -261,13 +261,13 @@ register_percpu_irq (ia64_vector vec, st
 #ifdef XEN
                                setup_vector(irq, action);
 #else
-                               setup_irq(irq, action);
+                               setup_irq_vector(irq, action);
 #endif
                }
 }
 
 #ifdef XEN
-int request_irq(unsigned int irq,
+int request_irq_vector(unsigned int vector,
                void (*handler)(int, void *, struct cpu_user_regs *),
                unsigned long irqflags, const char * devname, void *dev_id)
 {
@@ -279,7 +279,7 @@ int request_irq(unsigned int irq,
         * otherwise we'll have trouble later trying to figure out
         * which interrupt is which (messes up the interrupt freeing logic etc).
         *                          */
-       if (irq >= NR_IRQS)
+       if (vector >= NR_VECTORS)
                return -EINVAL;
        if (!handler)
                return -EINVAL;
@@ -291,7 +291,7 @@ int request_irq(unsigned int irq,
        action->handler = handler;
        action->name = devname;
        action->dev_id = dev_id;
-       setup_vector(irq, action);
+       setup_vector(vector, action);
        if (retval)
                xfree(action);
 
diff -r 54db59753f3d xen/arch/ia64/linux-xen/mca.c
--- a/xen/arch/ia64/linux-xen/mca.c     Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/ia64/linux-xen/mca.c     Mon Feb 09 17:36:08 2009 +0000
@@ -114,7 +114,6 @@ extern void                 ia64_slave_init_handler (v
 extern void                    ia64_slave_init_handler (void);
 #ifdef XEN
 extern void setup_vector (unsigned int vec, struct irqaction *action);
-#define setup_irq(irq, action) setup_vector(irq, action)
 #endif
 
 static ia64_mc_info_t          ia64_mc_info;
@@ -1926,7 +1925,7 @@ ia64_mca_late_init(void)
                                if (irq_to_vector(irq) == cpe_vector) {
                                        desc = irq_descp(irq);
                                        desc->status |= IRQ_PER_CPU;
-                                       setup_irq(irq, &mca_cpe_irqaction);
+                                       setup_vector(irq, &mca_cpe_irqaction);
                                }
                        ia64_mca_register_cpev(cpe_vector);
                        IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", 
__FUNCTION__);
diff -r 54db59753f3d xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c   Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/ia64/xen/irq.c   Mon Feb 09 17:36:08 2009 +0000
@@ -228,11 +228,11 @@ out:
  * disabled.
  */
 
-int setup_vector(unsigned int irq, struct irqaction * new)
+int setup_vector(unsigned int vector, struct irqaction * new)
 {
        unsigned long flags;
        struct irqaction *old, **p;
-       irq_desc_t *desc = irq_descp(irq);
+       irq_desc_t *desc = irq_descp(vector);
 
        /*
         * The following block of code has to be executed atomically
@@ -248,8 +248,8 @@ int setup_vector(unsigned int irq, struc
 
        desc->depth = 0;
        desc->status &= ~(IRQ_DISABLED | IRQ_INPROGRESS | IRQ_GUEST);
-       desc->handler->startup(irq);
-       desc->handler->enable(irq);
+       desc->handler->startup(vector);
+       desc->handler->enable(vector);
        spin_unlock_irqrestore(&desc->lock,flags);
 
        return 0;
@@ -258,13 +258,11 @@ int setup_vector(unsigned int irq, struc
 /* Vectors reserved by xen (and thus not sharable with domains).  */
 unsigned long ia64_xen_vector[BITS_TO_LONGS(NR_IRQS)];
 
-int setup_irq(unsigned int irq, struct irqaction * new)
+int setup_irq_vector(unsigned int vec, struct irqaction * new)
 {
-       unsigned int vec;
        int res;
 
-       /* Get vector for IRQ.  */
-       if (acpi_gsi_to_irq (irq, &vec) < 0)
+       if ( !vec )
                return -ENOSYS;
        /* Reserve the vector (and thus the irq).  */
        if (test_and_set_bit(vec, ia64_xen_vector))
@@ -273,14 +271,12 @@ int setup_irq(unsigned int irq, struct i
        return res;
 }
 
-void free_irq(unsigned int irq)
+void release_irq_vector(unsigned int vec)
 {
-       unsigned int vec;
        unsigned long flags;
        irq_desc_t *desc;
 
-       /* Get vector for IRQ.  */
-       if (acpi_gsi_to_irq(irq, &vec) < 0)
+       if ( !vec )
                return;
 
        desc = irq_descp(vec);
diff -r 54db59753f3d xen/arch/x86/i8259.c
--- a/xen/arch/x86/i8259.c      Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/x86/i8259.c      Mon Feb 09 17:36:08 2009 +0000
@@ -410,8 +410,8 @@ void __init init_IRQ(void)
     }
 
     /* Never allocate the hypercall vector or Linux/BSD fast-trap vector. */
-    vector_irq[HYPERCALL_VECTOR] = NEVER_ASSIGN;
-    vector_irq[0x80] = NEVER_ASSIGN;
+    vector_irq[HYPERCALL_VECTOR] = NEVER_ASSIGN_IRQ;
+    vector_irq[0x80] = NEVER_ASSIGN_IRQ;
 
     apic_intr_init();
 
diff -r 54db59753f3d xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/x86/irq.c        Mon Feb 09 17:36:08 2009 +0000
@@ -29,7 +29,7 @@ irq_desc_t irq_desc[NR_VECTORS];
 
 static DEFINE_SPINLOCK(vector_lock);
 int vector_irq[NR_VECTORS] __read_mostly = {
-    [0 ... NR_VECTORS - 1] = FREE_TO_ASSIGN
+    [0 ... NR_VECTORS - 1] = FREE_TO_ASSIGN_IRQ
 };
 
 static void __do_IRQ_guest(int vector);
@@ -66,11 +66,11 @@ int free_irq_vector(int vector)
     BUG_ON((vector > LAST_DYNAMIC_VECTOR) || (vector < FIRST_DYNAMIC_VECTOR));
 
     spin_lock(&vector_lock);
-    if ((irq = vector_irq[vector]) == AUTO_ASSIGN)
-        vector_irq[vector] = FREE_TO_ASSIGN;
+    if ((irq = vector_irq[vector]) == AUTO_ASSIGN_IRQ)
+        vector_irq[vector] = FREE_TO_ASSIGN_IRQ;
     spin_unlock(&vector_lock);
 
-    return (irq == AUTO_ASSIGN) ? 0 : -EINVAL;
+    return (irq == AUTO_ASSIGN_IRQ) ? 0 : -EINVAL;
 }
 
 int assign_irq_vector(int irq)
@@ -82,13 +82,13 @@ int assign_irq_vector(int irq)
 
     spin_lock(&vector_lock);
 
-    if ((irq != AUTO_ASSIGN) && (IO_APIC_VECTOR(irq) > 0)) {
+    if ((irq != AUTO_ASSIGN_IRQ) && (IO_APIC_VECTOR(irq) > 0)) {
         spin_unlock(&vector_lock);
         return IO_APIC_VECTOR(irq);
     }
 
     vector = current_vector;
-    while (vector_irq[vector] != FREE_TO_ASSIGN) {
+    while (vector_irq[vector] != FREE_TO_ASSIGN_IRQ) {
         vector += 8;
         if (vector > LAST_DYNAMIC_VECTOR)
             vector = FIRST_DYNAMIC_VECTOR + ((vector + 1) & 7);
@@ -101,7 +101,7 @@ int assign_irq_vector(int irq)
 
     current_vector = vector;
     vector_irq[vector] = irq;
-    if (irq != AUTO_ASSIGN)
+    if (irq != AUTO_ASSIGN_IRQ)
         IO_APIC_VECTOR(irq) = vector;
 
     spin_unlock(&vector_lock);
@@ -159,7 +159,7 @@ asmlinkage void do_IRQ(struct cpu_user_r
     spin_unlock(&desc->lock);
 }
 
-int request_irq(unsigned int irq,
+int request_irq_vector(unsigned int vector,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
 {
@@ -172,7 +172,7 @@ int request_irq(unsigned int irq,
      * which interrupt is which (messes up the interrupt freeing
      * logic etc).
      */
-    if (irq >= NR_IRQS)
+    if (vector >= NR_VECTORS)
         return -EINVAL;
     if (!handler)
         return -EINVAL;
@@ -185,17 +185,16 @@ int request_irq(unsigned int irq,
     action->name = devname;
     action->dev_id = dev_id;
 
-    retval = setup_irq(irq, action);
+    retval = setup_irq_vector(vector, action);
     if (retval)
         xfree(action);
 
     return retval;
 }
 
-void free_irq(unsigned int irq)
+void release_irq_vector(unsigned int vector)
 {
-    unsigned int  vector = irq_to_vector(irq);
-    irq_desc_t   *desc = &irq_desc[vector];
+    irq_desc_t *desc = &irq_desc[vector];
     unsigned long flags;
 
     spin_lock_irqsave(&desc->lock,flags);
@@ -209,10 +208,9 @@ void free_irq(unsigned int irq)
     do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
 }
 
-int setup_irq(unsigned int irq, struct irqaction *new)
+int setup_irq_vector(unsigned int vector, struct irqaction *new)
 {
-    unsigned int  vector = irq_to_vector(irq);
-    irq_desc_t   *desc = &irq_desc[vector];
+    irq_desc_t *desc = &irq_desc[vector];
     unsigned long flags;
  
     spin_lock_irqsave(&desc->lock,flags);
diff -r 54db59753f3d xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/arch/x86/physdev.c    Mon Feb 09 17:36:08 2009 +0000
@@ -75,7 +75,7 @@ static int physdev_map_pirq(struct physd
         case MAP_PIRQ_TYPE_MSI:
             vector = map->index;
             if ( vector == -1 )
-                vector = assign_irq_vector(AUTO_ASSIGN);
+                vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
 
             if ( vector < 0 || vector >= NR_VECTORS )
             {
diff -r 54db59753f3d xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/drivers/char/serial.c Mon Feb 09 17:36:08 2009 +0000
@@ -471,7 +471,7 @@ void serial_suspend(void)
     int i, irq;
     for ( i = 0; i < ARRAY_SIZE(com); i++ )
         if ( (irq = serial_irq(i)) >= 0 )
-            free_irq(irq);
+            release_irq(irq);
 }
 
 void serial_resume(void)
diff -r 54db59753f3d xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c  Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c  Mon Feb 09 17:36:08 2009 +0000
@@ -479,7 +479,7 @@ static int set_iommu_interrupt_handler(s
 {
     int vector, ret;
 
-    vector = assign_irq_vector(AUTO_ASSIGN);
+    vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
     if ( vector <= 0 )
     {
         gdprintk(XENLOG_ERR VTDPREFIX, "IOMMU: no vectors\n");
@@ -487,7 +487,8 @@ static int set_iommu_interrupt_handler(s
     }
 
     irq_desc[vector].handler = &iommu_msi_type;
-    ret = request_irq(vector, amd_iommu_page_fault, 0, "amd_iommu", iommu);
+    ret = request_irq_vector(vector, amd_iommu_page_fault, 0,
+                             "amd_iommu", iommu);
     if ( ret )
     {
         irq_desc[vector].handler = &no_irq_type;
@@ -497,7 +498,7 @@ static int set_iommu_interrupt_handler(s
     }
 
     /* Make sure that vector is never re-used. */
-    vector_irq[vector] = NEVER_ASSIGN;
+    vector_irq[vector] = NEVER_ASSIGN_IRQ;
     vector_to_iommu[vector] = iommu;
     iommu->vector = vector;
     return vector;
diff -r 54db59753f3d xen/drivers/passthrough/vtd/ia64/vtd.c
--- a/xen/drivers/passthrough/vtd/ia64/vtd.c    Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/drivers/passthrough/vtd/ia64/vtd.c    Mon Feb 09 17:36:08 2009 +0000
@@ -29,7 +29,9 @@
 #include "../vtd.h"
 
 
-int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1};
+int vector_irq[NR_VECTORS] __read_mostly = {
+    [0 ... NR_VECTORS - 1] = FREE_TO_ASSIGN_IRQ
+};
 /* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
 u8 irq_vector[NR_IRQS] __read_mostly;
 
diff -r 54db59753f3d xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c       Mon Feb 09 17:36:08 2009 +0000
@@ -874,7 +874,7 @@ int iommu_set_interrupt(struct iommu *io
 {
     int vector, ret;
 
-    vector = assign_irq_vector(AUTO_ASSIGN);
+    vector = assign_irq_vector(AUTO_ASSIGN_IRQ);
     if ( vector <= 0 )
     {
         gdprintk(XENLOG_ERR VTDPREFIX, "IOMMU: no vectors\n");
@@ -882,7 +882,7 @@ int iommu_set_interrupt(struct iommu *io
     }
 
     irq_desc[vector].handler = &dma_msi_type;
-    ret = request_irq(vector, iommu_page_fault, 0, "dmar", iommu);
+    ret = request_irq_vector(vector, iommu_page_fault, 0, "dmar", iommu);
     if ( ret )
     {
         irq_desc[vector].handler = &no_irq_type;
@@ -892,7 +892,7 @@ int iommu_set_interrupt(struct iommu *io
     }
 
     /* Make sure that vector is never re-used. */
-    vector_irq[vector] = NEVER_ASSIGN;
+    vector_irq[vector] = NEVER_ASSIGN_IRQ;
     vector_to_iommu[vector] = iommu;
 
     return vector;
@@ -970,7 +970,7 @@ static void iommu_free(struct acpi_drhd_
         iounmap(iommu->reg);
 
     free_intel_iommu(iommu->intel);
-    free_irq(iommu->vector);
+    release_irq_vector(iommu->vector);
     xfree(iommu);
 
     drhd->iommu = NULL;
diff -r 54db59753f3d xen/include/asm-ia64/hvm/iommu.h
--- a/xen/include/asm-ia64/hvm/iommu.h  Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/include/asm-ia64/hvm/iommu.h  Mon Feb 09 17:36:08 2009 +0000
@@ -28,10 +28,6 @@ static inline void pci_cleanup_msi(struc
     /* TODO */
 }
 
-/* Special IRQ numbers */
-#define AUTO_ASSIGN     (-1)
-#define NEVER_ASSIGN    (-2)
-#define FREE_TO_ASSIGN  (-3)
 
 extern int assign_irq_vector (int irq);
 
diff -r 54db59753f3d xen/include/asm-ia64/hvm/irq.h
--- a/xen/include/asm-ia64/hvm/irq.h    Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/include/asm-ia64/hvm/irq.h    Mon Feb 09 17:36:08 2009 +0000
@@ -90,13 +90,16 @@ struct hvm_irq {
 #define hvm_pci_intx_link(dev, intx) \
     (((dev) + (intx)) & 3)
 
-/* Extract the IA-64 vector that corresponds to IRQ.  */
-static inline int
-irq_to_vector (int irq)
+static inlint int irq_to_vector(int irq)
 {
-    return irq;
+    int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
+    int vector;
+
+    if ( acpi_gsi_to_irq(irq, &vector) < 0)
+        return 0;
+
+    return vector;
 }
-
 
 extern u8 irq_vector[NR_IRQS];
 extern int vector_irq[NR_VECTORS];
diff -r 54db59753f3d xen/include/asm-ia64/linux-xen/linux/interrupt.h
--- a/xen/include/asm-ia64/linux-xen/linux/interrupt.h  Mon Feb 09 14:54:54 
2009 +0000
+++ b/xen/include/asm-ia64/linux-xen/linux/interrupt.h  Mon Feb 09 17:36:08 
2009 +0000
@@ -52,10 +52,10 @@ struct irqaction {
 };
 
 extern irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs);
-extern int request_irq(unsigned int,
+extern int request_irq_vector(unsigned int,
                       irqreturn_t (*handler)(int, void *, struct pt_regs *),
                       unsigned long, const char *, void *);
-extern void free_irq(unsigned int, void *);
+extern void release_irq_vector(unsigned int, void *);
 #endif
 
 
diff -r 54db59753f3d xen/include/asm-ia64/linux/asm/hw_irq.h
--- a/xen/include/asm-ia64/linux/asm/hw_irq.h   Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/include/asm-ia64/linux/asm/hw_irq.h   Mon Feb 09 17:36:08 2009 +0000
@@ -34,7 +34,7 @@ typedef u8 ia64_vector;
 #define IA64_MAX_VECTORED_IRQ          255
 #define IA64_NUM_VECTORS               256
 
-#define AUTO_ASSIGN                    -1
+#define AUTO_ASSIGN_IRQ                        (-1)
 
 #define IA64_SPURIOUS_INT_VECTOR       0x0f
 
diff -r 54db59753f3d xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/include/asm-x86/irq.h Mon Feb 09 17:36:08 2009 +0000
@@ -19,9 +19,6 @@
 
 extern int vector_irq[NR_VECTORS];
 extern u8 irq_vector[NR_IRQS];
-#define AUTO_ASSIGN    -1
-#define NEVER_ASSIGN   -2
-#define FREE_TO_ASSIGN -3
 
 #define platform_legacy_irq(irq)       ((irq) < 16)
 
diff -r 54db59753f3d xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Mon Feb 09 14:54:54 2009 +0000
+++ b/xen/include/xen/irq.h     Mon Feb 09 17:36:08 2009 +0000
@@ -24,6 +24,11 @@ struct irqaction
 #define IRQ_GUEST       16      /* IRQ is handled by guest OS(es) */
 #define IRQ_GUEST_EOI_PENDING 32 /* IRQ was disabled, pending a guest EOI */
 #define IRQ_PER_CPU     256     /* IRQ is per CPU */
+
+/* Special IRQ numbers. */
+#define AUTO_ASSIGN_IRQ         (-1)
+#define NEVER_ASSIGN_IRQ        (-2)
+#define FREE_TO_ASSIGN_IRQ      (-3)
 
 /*
  * Interrupt controller descriptor. This is all we need
@@ -64,11 +69,20 @@ typedef struct {
 
 extern irq_desc_t irq_desc[NR_VECTORS];
 
-extern int setup_irq(unsigned int, struct irqaction *);
-extern void free_irq(unsigned int);
-extern int request_irq(unsigned int irq,
+extern int setup_irq_vector(unsigned int, struct irqaction *);
+extern void release_irq_vector(unsigned int);
+extern int request_irq_vector(unsigned int vector,
                void (*handler)(int, void *, struct cpu_user_regs *),
                unsigned long irqflags, const char * devname, void *dev_id);
+
+#define setup_irq(irq, action) \
+    setup_irq_vector(irq_to_vector(irq), action)
+
+#define release_irq(irq) \
+    release_irq_vector(irq_to_vector(irq))
+
+#define request_irq(irq, handler, irqflags, devname, devid) \
+    request_irq_vector(irq_to_vector(irq), handler, irqflags, defname, devid)
 
 extern hw_irq_controller no_irq_type;
 extern void no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel