Basically reverted previous commit, since at that point we haven't yet

checked the existence of the apics.
Moved the code to disable the local apic from arch_timer.c to arch_int.cpp, so
we also avoid installing the interrupt handler for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33149 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2009-09-15 20:22:04 +00:00
parent 44f6eb85bd
commit 1d5026909d
3 changed files with 23 additions and 30 deletions

View File

@ -7,10 +7,6 @@
#include "smp.h"
#include "video.h"
// TODO: Move these away!
#include <arch/x86/arch_apic.h>
#include <boot/stage2.h>
#include <boot/menu.h>
#include <boot/platform/generic/text_menu.h>
#include <safemode.h>
@ -54,20 +50,17 @@ platform_add_menus(Menu *menu)
#if 0
// TODO: IOAPIC isn't yet used anywhere
if (gKernelArgs.arch_args.ioapic != NULL) {
menu->AddItem(item = new(nothrow) MenuItem("Disable IO-APIC"));
item->SetType(MENU_ITEM_MARKABLE);
item->SetData(B_SAFEMODE_DISABLE_IOAPIC);
item->SetHelpText("Disables using the IO APIC for interrupt handling, "
"forcing instead the use of the PIC.");
}
menu->AddItem(item = new(nothrow) MenuItem("Disable IO-APIC"));
item->SetType(MENU_ITEM_MARKABLE);
item->SetData(B_SAFEMODE_DISABLE_IOAPIC);
item->SetHelpText("Disables using the IO APIC for interrupt handling, "
"forcing instead the use of the PIC.");
#endif
if (gKernelArgs.arch_args.apic != NULL) {
menu->AddItem(item = new(nothrow) MenuItem("Disable APIC Timers"));
item->SetType(MENU_ITEM_MARKABLE);
item->SetData(B_SAFEMODE_DISABLE_APIC);
item->SetHelpText("Disables using the LOCAL APIC for timekeeping.");
}
menu->AddItem(item = new(nothrow) MenuItem("Disable LOCAL APIC"));
item->SetType(MENU_ITEM_MARKABLE);
item->SetData(B_SAFEMODE_DISABLE_APIC);
item->SetHelpText("Disables using the LOCAL APIC for timekeeping.");
break;
default:
break;

View File

@ -560,6 +560,18 @@ ioapic_init(kernel_args *args)
return;
}
bool disableAPIC = false;
void *handle = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS);
if (handle != NULL) {
disableAPIC = get_driver_boolean_parameter(handle, B_SAFEMODE_DISABLE_APIC,
disableAPIC, disableAPIC);
unload_driver_settings(handle);
}
if (disableAPIC) {
args->arch_args.apic = NULL;
return;
}
// always map the local apic as it can be used for timers even if we
// don't end up using the io apic
sLocalAPIC = args->arch_args.apic;
@ -569,7 +581,7 @@ ioapic_init(kernel_args *args)
panic("mapping the local apic failed");
return;
}
if (args->arch_args.ioapic == NULL) {
dprintf("no ioapic available, not using ioapics for interrupt routing\n");
return;

View File

@ -68,23 +68,11 @@ arch_init_timer(kernel_args *args)
int i = 0;
int bestPriority = -1;
timer_info *timer = NULL;
bool disableAPIC = false;
void *handle = NULL;
cpu_status state = disable_interrupts();
handle = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS);
if (handle != NULL) {
disableAPIC = get_driver_boolean_parameter(handle, B_SAFEMODE_DISABLE_APIC,
disableAPIC, disableAPIC);
unload_driver_settings(handle);
}
for (i = 0; (timer = sTimers[i]) != NULL; i++) {
int priority = timer->get_priority();
if (timer == &gAPICTimer && disableAPIC)
continue;
if (priority < bestPriority) {
TRACE(("arch_init_timer: Skipping %s because there is a higher priority timer (%s) initialized.\n", timer->name, sTimer->name));
continue;