diff options
| author | Peter Wemm <peter@FreeBSD.org> | 1997-08-26 18:36:15 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 1997-08-26 18:36:15 +0000 |
| commit | 90bcb528a8e9e02152a04ae5500185464207ee54 (patch) | |
| tree | 1be96fac036e31e08d32a5d971ff3fc67eec9ee3 | |
| parent | 9a3b3e8bce8e8c8bbec663229e16bebb3cfc5d53 (diff) | |
Notes
| -rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 11 | ||||
| -rw-r--r-- | sys/amd64/amd64/mptable.c | 11 | ||||
| -rw-r--r-- | sys/amd64/include/mptable.h | 11 | ||||
| -rw-r--r-- | sys/i386/i386/mp_machdep.c | 11 | ||||
| -rw-r--r-- | sys/i386/i386/mptable.c | 11 | ||||
| -rw-r--r-- | sys/i386/include/mptable.h | 11 | ||||
| -rw-r--r-- | sys/kern/kern_shutdown.c | 9 | ||||
| -rw-r--r-- | sys/kern/subr_smp.c | 11 |
8 files changed, 53 insertions, 33 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index a4a642399208..d5ea71cddf24 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index a4a642399208..d5ea71cddf24 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index a4a642399208..d5ea71cddf24 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index a4a642399208..d5ea71cddf24 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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index a4a642399208..d5ea71cddf24 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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index a4a642399208..d5ea71cddf24 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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 167b86e51fa7..648922c3aca8 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_shutdown.c,v 1.19 1997/08/09 01:44:19 julian Exp $ + * $Id: kern_shutdown.c,v 1.20 1997/08/26 00:24:25 bde Exp $ */ #include "opt_ddb.h" @@ -181,9 +181,9 @@ boot(howto) #ifdef SMP int c, spins; - /* don't accidently start it */ + /* The MPSPEC says that the BSP must do the shutdown */ if (smp_active) { - smp_active = 1; + smp_active = 0; spins = 100; @@ -193,8 +193,7 @@ boot(howto) printf("timeout waiting for cpu #0!\n"); break; } - printf("oops, I'm on cpu#%d, I need to be on cpu#0!\n", - c); + printf("I'm on cpu#%d, I need to be on cpu#0, sleeping..\n", c); tsleep((caddr_t)&smp_active, PZERO, "cpu0wt", 10); } } diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index a4a642399208..d5ea71cddf24 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.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.45 1997/08/25 21:28:08 bde Exp $ + * $Id: mp_machdep.c,v 1.46 1997/08/26 18:10:31 peter Exp $ */ #include "opt_smp.h" @@ -251,6 +251,8 @@ extern pt_entry_t SMP_prvpt[]; /* Private page pointer to curcpu's PTD, used during BSP init */ extern pd_entry_t *my_idlePTD; +static int smp_started; /* has the system started? */ + /* * Local data and functions. */ @@ -1798,7 +1800,7 @@ void smp_invltlb(void) { #if defined(APIC_IO) - if (smp_active && invltlb_ok) + if (smp_started && invltlb_ok) all_but_self_ipi(XINVLTLB_OFFSET); #endif /* APIC_IO */ } @@ -1848,7 +1850,7 @@ invltlb(void) int stop_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; /* send IPI to all CPUs in map */ @@ -1880,7 +1882,7 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { - if (!smp_active) + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ @@ -1946,6 +1948,7 @@ ap_init() * to accept TLB flush IPI's or something and sync them. */ invltlb_ok = 1; + smp_started = 1; /* enable IPI's, tlb shootdown, freezes etc */ smp_active = 1; /* historic */ curproc = NULL; /* make sure */ |
