Correct usage of MAXCPU. The MAXCPU value itself is not a valid CPU ID
value as it is a count of maximum values. Reported by: bde
This commit is contained in:
parent
e38926c160
commit
3f19e465b9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123402
@ -232,9 +232,9 @@ void
|
|||||||
cpu_add(u_int apic_id, char boot_cpu)
|
cpu_add(u_int apic_id, char boot_cpu)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (apic_id > MAXCPU) {
|
if (apic_id >= MAXCPU) {
|
||||||
printf("SMP: CPU %d exceeds maximum CPU %d, ignoring\n",
|
printf("SMP: CPU %d exceeds maximum CPU %d, ignoring\n",
|
||||||
apic_id, MAXCPU);
|
apic_id, MAXCPU - 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %d added twice",
|
KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %d added twice",
|
||||||
|
Loading…
Reference in New Issue
Block a user