summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorgber <gber@FreeBSD.org>2013-05-06 14:27:46 +0000
committergber <gber@FreeBSD.org>2013-05-06 14:27:46 +0000
commitec12f28a77580cdaefb7a049e07c049a980d3ba4 (patch)
tree4b85eba35c16cf6319496d885dfd48773a2b5cc5 /sys/arm
parent5bbe70ff76cd7e4a7b1944ed0c63396cf3b96176 (diff)
downloadFreeBSD-src-ec12f28a77580cdaefb7a049e07c049a980d3ba4.zip
FreeBSD-src-ec12f28a77580cdaefb7a049e07c049a980d3ba4.tar.gz
Avoid calling pcpu_init() simultaneously.
pcpu_init() updates queue, so cannot be called by multiple cores at the same time Obtained from: Semihalf
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/mp_machdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arm/arm/mp_machdep.c b/sys/arm/arm/mp_machdep.c
index 99b750d..2193266 100644
--- a/sys/arm/arm/mp_machdep.c
+++ b/sys/arm/arm/mp_machdep.c
@@ -173,8 +173,15 @@ init_secondary(int cpu)
pc = &__pcpu[cpu];
set_pcpu(pc);
- pcpu_init(pc, cpu, sizeof(struct pcpu));
+ /*
+ * pcpu_init() updates queue, so it should not be executed in parallel
+ * on several cores
+ */
+ while(mp_naps < (cpu - 1))
+ ;
+
+ pcpu_init(pc, cpu, sizeof(struct pcpu));
dpcpu_init(dpcpu[cpu - 1], cpu);
/* Provide stack pointers for other processor modes. */
OpenPOWER on IntegriCloud