summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2002-03-05 10:01:46 +0000
committerJeff Roberson <jeff@FreeBSD.org>2002-03-05 10:01:46 +0000
commit88c99cfbc8558d8c601e436d945b9403dc62169d (patch)
treeba2760ce8aec950f5fe901410d365bfcedef9dfd
parent11de413756de9160be6ff6bec1d8148e3f57a905 (diff)
Notes
-rw-r--r--sys/alpha/alpha/mp_machdep.c2
-rw-r--r--sys/amd64/amd64/mp_machdep.c5
-rw-r--r--sys/amd64/amd64/mptable.c5
-rw-r--r--sys/amd64/include/mptable.h5
-rw-r--r--sys/i386/i386/mp_machdep.c5
-rw-r--r--sys/i386/i386/mptable.c5
-rw-r--r--sys/i386/include/mptable.h5
-rw-r--r--sys/kern/subr_smp.c16
-rw-r--r--sys/sys/smp.h1
9 files changed, 41 insertions, 8 deletions
diff --git a/sys/alpha/alpha/mp_machdep.c b/sys/alpha/alpha/mp_machdep.c
index a5fe20c6593e..d899462d00ef 100644
--- a/sys/alpha/alpha/mp_machdep.c
+++ b/sys/alpha/alpha/mp_machdep.c
@@ -307,6 +307,7 @@ cpu_mp_probe(void)
all_cpus = 1 << boot_cpu_id;
mp_ncpus = 1;
+ mp_maxid = 0;
/* Make sure we have at least one secondary CPU. */
cpus = 0;
@@ -332,6 +333,7 @@ cpu_mp_probe(void)
if (i > MAXCPU) {
continue;
}
+ mp_maxid = i;
cpus++;
}
return (cpus);
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 27ee7ae4d029..d775e7d38298 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -788,6 +788,7 @@ mptable_pass1(void)
/* fill in with defaults */
mp_naps = 2; /* includes BSP */
+ mp_maxid = 1;
mp_nbusses = default_data[MPFPS_MPFB1 - 1][0];
#if defined(APIC_IO)
mp_napics = 1;
@@ -809,8 +810,10 @@ mptable_pass1(void)
switch (type = *(u_char *) position) {
case 0: /* processor_entry */
if (((proc_entry_ptr)position)->cpu_flags
- & PROCENTRY_FLAG_EN)
+ & PROCENTRY_FLAG_EN) {
++mp_naps;
+ mp_maxid++;
+ }
break;
case 1: /* bus_entry */
++mp_nbusses;
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index 27ee7ae4d029..d775e7d38298 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -788,6 +788,7 @@ mptable_pass1(void)
/* fill in with defaults */
mp_naps = 2; /* includes BSP */
+ mp_maxid = 1;
mp_nbusses = default_data[MPFPS_MPFB1 - 1][0];
#if defined(APIC_IO)
mp_napics = 1;
@@ -809,8 +810,10 @@ mptable_pass1(void)
switch (type = *(u_char *) position) {
case 0: /* processor_entry */
if (((proc_entry_ptr)position)->cpu_flags
- & PROCENTRY_FLAG_EN)
+ & PROCENTRY_FLAG_EN) {
++mp_naps;
+ mp_maxid++;
+ }
break;
case 1: /* bus_entry */
++mp_nbusses;
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index 27ee7ae4d029..d775e7d38298 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -788,6 +788,7 @@ mptable_pass1(void)
/* fill in with defaults */
mp_naps = 2; /* includes BSP */
+ mp_maxid = 1;
mp_nbusses = default_data[MPFPS_MPFB1 - 1][0];
#if defined(APIC_IO)
mp_napics = 1;
@@ -809,8 +810,10 @@ mptable_pass1(void)
switch (type = *(u_char *) position) {
case 0: /* processor_entry */
if (((proc_entry_ptr)position)->cpu_flags
- & PROCENTRY_FLAG_EN)
+ & PROCENTRY_FLAG_EN) {
++mp_naps;
+ mp_maxid++;
+ }
break;
case 1: /* bus_entry */
++mp_nbusses;
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 27ee7ae4d029..d775e7d38298 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -788,6 +788,7 @@ mptable_pass1(void)
/* fill in with defaults */
mp_naps = 2; /* includes BSP */
+ mp_maxid = 1;
mp_nbusses = default_data[MPFPS_MPFB1 - 1][0];
#if defined(APIC_IO)
mp_napics = 1;
@@ -809,8 +810,10 @@ mptable_pass1(void)
switch (type = *(u_char *) position) {
case 0: /* processor_entry */
if (((proc_entry_ptr)position)->cpu_flags
- & PROCENTRY_FLAG_EN)
+ & PROCENTRY_FLAG_EN) {
++mp_naps;
+ mp_maxid++;
+ }
break;
case 1: /* bus_entry */
++mp_nbusses;
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index 27ee7ae4d029..d775e7d38298 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -788,6 +788,7 @@ mptable_pass1(void)
/* fill in with defaults */
mp_naps = 2; /* includes BSP */
+ mp_maxid = 1;
mp_nbusses = default_data[MPFPS_MPFB1 - 1][0];
#if defined(APIC_IO)
mp_napics = 1;
@@ -809,8 +810,10 @@ mptable_pass1(void)
switch (type = *(u_char *) position) {
case 0: /* processor_entry */
if (((proc_entry_ptr)position)->cpu_flags
- & PROCENTRY_FLAG_EN)
+ & PROCENTRY_FLAG_EN) {
++mp_naps;
+ mp_maxid++;
+ }
break;
case 1: /* bus_entry */
++mp_nbusses;
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index 27ee7ae4d029..d775e7d38298 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -788,6 +788,7 @@ mptable_pass1(void)
/* fill in with defaults */
mp_naps = 2; /* includes BSP */
+ mp_maxid = 1;
mp_nbusses = default_data[MPFPS_MPFB1 - 1][0];
#if defined(APIC_IO)
mp_napics = 1;
@@ -809,8 +810,10 @@ mptable_pass1(void)
switch (type = *(u_char *) position) {
case 0: /* processor_entry */
if (((proc_entry_ptr)position)->cpu_flags
- & PROCENTRY_FLAG_EN)
+ & PROCENTRY_FLAG_EN) {
++mp_naps;
+ mp_maxid++;
+ }
break;
case 1: /* bus_entry */
++mp_nbusses;
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 2734f7e7a93d..1d90fe8d6ae2 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -53,6 +53,7 @@ int mp_ncpus;
volatile int smp_started;
u_int all_cpus;
+u_int mp_maxid;
SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD, NULL, "Kernel SMP");
@@ -79,16 +80,27 @@ static void (*smp_rv_teardown_func)(void *arg);
static void *smp_rv_func_arg;
static volatile int smp_rv_waiters[2];
static struct mtx smp_rv_mtx;
+static int mp_probe_status;
/*
- * Initialize MI SMP variables and call the MD SMP initialization code.
+ * Initialize MI SMP variables.
+ */
+static void
+mp_probe(void *dummy)
+{
+ mp_probe_status = cpu_mp_probe();
+}
+SYSINIT(cpu_mp_probe, SI_SUB_TUNABLES, SI_ORDER_FIRST, mp_probe, NULL);
+
+/*
+ * Call the MD SMP initialization code.
*/
static void
mp_start(void *dummy)
{
/* Probe for MP hardware. */
- if (cpu_mp_probe() == 0)
+ if (mp_probe_status == 0)
return;
mtx_init(&smp_rv_mtx, "smp rendezvous", MTX_SPIN);
diff --git a/sys/sys/smp.h b/sys/sys/smp.h
index 3bb7a8084c4a..e829719fd662 100644
--- a/sys/sys/smp.h
+++ b/sys/sys/smp.h
@@ -26,6 +26,7 @@ extern int smp_cpus;
extern u_int all_cpus;
extern volatile u_int started_cpus;
extern volatile u_int stopped_cpus;
+extern u_int mp_maxid;
/*
* Macro allowing us to determine whether a CPU is absent at any given