1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Allow SMP && NCPU == 1 to work. From now on, there's no restriction on the

value of NCPU relative to the number of cpus physically present, the actual
number of cpus utilized will be the smaller of the two.
This commit is contained in:
Luoqi Chen 2000-01-07 08:49:25 +00:00
parent 5e95083920
commit 5c8b298e0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55540
8 changed files with 30 additions and 14 deletions

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}

View File

@ -98,6 +98,8 @@ all_procs_ipi(int vector)
static __inline int
all_but_self_ipi(int vector)
{
if (mp_ncpus <= 1)
return 0;
return apic_ipi(APIC_DEST_ALLESELF, vector, APIC_DELMODE_FIXED);
}

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}

View File

@ -1155,7 +1155,7 @@ static int
processor_entry(proc_entry_ptr entry, int cpu)
{
/* check for usability */
if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
/* check for BSP flag */
@ -1167,11 +1167,13 @@ processor_entry(proc_entry_ptr entry, int cpu)
}
/* add another AP to list, if less than max number of CPUs */
else {
else if (cpu < NCPU) {
CPU_TO_ID(cpu) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = cpu;
return 1;
}
return 0;
}