- 2.6.17 port work build breaks, but the patch set is relativly stable
[linux-flexiantxendom0-3.2.10.git] / arch / x86_64 / kernel / io_apic-xen.c
index 90bf618..fd72947 100644 (file)
@@ -869,6 +869,7 @@ u8 irq_vector[NR_IRQ_VECTORS] __read_mostly;
 
 int assign_irq_vector(int irq)
 {
+       static int current_vector = FIRST_DEVICE_VECTOR;
        physdev_op_t op;
   
        BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS);
@@ -879,19 +880,17 @@ int assign_irq_vector(int irq)
        op.u.irq_op.irq = irq;
        if (HYPERVISOR_physdev_op(&op))
                return -ENOSPC;
+       current_vector = op.u.irq_op.vector;
 
-       vector_irq[op.u.irq_op.vector] = irq;
-       if (irq != AUTO_ASSIGN) {
-               u8 vector = cmpxchg(&IO_APIC_VECTOR(irq), 0, op.u.irq_op.vector);
+       vector_irq[current_vector] = irq;
+       if (irq != AUTO_ASSIGN)
+               IO_APIC_VECTOR(irq) = current_vector;
 
-               BUG_ON(vector && vector != op.u.irq_op.vector);
-       }
-
-       return op.u.irq_op.vector;
+       return current_vector;
 }
 
-#ifndef CONFIG_XEN
 extern void (*interrupt[NR_IRQS])(void);
+#ifndef CONFIG_XEN
 static struct hw_interrupt_type ioapic_level_type;
 static struct hw_interrupt_type ioapic_edge_type;