1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

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:
John Baldwin 2003-12-10 19:28:37 +00:00
parent e38926c160
commit 3f19e465b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123402

View File

@ -232,9 +232,9 @@ void
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",
apic_id, MAXCPU);
apic_id, MAXCPU - 1);
return;
}
KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %d added twice",