summaryrefslogtreecommitdiffstats
path: root/bsps/i386/pc386/start/smp-imps.c
diff options
context:
space:
mode:
authorJan Sommer <jan.sommer@dlr.de>2020-05-31 16:22:52 +0200
committerChris Johns <chrisj@rtems.org>2020-06-11 13:28:46 +1000
commitf99b1f02b0a9a3457336949e086b863561d0fb76 (patch)
tree94127c6b6cda3cc349177268c9d0bb2cc67cdad9 /bsps/i386/pc386/start/smp-imps.c
parentbsp/pc386: Fix Makefile for building with SMP (diff)
downloadrtems-f99b1f02b0a9a3457336949e086b863561d0fb76.tar.bz2
bsp/pc386: Turn start16.S into a startAP.S
start16.S is now only used for SMP configurations to start the application processors. This commit removes all unnecessary parts for this job, i.e. video conssole initalisation, A20 gate activation and all non-AP related code. Update #3335
Diffstat (limited to 'bsps/i386/pc386/start/smp-imps.c')
-rw-r--r--bsps/i386/pc386/start/smp-imps.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/bsps/i386/pc386/start/smp-imps.c b/bsps/i386/pc386/start/smp-imps.c
index 0543b17ec5..58d9178f90 100644
--- a/bsps/i386/pc386/start/smp-imps.c
+++ b/bsps/i386/pc386/start/smp-imps.c
@@ -309,6 +309,11 @@ boot_cpu(imps_processor *proc)
}
/*
+ * Wait until AP is in protected mode before starting the next AP
+ */
+ while (reset[2] != 0);
+
+ /*
* Generic CPU startup sequence ends here, the rest is cleanup.
*/
@@ -342,12 +347,17 @@ add_processor(imps_processor *proc)
printk("#0 BootStrap Processor (BSP)\n");
return;
}
+ /* Setup the apic/cpu maps before booting the APs
+ * otherwise calls to _Get_current_processor can deliver
+ * wrong values if the BSP gets interrupted
+ */
+ imps_cpu_apic_map[imps_num_cpus] = apicid;
+ imps_apic_cpu_map[apicid] = imps_num_cpus;
if (boot_cpu(proc)) {
/* XXXXX add OS-specific setup for secondary CPUs here */
- imps_cpu_apic_map[imps_num_cpus] = apicid;
- imps_apic_cpu_map[apicid] = imps_num_cpus;
+ /* AP booted successfully, increase number of available cores */
imps_num_cpus++;
}
}