mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 22:51:37 +00:00
x86: acpi: Fix madt lapic generation
An accumulated length was incorrectly added to current each pass through the loop. On system with more than 2 cores this caused a corrupt MADT to be generated. Signed-off-by: George McCollister <george.mccollister@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
6b3943f1b0
commit
8a1a7595cf
1 changed files with 6 additions and 6 deletions
|
@ -183,20 +183,20 @@ static int acpi_create_madt_lapic(struct acpi_madt_lapic *lapic,
|
||||||
int acpi_create_madt_lapics(u32 current)
|
int acpi_create_madt_lapics(u32 current)
|
||||||
{
|
{
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
int length = 0;
|
int total_length = 0;
|
||||||
|
|
||||||
for (uclass_find_first_device(UCLASS_CPU, &dev);
|
for (uclass_find_first_device(UCLASS_CPU, &dev);
|
||||||
dev;
|
dev;
|
||||||
uclass_find_next_device(&dev)) {
|
uclass_find_next_device(&dev)) {
|
||||||
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
|
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
|
||||||
|
int length = acpi_create_madt_lapic(
|
||||||
length += acpi_create_madt_lapic(
|
(struct acpi_madt_lapic *)current,
|
||||||
(struct acpi_madt_lapic *)current,
|
plat->cpu_id, plat->cpu_id);
|
||||||
plat->cpu_id, plat->cpu_id);
|
|
||||||
current += length;
|
current += length;
|
||||||
|
total_length += length;
|
||||||
}
|
}
|
||||||
|
|
||||||
return length;
|
return total_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
int acpi_create_madt_ioapic(struct acpi_madt_ioapic *ioapic, u8 id,
|
int acpi_create_madt_ioapic(struct acpi_madt_ioapic *ioapic, u8 id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue