Index: sys/powerpc/powerpc/clock.c =================================================================== --- sys/powerpc/powerpc/clock.c +++ sys/powerpc/powerpc/clock.c @@ -69,6 +69,9 @@ #include #include #include +#include +#include +#include #include @@ -158,8 +161,29 @@ cpu_initclocks(void) { - decr_tc_init(); - cpu_initclocks_bsp(); +#ifdef EARLY_AP_STARTUP + struct thread *td; + int i; + + td = curthread; + decr_tc_init(); + cpu_initclocks_bsp(); + CPU_FOREACH(i) { + if (i == 0) + continue; + thread_lock(td); + sched_bind(td, i); + thread_unlock(td); + cpu_initclocks_ap(); + } + thread_lock(td); + if (sched_is_bound(td)) + sched_unbind(td); + thread_unlock(td); +#else + decr_tc_init(); + cpu_initclocks_bsp(); +#endif } /* Index: sys/powerpc/powerpc/mp_machdep.c =================================================================== --- sys/powerpc/powerpc/mp_machdep.c +++ sys/powerpc/powerpc/mp_machdep.c @@ -109,8 +109,10 @@ while(smp_started == 0) ; +#ifndef EARLY_AP_STARTUP /* Start per-CPU event timers. */ cpu_initclocks_ap(); +#endif /* Announce ourselves awake, and enter the scheduler */ sched_throw(NULL); @@ -292,7 +294,7 @@ } -SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); +SYSINIT(start_aps, SI_SUB_CONFIGURE + 1, SI_ORDER_FIRST, cpu_mp_unleash, NULL); int powerpc_ipi_handler(void *arg)