mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 22:36:05 +00:00
x86: Prevent from missing the FADT chaining
Recent approach with FADT writer shows that there is a room for subtle errors. Prevent this from happening again by introducing acpi_add_fadt() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
2e977b2ce8
commit
b95bc64b06
5 changed files with 11 additions and 20 deletions
|
@ -158,11 +158,7 @@ static int apl_write_fadt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
|
||||||
header = &fadt->header;
|
header = &fadt->header;
|
||||||
header->checksum = table_compute_checksum(fadt, header->length);
|
header->checksum = table_compute_checksum(fadt, header->length);
|
||||||
|
|
||||||
acpi_add_table(ctx, fadt);
|
return acpi_add_fadt(ctx, fadt);
|
||||||
|
|
||||||
acpi_inc(ctx, sizeof(struct acpi_fadt));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
ACPI_WRITER(5fadt, "FADT", apl_write_fadt, 0);
|
ACPI_WRITER(5fadt, "FADT", apl_write_fadt, 0);
|
||||||
|
|
||||||
|
|
|
@ -142,11 +142,7 @@ static int baytrail_write_fadt(struct acpi_ctx *ctx,
|
||||||
|
|
||||||
header->checksum = table_compute_checksum(fadt, header->length);
|
header->checksum = table_compute_checksum(fadt, header->length);
|
||||||
|
|
||||||
acpi_add_table(ctx, fadt);
|
return acpi_add_fadt(ctx, fadt);
|
||||||
|
|
||||||
acpi_inc(ctx, sizeof(struct acpi_fadt));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
ACPI_WRITER(5fadt, "FADT", baytrail_write_fadt, 0);
|
ACPI_WRITER(5fadt, "FADT", baytrail_write_fadt, 0);
|
||||||
|
|
||||||
|
|
|
@ -137,11 +137,7 @@ static int quark_write_fadt(struct acpi_ctx *ctx,
|
||||||
|
|
||||||
header->checksum = table_compute_checksum(fadt, header->length);
|
header->checksum = table_compute_checksum(fadt, header->length);
|
||||||
|
|
||||||
acpi_add_table(ctx, fadt);
|
return acpi_add_fadt(ctx, fadt);
|
||||||
|
|
||||||
acpi_inc(ctx, sizeof(struct acpi_fadt));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
ACPI_WRITER(5fadt, "FADT", quark_write_fadt, 0);
|
ACPI_WRITER(5fadt, "FADT", quark_write_fadt, 0);
|
||||||
|
|
||||||
|
|
|
@ -52,11 +52,7 @@ static int tangier_write_fadt(struct acpi_ctx *ctx,
|
||||||
|
|
||||||
header->checksum = table_compute_checksum(fadt, header->length);
|
header->checksum = table_compute_checksum(fadt, header->length);
|
||||||
|
|
||||||
acpi_add_table(ctx, fadt);
|
return acpi_add_fadt(ctx, fadt);
|
||||||
|
|
||||||
acpi_inc(ctx, sizeof(struct acpi_fadt));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
ACPI_WRITER(5fadt, "FADT", tangier_write_fadt, 0);
|
ACPI_WRITER(5fadt, "FADT", tangier_write_fadt, 0);
|
||||||
|
|
||||||
|
|
|
@ -883,6 +883,13 @@ void acpi_inc_align(struct acpi_ctx *ctx, uint amount);
|
||||||
*/
|
*/
|
||||||
int acpi_add_table(struct acpi_ctx *ctx, void *table);
|
int acpi_add_table(struct acpi_ctx *ctx, void *table);
|
||||||
|
|
||||||
|
static inline int acpi_add_fadt(struct acpi_ctx *ctx, struct acpi_fadt *fadt)
|
||||||
|
{
|
||||||
|
acpi_add_table(ctx, fadt);
|
||||||
|
acpi_inc(ctx, sizeof(struct acpi_fadt));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* acpi_write_rsdp() - Write out an RSDP indicating where the ACPI tables are
|
* acpi_write_rsdp() - Write out an RSDP indicating where the ACPI tables are
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue