summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2019-03-12 07:07:50 +0100
committerWerner Zeh <werner.zeh@siemens.com>2019-03-14 07:47:54 +0000
commitfedb36e3c849685e2dbf1b6feb2e936a559f9bfb (patch)
treeb2a36f4626b1ea49762dd6e664995acafe8a2c41
parent423adfb0d3d84bea9e862cd068a530146aacac60 (diff)
downloadcoreboot-fedb36e3c849685e2dbf1b6feb2e936a559f9bfb.tar.xz
x86/acpi: Only sort CPU IDs if more than one available
Sorting makes only sense if there are at least two entries available. Change-Id: If40638bf1fe24dcff4b7839967445fb4218184f8 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31853 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
-rw-r--r--src/arch/x86/acpi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index b51b5a6a89..f08a401a6e 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -163,7 +163,8 @@ unsigned long acpi_create_madt_lapics(unsigned long current)
break;
apic_ids[num_cpus++] = cpu->path.apic.apic_id;
}
- bubblesort(apic_ids, num_cpus, NUM_ASCENDING);
+ if (num_cpus > 1)
+ bubblesort(apic_ids, num_cpus, NUM_ASCENDING);
for (index = 0; index < num_cpus; index++) {
current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current,
index, apic_ids[index]);