From 56b5ad07811e608372b159831a6151598edefd48 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 7 May 2011 21:41:09 +0000 Subject: [PATCH] Added a temporary opt-in option "enable_ioapic" to the boot menu. This way the IO-APIC can be easily enabled to test it on various configurations. Note that the previous default opt-out didn't work because the safemode options would not be touched at all when not actually entering the boot menu. Once IO-APIC is more broadly tested this can be removed again and the opt-out option reenabled. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41370 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/system/safemode_defs.h | 2 ++ src/system/boot/platform/bios_ia32/smp.cpp | 14 ++++++++++---- src/system/kernel/arch/x86/arch_int.cpp | 11 ++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/headers/private/system/safemode_defs.h b/headers/private/system/safemode_defs.h index 7bd2435bdd..e5d5a3ea6a 100644 --- a/headers/private/system/safemode_defs.h +++ b/headers/private/system/safemode_defs.h @@ -21,5 +21,7 @@ # define B_SAFEMODE_DISABLE_LATENCY_CHECK "disable_latency_check" #endif +#define B_SAFEMODE_ENABLE_IOAPIC "enable_ioapic" + // TODO: temprary opt-in, can be removed once IO-APIC code is broadly tested #endif /* _SYSTEM_SAFEMODE_DEFS_H */ diff --git a/src/system/boot/platform/bios_ia32/smp.cpp b/src/system/boot/platform/bios_ia32/smp.cpp index 3b152eb699..0f635d37ac 100644 --- a/src/system/boot/platform/bios_ia32/smp.cpp +++ b/src/system/boot/platform/bios_ia32/smp.cpp @@ -580,13 +580,19 @@ smp_add_safemode_menus(Menu *menu) MenuItem *item; if (gKernelArgs.arch_args.ioapic_phys != 0) { +#if 0 menu->AddItem(item = new(nothrow) MenuItem("Disable IO-APIC")); item->SetType(MENU_ITEM_MARKABLE); - item->SetMarked(true); - // TODO: disabled by default for now item->SetData(B_SAFEMODE_DISABLE_IOAPIC); - item->SetHelpText("Disables using the IO APIC for interrupt handling, " - "forcing instead the use of the PIC."); + item->SetHelpText("Disables using the IO APIC for interrupt routing, " + "forcing the use of the legacy PIC instead."); +#else + // TODO: This can be removed once IO-APIC code is broadly tested + menu->AddItem(item = new(nothrow) MenuItem("Enable IO-APIC")); + item->SetType(MENU_ITEM_MARKABLE); + item->SetData(B_SAFEMODE_ENABLE_IOAPIC); + item->SetHelpText("Enables using the IO APIC for interrupt routing."); +#endif } if (gKernelArgs.arch_args.apic_phys != 0) { diff --git a/src/system/kernel/arch/x86/arch_int.cpp b/src/system/kernel/arch/x86/arch_int.cpp index 7a9eae624c..6bc31eff71 100644 --- a/src/system/kernel/arch/x86/arch_int.cpp +++ b/src/system/kernel/arch/x86/arch_int.cpp @@ -614,11 +614,20 @@ ioapic_init(kernel_args* args) if (sIOAPIC == NULL) return; - if (get_safemode_boolean(B_SAFEMODE_DISABLE_IOAPIC, true)) { +#if 0 + if (get_safemode_boolean(B_SAFEMODE_DISABLE_IOAPIC, false)) { dprintf("ioapic explicitly disabled, not using ioapics for interrupt " "routing\n"); return; } +#else + // TODO: This can be removed once IO-APIC code is broadly tested + if (!get_safemode_boolean(B_SAFEMODE_ENABLE_IOAPIC, false)) { + dprintf("ioapic not enabled, not using ioapics for interrupt " + "routing\n"); + return; + } +#endif uint32 version = ioapic_read_32(IO_APIC_VERSION); if (version == 0xffffffff) {