Add safemode option to disable the use of APIC timers
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33132 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4e6ce30b8f
commit
f0bf38026a
@ -13,6 +13,7 @@
|
||||
#define B_SAFEMODE_DISABLE_IDE_DMA "disableidedma"
|
||||
#define B_SAFEMODE_DISABLE_IOAPIC "disable_ioapic"
|
||||
#define B_SAFEMODE_DISABLE_ACPI "disable_acpi"
|
||||
#define B_SAFEMODE_DISABLE_APIC "disable_apic"
|
||||
#define B_SAFEMODE_DISABLE_APM "disable_apm"
|
||||
#define B_SAFEMODE_DISABLE_SMP "disable_smp"
|
||||
#define B_SAFEMODE_DISABLE_HYPER_THREADING "disable_hyperthreading"
|
||||
|
@ -53,6 +53,12 @@ platform_add_menus(Menu *menu)
|
||||
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 APIC Timers"));
|
||||
item->SetType(MENU_ITEM_MARKABLE);
|
||||
item->SetData(B_SAFEMODE_DISABLE_APIC);
|
||||
item->SetHelpText("Disables using the APIC timers for timekeeping");
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <debug.h>
|
||||
#include <timer.h>
|
||||
#include <int.h>
|
||||
#include <safemode.h>
|
||||
|
||||
#include <arch/timer.h>
|
||||
|
||||
@ -67,11 +68,23 @@ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user