Date: Thu, 21 Dec 2006 23:55:29 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112045 for review Message-ID: <200612212355.kBLNtTA5058865@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112045 Change 112045 by marcel@marcel_nfs on 2006/12/21 23:55:24 o Flesh out cpu_mp_announce() o Add cpu_mp_unleash() Affected files ... .. //depot/projects/powerpc/sys/powerpc/include/pcpu.h#4 edit .. //depot/projects/powerpc/sys/powerpc/powerpc/mp_machdep.c#7 edit Differences ... ==== //depot/projects/powerpc/sys/powerpc/include/pcpu.h#4 (text+ko) ==== @@ -39,7 +39,8 @@ #define PCPU_MD_FIELDS \ int pc_inside_intr; \ struct pmap *pc_curpmap; /* current pmap */ \ - struct thread *pc_fputhread; /* current fpu user */ \ + struct thread *pc_fputhread; /* current fpu user */ \ + int pc_awake:1; \ register_t pc_tempsave[CPUSAVE_LEN]; \ register_t pc_disisave[CPUSAVE_LEN]; \ register_t pc_dbsave[CPUSAVE_LEN]; ==== //depot/projects/powerpc/sys/powerpc/powerpc/mp_machdep.c#7 (text+ko) ==== @@ -37,6 +37,11 @@ #include <dev/ofw/openfirm.h> +volatile static int ap_awake; +volatile static int ap_spin; + +int mp_ipi_test = 0; + void cpu_mp_setmaxid(void) { @@ -93,9 +98,58 @@ void cpu_mp_announce(void) { + struct pcpu *pc; + int i; + + for (i = 0; i <= mp_maxid; i++) { + pc = pcpu_find(i); + if (pc == NULL) + continue; + printf("cpu%d", i); + if (i == 0) + printf(" (BSP)"); + printf("\n"); + } } static void +cpu_mp_unleash(void *dummy) +{ + struct pcpu *pc; + int cpus; + + if (mp_ncpus <= 1) + return; + + if (mp_ipi_test != 1) + printf("SMP: WARNING: sending of a test IPI failed\n"); + + cpus = 0; + smp_cpus = 0; + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + cpus++; + if (pc->pc_awake) + smp_cpus++; + } + + ap_awake = 1; + ap_spin = 0; + + while (ap_awake != smp_cpus) + DELAY(0); + + if (smp_cpus != cpus || cpus != mp_ncpus) { + printf("SMP: %d CPUs found; %d CPUs usable; %d CPUs woken\n", + mp_ncpus, cpus, smp_cpus); + } + + smp_active = 1; + smp_started = 1; +} + +SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); + +static void ipi_send(struct pcpu *pc, int ipi) { } @@ -142,4 +196,3 @@ ipi_send(pcpup, ipi); } -
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612212355.kBLNtTA5058865>