Author: mmlr Date: 2011-05-10 10:50:57 +0200 (Tue, 10 May 2011) New Revision: 41414 Changeset: https://dev.haiku-os.org/changeset/41414 Modified: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp Log: Remove the IRQ to IO-APIC pin mapping array. It isn't used as we don't redirect vectors at all. It'd also not work for multi IO-APIC setups which we don't support yet (but are relatively rare anyway). Modified: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2011-05-10 07:31:55 UTC (rev 41413) +++ haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2011-05-10 08:50:57 UTC (rev 41414) @@ -141,8 +141,6 @@ static ioapic *sIOAPIC = NULL; static uint32 sIOAPICMaxRedirectionEntry = 23; -static uint32 sIRQToIOAPICPin[256]; - typedef struct interrupt_controller_s { const char *name; void (*enable_io_interrupt)(int32 num); @@ -489,9 +487,8 @@ static void -ioapic_enable_io_interrupt(int32 num) +ioapic_enable_io_interrupt(int32 pin) { - int32 pin = sIRQToIOAPICPin[num]; if (pin < 0 || pin > (int32)sIOAPICMaxRedirectionEntry) return; @@ -505,9 +502,8 @@ static void -ioapic_disable_io_interrupt(int32 num) +ioapic_disable_io_interrupt(int32 pin) { - int32 pin = sIRQToIOAPICPin[num]; if (pin < 0 || pin > (int32)sIOAPICMaxRedirectionEntry) return; @@ -521,9 +517,8 @@ static void -ioapic_configure_io_interrupt(int32 num, uint32 config) +ioapic_configure_io_interrupt(int32 pin, uint32 config) { - int32 pin = sIRQToIOAPICPin[num]; if (pin < 0 || pin > (int32)sIOAPICMaxRedirectionEntry) return; @@ -537,10 +532,10 @@ if (config & B_LEVEL_TRIGGERED) { entry |= (IO_APIC_TRIGGER_MODE_LEVEL << IO_APIC_TRIGGER_MODE_SHIFT); - sLevelTriggeredInterrupts |= (1 << num); + sLevelTriggeredInterrupts |= (1 << pin); } else { entry |= (IO_APIC_TRIGGER_MODE_EDGE << IO_APIC_TRIGGER_MODE_SHIFT); - sLevelTriggeredInterrupts &= ~(1 << num); + sLevelTriggeredInterrupts &= ~(1 << pin); } if (config & B_LOW_ACTIVE_POLARITY) @@ -548,7 +543,7 @@ else entry |= (IO_APIC_PIN_POLARITY_HIGH_ACTIVE << IO_APIC_PIN_POLARITY_SHIFT); - entry |= (num + ARCH_INTERRUPT_BASE) << IO_APIC_INTERRUPT_VECTOR_SHIFT; + entry |= (pin + ARCH_INTERRUPT_BASE) << IO_APIC_INTERRUPT_VECTOR_SHIFT; ioapic_write_64(IO_APIC_REDIRECTION_TABLE + pin * 2, entry); } @@ -713,10 +708,6 @@ ioapic_write_64(IO_APIC_REDIRECTION_TABLE + 2 * i, entry); } - // setup default 1:1 mapping - for (uint32 i = 0; i < 256; i++) - sIRQToIOAPICPin[i] = i; - print_irq_routing_table(&table); // configure io apic interrupts from PCI routing table