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

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

Make setup_irq/request_irq/free_irq take vector param instead of irq param

Also make sure that shutdown() in free_irq() is called with vector param.

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

diff -r a0f0ce00232a xen/arch/x86/i8259.c
--- a/xen/arch/x86/i8259.c      Thu Feb 05 18:42:00 2009 +0000
+++ b/xen/arch/x86/i8259.c      Thu Feb 05 18:58:19 2009 +0000
@@ -422,6 +422,6 @@ void __init init_IRQ(void)
     outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
     outb(LATCH >> 8, PIT_CH0);     /* MSB */
 
-    setup_irq(2, &cascade);
+    setup_irq(irq_to_vector(2), &cascade);
 }
 
diff -r a0f0ce00232a xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Thu Feb 05 18:42:00 2009 +0000
+++ b/xen/arch/x86/irq.c        Thu Feb 05 18:58:19 2009 +0000
@@ -104,7 +104,7 @@ asmlinkage void do_IRQ(struct cpu_user_r
     spin_unlock(&desc->lock);
 }
 
-int request_irq(unsigned int irq,
+int request_irq(unsigned int vector,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
 {
@@ -117,7 +117,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;
@@ -130,34 +130,32 @@ int request_irq(unsigned int irq,
     action->name = devname;
     action->dev_id = dev_id;
 
-    retval = setup_irq(irq, action);
+    retval = setup_irq(vector, action);
     if (retval)
         xfree(action);
 
     return retval;
 }
 
-void free_irq(unsigned int irq)
+void free_irq(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);
     desc->action  = NULL;
     desc->depth   = 1;
     desc->status |= IRQ_DISABLED;
-    desc->handler->shutdown(irq);
+    desc->handler->shutdown(vector);
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
     do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
 }
 
-int setup_irq(unsigned int irq, struct irqaction *new)
+int setup_irq(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 a0f0ce00232a xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Thu Feb 05 18:42:00 2009 +0000
+++ b/xen/arch/x86/time.c       Thu Feb 05 18:58:19 2009 +0000
@@ -1196,7 +1196,7 @@ void __init early_time_init(void)
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
-    setup_irq(0, &irq0);
+    setup_irq(irq_to_vector(0), &irq0);
 }
 
 /* force_hpet_broadcast: if true, force using hpet_broadcast to fix lapic stop
diff -r a0f0ce00232a xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c        Thu Feb 05 18:42:00 2009 +0000
+++ b/xen/drivers/char/ns16550.c        Thu Feb 05 18:58:19 2009 +0000
@@ -242,7 +242,7 @@ static void __devinit ns16550_init_posti
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+        if ( (rc = setup_irq(irq_to_vector(uart->irq), &uart->irqaction)) != 0 
)
             printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
 
         /* Master interrupt enable; also keep DTR/RTS asserted. */
diff -r a0f0ce00232a xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c Thu Feb 05 18:42:00 2009 +0000
+++ b/xen/drivers/char/serial.c Thu Feb 05 18:58:19 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);
+            free_irq(irq_to_vector(irq));
 }
 
 void serial_resume(void)
diff -r a0f0ce00232a xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Thu Feb 05 18:42:00 2009 +0000
+++ b/xen/include/xen/irq.h     Thu Feb 05 18:58:19 2009 +0000
@@ -66,7 +66,7 @@ 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 request_irq(unsigned int vector,
                void (*handler)(int, void *, struct cpu_user_regs *),
                unsigned long irqflags, const char * devname, void *dev_id);
 

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

<Prev in Thread] Current Thread [Next in Thread>