Move the code which checks for disabled apic earlier (in the boot loader).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35741 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -393,7 +393,12 @@ smp_init_other_cpus(void)
|
||||
TRACE(("smp disabled per safemode setting\n"));
|
||||
gKernelArgs.num_cpus = 1;
|
||||
}
|
||||
|
||||
|
||||
if (get_safemode_boolean(B_SAFEMODE_DISABLE_APIC, false)) {
|
||||
TRACE(("local apic disabled per safemode setting\n"));
|
||||
gKernelArgs.arch_args.apic_phys = 0;
|
||||
}
|
||||
|
||||
if (gKernelArgs.arch_args.apic_phys == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -553,12 +553,6 @@ ioapic_init(kernel_args *args)
|
||||
return;
|
||||
}
|
||||
|
||||
bool disableAPIC = get_safemode_boolean(B_SAFEMODE_DISABLE_APIC, false);
|
||||
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;
|
||||
|
||||
@@ -61,13 +61,11 @@ apic_write(uint32 offset, uint32 data)
|
||||
static status_t
|
||||
setup_apic(kernel_args *args, int32 cpu)
|
||||
{
|
||||
uint32 config;
|
||||
|
||||
TRACE(("setting up the APIC for CPU %ld...\n", cpu));
|
||||
TRACE((" apic id %ld, version %ld\n", apic_read(APIC_ID), apic_read(APIC_VERSION)));
|
||||
|
||||
/* set spurious interrupt vector to 0xff */
|
||||
config = apic_read(APIC_SPURIOUS_INTR_VECTOR) & 0xffffff00;
|
||||
uint32 config = apic_read(APIC_SPURIOUS_INTR_VECTOR) & 0xffffff00;
|
||||
config |= APIC_ENABLE | 0xff;
|
||||
apic_write(APIC_SPURIOUS_INTR_VECTOR, config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user