From ca67ddb3539baff65715bbc068643e36f110132b Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 11 May 2011 09:01:50 +0000 Subject: [PATCH] When enumerating IO-APICs failed, try to still get the routing done with how far we got. If the routing is possible with the limited IO-APICs everythings good, if not we will simply fail at the routing preparation stage where we can still fall back gracefully. This makes things a bit more error resilient. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41432 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/ioapic.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/system/kernel/arch/x86/ioapic.cpp b/src/system/kernel/arch/x86/ioapic.cpp index 13334904d4..48b32c4e0f 100644 --- a/src/system/kernel/arch/x86/ioapic.cpp +++ b/src/system/kernel/arch/x86/ioapic.cpp @@ -396,13 +396,12 @@ acpi_enumerate_ioapics(acpi_module_info* acpi) dprintf("mapping io-apic %u at physical address %p\n", ioapic->number, (void*)info->Address); status_t status = ioapic_map_ioapic(*ioapic, info->Address); - if (status != B_OK) { + if (status == B_OK) { + lastIOAPIC->next = ioapic; + lastIOAPIC = ioapic; + } else free(ioapic); - return status; - } - lastIOAPIC->next = ioapic; - lastIOAPIC = ioapic; break; } } @@ -500,9 +499,10 @@ ioapic_init(kernel_args* args) status = acpi_enumerate_ioapics(acpiModule); if (status != B_OK) { - dprintf("failed to enumerate all io-apics, not using io-apics for " - "interrupt routing\n"); - return; + // We don't treat this case as fatal just yet. If we are able to + // route everything with the available IO-APICs we're fine, if not + // we will fail at the routing preparation stage further down. + dprintf("failed to enumerate all io-apics, working with what we got\n"); } // switch to the APIC interrupt model before retrieving the IRQ routing