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) {