/* * Further secondary CPU initialization. * * We are now running on our startup stack, with proper page tables. * There is nothing to do but display some details about the CPU and its CMMUs. */ void secondary_main() { struct cpu_info *ci = curcpu(); int s; cpu_configuration_print(0); ncpus++; sched_init_cpu(ci); nanouptime(&ci->ci_schedstate.spc_runtime); ci->ci_curproc = NULL; ci->ci_randseed = (arc4random() & 0x7fffffff) + 1; /* * Release cpu_hatch_mutex to let other secondary processors * have a chance to run. */ hatch_pending_count--; __cpu_simple_unlock(&cpu_hatch_mutex); /* wait for cpu_boot_secondary_processors() */ __cpu_simple_lock(&cpu_boot_mutex); __cpu_simple_unlock(&cpu_boot_mutex); spl0(); SCHED_LOCK(s); set_psr(get_psr() & ~PSR_IND); SET(ci->ci_flags, CIF_ALIVE); cpu_switchto(NULL, sched_chooseproc()); }
void mainbus_attach(struct device *parent, struct device *self, void *args) { extern void cpu_setup_secondary_processors(void); extern char cpu_model[]; printf(": %s, cpuid 0x%04x", cpu_model, cpuid); printf("\n"); /* * Display cpu/mmu details for the main processor. */ cpu_configuration_print(1); #ifdef MULTIPROCESSOR /* * Let secondary processors initialize further and print * their configuration information now. */ cpu_setup_secondary_processors(); #endif (void)config_search(mainbus_scan, self, args); }