diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-10-04 05:16:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:28 -0400 |
commit | c4fa0bbf384496ae4acc0a150719d9d8fa8d11b3 (patch) | |
tree | cbca26057c0f0de9df559bb825820c3a92cb83b9 /arch/x86_64 | |
parent | 3fc471ede99579211c44b6a64829c4318976990f (diff) |
[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: Eric W. Biederman <ebiederm@xmission.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rajesh Shah <rajesh.shah@intel.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 12dd938f5d54..fd52fcb6fa16 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -1254,11 +1254,6 @@ static int ioapic_retrigger_vector(unsigned int vector) | |||
1254 | * races. | 1254 | * races. |
1255 | */ | 1255 | */ |
1256 | 1256 | ||
1257 | static void ack_apic(unsigned int irq) | ||
1258 | { | ||
1259 | ack_APIC_irq(); | ||
1260 | } | ||
1261 | |||
1262 | static void ack_apic_edge(unsigned int irq) | 1257 | static void ack_apic_edge(unsigned int irq) |
1263 | { | 1258 | { |
1264 | move_native_irq(irq); | 1259 | move_native_irq(irq); |
@@ -1698,6 +1693,52 @@ static int __init ioapic_init_sysfs(void) | |||
1698 | 1693 | ||
1699 | device_initcall(ioapic_init_sysfs); | 1694 | device_initcall(ioapic_init_sysfs); |
1700 | 1695 | ||
1696 | #ifdef CONFIG_PCI_MSI | ||
1697 | /* | ||
1698 | * Dynamic irq allocate and deallocation for MSI | ||
1699 | */ | ||
1700 | int create_irq(void) | ||
1701 | { | ||
1702 | /* Hack of the day: irq == vector. | ||
1703 | * | ||
1704 | * Ultimately this will be be more general, | ||
1705 | * and not depend on the irq to vector identity mapping. | ||
1706 | * But this version is needed until msi.c can cope with | ||
1707 | * the more general form. | ||
1708 | */ | ||
1709 | int irq, vector; | ||
1710 | unsigned long flags; | ||
1711 | vector = assign_irq_vector(AUTO_ASSIGN); | ||
1712 | irq = vector; | ||
1713 | |||
1714 | if (vector >= 0) { | ||
1715 | spin_lock_irqsave(&vector_lock, flags); | ||
1716 | vector_irq[vector] = irq; | ||
1717 | irq_vector[irq] = vector; | ||
1718 | spin_unlock_irqrestore(&vector_lock, flags); | ||
1719 | |||
1720 | set_intr_gate(vector, interrupt[irq]); | ||
1721 | |||
1722 | dynamic_irq_init(irq); | ||
1723 | } | ||
1724 | return irq; | ||
1725 | } | ||
1726 | |||
1727 | void destroy_irq(unsigned int irq) | ||
1728 | { | ||
1729 | unsigned long flags; | ||
1730 | unsigned int vector; | ||
1731 | |||
1732 | dynamic_irq_cleanup(irq); | ||
1733 | |||
1734 | spin_lock_irqsave(&vector_lock, flags); | ||
1735 | vector = irq_vector[irq]; | ||
1736 | vector_irq[vector] = -1; | ||
1737 | irq_vector[irq] = 0; | ||
1738 | spin_unlock_irqrestore(&vector_lock, flags); | ||
1739 | } | ||
1740 | #endif | ||
1741 | |||
1701 | /* -------------------------------------------------------------------------- | 1742 | /* -------------------------------------------------------------------------- |
1702 | ACPI-based IOAPIC Configuration | 1743 | ACPI-based IOAPIC Configuration |
1703 | -------------------------------------------------------------------------- */ | 1744 | -------------------------------------------------------------------------- */ |