Developer tool to boot up in single cpu mode.

Signed-off-by: Kanoj Sarcar <[email protected]>
---
 kern/arch/x86/smp_boot.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kern/arch/x86/smp_boot.c b/kern/arch/x86/smp_boot.c
index 05df791..5f5a95a 100644
--- a/kern/arch/x86/smp_boot.c
+++ b/kern/arch/x86/smp_boot.c
@@ -120,6 +120,9 @@ static void __spin_bootlock_raw(void)
                      "jne 1b;" : : "m"(*bootlock) : "eax", "cc", "memory");
 }
 
+/* To come up on single cpu, comment out the following line */
+#define        BOOT_APS
+
 void smp_boot(void)
 {
        struct per_cpu_info *pcpui0 = &per_cpu_info[0];
@@ -139,6 +142,7 @@ void smp_boot(void)
                panic("No memory for SMP boot stack!");
        smp_stack_top = (uintptr_t)(page2kva(smp_stack) + PGSIZE);
 
+#ifdef BOOT_APS
        /* During SMP boot, core_id_early() returns 0, so all of the cores, 
which
         * grab locks concurrently, share the same pcpui and thus the same
         * lock_depth.  We need to disable checking until core_id works 
properly. */
@@ -155,6 +159,7 @@ void smp_boot(void)
        send_startup_ipi(0x01);
        */
        udelay(500000);
+#endif /* BOOT_APS */
 
        // Each core will also increment smp_semaphore, and decrement when it 
is done,
        // all in smp_entry.  It's purpose is to keep Core0 from competing for 
the
@@ -198,8 +203,10 @@ void smp_boot(void)
 
        /* Final core initialization */
        init_barrier(&generic_barrier, num_cores);
+#ifdef BOOT_APS
        /* This will break the cores out of their hlt in smp_entry.S */
        send_broadcast_ipi(I_POKE_CORE);
+#endif /* BOOT_APS */
        smp_final_core_init();  /* need to init ourselves as well */
 }
 

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to