[haiku-commits] r35741 - in haiku/trunk/src/system: boot/platform/bios_ia32 kernel/arch/x86

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 3 Mar 2010 20:14:42 +0100 (CET)

Author: jackburton
Date: 2010-03-03 20:14:42 +0100 (Wed, 03 Mar 2010)
New Revision: 35741
Changeset: http://dev.haiku-os.org/changeset/35741/haiku

Modified:
   haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
   haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp
   haiku/trunk/src/system/kernel/arch/x86/arch_smp.cpp
Log:
Move the code which checks for disabled apic earlier (in the boot loader).


Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp      2010-03-03 
17:47:29 UTC (rev 35740)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp      2010-03-03 
19:14:42 UTC (rev 35741)
@@ -393,7 +393,12 @@
                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;
 

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2010-03-03 17:47:29 UTC 
(rev 35740)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2010-03-03 19:14:42 UTC 
(rev 35741)
@@ -553,12 +553,6 @@
                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;

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_smp.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_smp.cpp 2010-03-03 17:47:29 UTC 
(rev 35740)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_smp.cpp 2010-03-03 19:14:42 UTC 
(rev 35741)
@@ -61,13 +61,11 @@
 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);
 


Other related posts: