]> git.sur5r.net Git - u-boot/commitdiff
x86: acpi: Return table length in acpi_create_madt_lapics()
authorBin Meng <bmeng.cn@gmail.com>
Sat, 7 May 2016 14:46:30 +0000 (07:46 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 23 May 2016 07:18:00 +0000 (15:18 +0800)
Like other MADT table write routines, make acpi_create_madt_lapics()
return how many bytes it has written instead of the table end addr.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/x86/include/asm/acpi_table.h
arch/x86/lib/acpi_table.c

index b450c439802b3f486e9be5603ba00ca5dc4fe3c0..ff4802ac15c4653bb3e850ac841137f805f1bd91 100644 (file)
@@ -301,7 +301,7 @@ struct acpi_mcfg_mmconfig {
 void acpi_fill_header(struct acpi_table_header *header, char *signature);
 void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
                      void *dsdt);
-u32 acpi_create_madt_lapics(u32 current);
+int acpi_create_madt_lapics(u32 current);
 int acpi_create_madt_ioapic(struct acpi_madt_ioapic *ioapic, u8 id,
                            u32 addr, u32 gsi_base);
 int acpi_create_madt_irqoverride(struct acpi_madt_irqoverride *irqoverride,
index 8fef9b84afe4ed19a787ed4d490f37cbb0d06c81..989cf7d5de0f3a3f1ef7410f35ca8ffffb8b79ee 100644 (file)
@@ -179,21 +179,23 @@ static int acpi_create_madt_lapic(struct acpi_madt_lapic *lapic,
        return lapic->length;
 }
 
-u32 acpi_create_madt_lapics(u32 current)
+int acpi_create_madt_lapics(u32 current)
 {
        struct udevice *dev;
+       int length = 0;
 
        for (uclass_find_first_device(UCLASS_CPU, &dev);
             dev;
             uclass_find_next_device(&dev)) {
                struct cpu_platdata *plat = dev_get_parent_platdata(dev);
 
-               current += acpi_create_madt_lapic(
+               length += acpi_create_madt_lapic(
                        (struct acpi_madt_lapic *)current,
                        plat->cpu_id, plat->cpu_id);
+               current += length;
        }
 
-       return current;
+       return length;
 }
 
 int acpi_create_madt_ioapic(struct acpi_madt_ioapic *ioapic, u8 id,