Commit c4fa0bbf authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds
Browse files

[PATCH] genirq: x86_64 irq: Dynamic irq support

The current implementation of create_irq() is a hack but it is the current
hack that msi.c uses, and unfortunately the ``generic'' apic msi ops depend on
this hack.  Thus we are this hack of assuming irq == vector until the
depencencies in the generic irq code are removed.
Signed-off-by: default avatarEric W. Biederman <>
Cc: Ingo Molnar <>
Cc: Thomas Gleixner <>
Cc: Benjamin Herrenschmidt <>
Cc: Rajesh Shah <>
Cc: Andi Kleen <>
Cc: "Protasevich, Natalie" <>
Cc: "Luck, Tony" <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 3fc471ed
......@@ -1254,11 +1254,6 @@ static int ioapic_retrigger_vector(unsigned int vector)
* races.
static void ack_apic(unsigned int irq)
static void ack_apic_edge(unsigned int irq)
......@@ -1698,6 +1693,52 @@ static int __init ioapic_init_sysfs(void)
* Dynamic irq allocate and deallocation for MSI
int create_irq(void)
/* Hack of the day: irq == vector.
* Ultimately this will be be more general,
* and not depend on the irq to vector identity mapping.
* But this version is needed until msi.c can cope with
* the more general form.
int irq, vector;
unsigned long flags;
vector = assign_irq_vector(AUTO_ASSIGN);
irq = vector;
if (vector >= 0) {
spin_lock_irqsave(&vector_lock, flags);
vector_irq[vector] = irq;
irq_vector[irq] = vector;
spin_unlock_irqrestore(&vector_lock, flags);
set_intr_gate(vector, interrupt[irq]);
return irq;
void destroy_irq(unsigned int irq)
unsigned long flags;
unsigned int vector;
spin_lock_irqsave(&vector_lock, flags);
vector = irq_vector[irq];
vector_irq[vector] = -1;
irq_vector[irq] = 0;
spin_unlock_irqrestore(&vector_lock, flags);
/* --------------------------------------------------------------------------
ACPI-based IOAPIC Configuration
-------------------------------------------------------------------------- */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment