Let BSP wait until all APs are initialized.

This commit is contained in:
Tor Egge 1999-04-10 22:58:29 +00:00
parent 897a45eff9
commit 90c26b0d2d
9 changed files with 66 additions and 9 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;