- APs wait until BSP turns paging on, it is not possible to safely
execute any code on APs until we can turn paging on as well as it
must be done synchronously everywhere
- APs turn paging on but do not continue and wait
}
#ifdef CONFIG_APIC_DEBUG
- if (cpu_is_bsp(cpuid))
+ if (is_bsp)
printf("APIC debugging is enabled\n");
lapic_set_dummy_handlers();
#endif
while(!i386_paging_enabled)
arch_pause();
+ /*
+ * we must load some page tables befre we turn paging on. As VM is
+ * always present we use those
+ */
+ segmentation2paging(proc_addr(VM_PROC_NR));
+
BKL_LOCK();
printf("CPU %d is running\n", cpu);
BKL_UNLOCK();
_PROTOTYPE( void level0_call, (void) );
/* memory.c */
+_PROTOTYPE( void segmentation2paging, (struct proc * current));
_PROTOTYPE( void i386_freepde, (int pde));
_PROTOTYPE( void getcr3val, (void));
} else if (config_no_smp) {
BOOT_VERBOSE(printf("SMP disabled, using legacy PIC\n"));
smp_single_cpu_fallback();
- } else
+ } else {
smp_init();
+ /*
+ * if smp_init() returns it means that it failed and we try to finish
+ * single CPU booting
+ */
+ bsp_finish_booting();
+ }
#else
/*
* if configured for a single CPU, we are already on the kernel stack which we