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 2000-01-07 08:49:25 +00:00
parent e100d44d55
commit 35b4c17c79
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;
}