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
+10 -17
View File
@@ -7,10 +7,6 @@
#include "smp.h" #include "smp.h"
#include "video.h" #include "video.h"
// TODO: Move these away!
#include <arch/x86/arch_apic.h>
#include <boot/stage2.h>
#include <boot/menu.h> #include <boot/menu.h>
#include <boot/platform/generic/text_menu.h> #include <boot/platform/generic/text_menu.h>
#include <safemode.h> #include <safemode.h>
@@ -54,20 +50,17 @@ platform_add_menus(Menu *menu)
#if 0 #if 0
// TODO: IOAPIC isn't yet used anywhere // TODO: IOAPIC isn't yet used anywhere
if (gKernelArgs.arch_args.ioapic != NULL) { menu->AddItem(item = new(nothrow) MenuItem("Disable IO-APIC"));
menu->AddItem(item = new(nothrow) MenuItem("Disable IO-APIC")); item->SetType(MENU_ITEM_MARKABLE);
item->SetType(MENU_ITEM_MARKABLE); item->SetData(B_SAFEMODE_DISABLE_IOAPIC);
item->SetData(B_SAFEMODE_DISABLE_IOAPIC); item->SetHelpText("Disables using the IO APIC for interrupt handling, "
item->SetHelpText("Disables using the IO APIC for interrupt handling, " "forcing instead the use of the PIC.");
"forcing instead the use of the PIC.");
}
#endif #endif
if (gKernelArgs.arch_args.apic != NULL) { menu->AddItem(item = new(nothrow) MenuItem("Disable LOCAL APIC"));
menu->AddItem(item = new(nothrow) MenuItem("Disable APIC Timers")); item->SetType(MENU_ITEM_MARKABLE);
item->SetType(MENU_ITEM_MARKABLE); item->SetData(B_SAFEMODE_DISABLE_APIC);
item->SetData(B_SAFEMODE_DISABLE_APIC); item->SetHelpText("Disables using the LOCAL APIC for timekeeping.");
item->SetHelpText("Disables using the LOCAL APIC for timekeeping.");
}
break; break;
default: default:
break; break;
+12
View File
@@ -560,6 +560,18 @@ ioapic_init(kernel_args *args)
return; 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 // always map the local apic as it can be used for timers even if we
// don't end up using the io apic // don't end up using the io apic
sLocalAPIC = args->arch_args.apic; sLocalAPIC = args->arch_args.apic;
-12
View File
@@ -68,23 +68,11 @@ arch_init_timer(kernel_args *args)
int i = 0; int i = 0;
int bestPriority = -1; int bestPriority = -1;
timer_info *timer = NULL; timer_info *timer = NULL;
bool disableAPIC = false;
void *handle = NULL;
cpu_status state = disable_interrupts(); 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++) { for (i = 0; (timer = sTimers[i]) != NULL; i++) {
int priority = timer->get_priority(); int priority = timer->get_priority();
if (timer == &gAPICTimer && disableAPIC)
continue;
if (priority < bestPriority) { if (priority < bestPriority) {
TRACE(("arch_init_timer: Skipping %s because there is a higher priority timer (%s) initialized.\n", timer->name, sTimer->name)); TRACE(("arch_init_timer: Skipping %s because there is a higher priority timer (%s) initialized.\n", timer->name, sTimer->name));
continue; continue;