summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>1999-04-10 22:58:29 +0000
committertegge <tegge@FreeBSD.org>1999-04-10 22:58:29 +0000
commit7b3fdbf486e944b21ae3255fb8534dab447f77f5 (patch)
tree45cf831920faeb7e1542b08daa0a55a3ba2dd235 /sys/i386
parent80578d3e921ae9286d140e7e3befe23f83bf2634 (diff)
downloadFreeBSD-src-7b3fdbf486e944b21ae3255fb8534dab447f77f5.zip
FreeBSD-src-7b3fdbf486e944b21ae3255fb8534dab447f77f5.tar.gz
Let BSP wait until all APs are initialized.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/mp_machdep.c5
-rw-r--r--sys/i386/i386/mpboot.s20
-rw-r--r--sys/i386/i386/mptable.c5
-rw-r--r--sys/i386/include/mptable.h5
4 files changed, 31 insertions, 4 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index cde98a7..6bd4ddc 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.93 1999/03/05 16:38:10 bde Exp $
+ * $Id: mp_machdep.c,v 1.94 1999/04/07 17:08:40 peter Exp $
*/
#include "opt_smp.h"
@@ -1927,6 +1927,9 @@ start_all_aps(u_int boot_addr)
for (i = 0; i < mp_ncpus; i++) {
bcopy( (int *) PTD + KPTDI, (int *) IdlePTDS[i] + KPTDI, NKPDE * sizeof (int));
}
+ wait_ap(1000000);
+ if (smp_started == 0)
+ printf("WARNING: Failed to start all APs\n");
/* number of APs actually started */
return mp_ncpus - 1;
diff --git a/sys/i386/i386/mpboot.s b/sys/i386/i386/mpboot.s
index 0b9af85..7a5d431 100644
--- a/sys/i386/i386/mpboot.s
+++ b/sys/i386/i386/mpboot.s
@@ -31,7 +31,7 @@
* mpboot.s: FreeBSD machine support for the Intel MP Spec
* multiprocessor systems.
*
- * $Id: mpboot.s,v 1.7 1998/09/06 22:41:40 tegge Exp $
+ * $Id: mpboot.s,v 1.8 1998/10/10 10:36:12 kato Exp $
*/
#include "opt_vm86.h"
@@ -133,6 +133,24 @@ mp_begin: /* now running relocated at KERNBASE */
/* let her rip! (loads new stack) */
jmp _cpu_switch
+NON_GPROF_ENTRY(wait_ap)
+ pushl %ebp
+ movl %esp, %ebp
+ call _rel_mplock
+ movl %eax, 8(%ebp)
+1:
+ cmpl $0, CNAME(smp_started)
+ jnz 2f
+ decl %eax
+ cmpl $0, %eax
+ jge 1b
+2:
+ call _get_mplock
+ movl %ebp, %esp
+ popl %ebp
+ ret
+
+
/*
* This is the embedded trampoline or bootstrap that is
* copied into 'real-mode' low memory, it is where the
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index cde98a7..6bd4ddc 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.93 1999/03/05 16:38:10 bde Exp $
+ * $Id: mp_machdep.c,v 1.94 1999/04/07 17:08:40 peter Exp $
*/
#include "opt_smp.h"
@@ -1927,6 +1927,9 @@ start_all_aps(u_int boot_addr)
for (i = 0; i < mp_ncpus; i++) {
bcopy( (int *) PTD + KPTDI, (int *) IdlePTDS[i] + KPTDI, NKPDE * sizeof (int));
}
+ wait_ap(1000000);
+ if (smp_started == 0)
+ printf("WARNING: Failed to start all APs\n");
/* number of APs actually started */
return mp_ncpus - 1;
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index cde98a7..6bd4ddc 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.93 1999/03/05 16:38:10 bde Exp $
+ * $Id: mp_machdep.c,v 1.94 1999/04/07 17:08:40 peter Exp $
*/
#include "opt_smp.h"
@@ -1927,6 +1927,9 @@ start_all_aps(u_int boot_addr)
for (i = 0; i < mp_ncpus; i++) {
bcopy( (int *) PTD + KPTDI, (int *) IdlePTDS[i] + KPTDI, NKPDE * sizeof (int));
}
+ wait_ap(1000000);
+ if (smp_started == 0)
+ printf("WARNING: Failed to start all APs\n");
/* number of APs actually started */
return mp_ncpus - 1;
OpenPOWER on IntegriCloud