]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86, acpi/irq: Introduce apci_isa_irq_to_gsi
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 30 Mar 2010 08:07:02 +0000 (01:07 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 4 May 2010 20:34:23 +0000 (13:34 -0700)
There are a number of cases where the current code makes the assumption
that isa irqs identity map to the first 16 acpi global system intereupts.
In most instances that assumption is correct as that is the required
behaviour in dual i8259 mode and the default behavior in ioapic mode.

However there are some systems out there that take advantage of acpis
interrupt remapping  for the isa irqs to have a completely different
mapping of isa_irq to gsi.

Introduce acpi_isa_irq_to_gsi to perform this mapping explicitly in the
code that needs it.  Initially this will be just the current assumed
identity mapping to ensure it's introduction does not cause regressions.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
LKML-Reference: <1269936436-7039-1-git-send-email-ebiederm@xmission.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/ia64/kernel/acpi.c
arch/x86/kernel/acpi/boot.c
include/linux/acpi.h

index 4d1a7e9314cf53c6b76c6d77c453b520365e6855..c6c90f39f4d9e35381cedf30cbd700fd4d7c84cb 100644 (file)
@@ -785,6 +785,14 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
        return 0;
 }
 
+int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi)
+{
+       if (isa_irq >= 16)
+               return -1;
+       *gsi = isa_irq;
+       return 0;
+}
+
 /*
  *  ACPI based hotplug CPU support
  */
index cd40aba6aa9563cf5bdb9282fa076ef474d4e163..da718d672596a1844f074a57ea55f77fa996cf72 100644 (file)
@@ -458,6 +458,14 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
        return 0;
 }
 
+int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi)
+{
+       if (isa_irq >= 16)
+               return -1;
+       *gsi = isa_irq;
+       return 0;
+}
+
 /*
  * success: return IRQ number (>=0)
  * failure: return < 0
index b926afe8c03e7f846043ec78e2bbfb0cc021497e..7a937dabcc4a176d27dfaee061c6b7e3411446e4 100644 (file)
@@ -116,6 +116,7 @@ extern unsigned long acpi_realmode_flags;
 
 int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
+int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
 
 #ifdef CONFIG_X86_IO_APIC
 extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity);