summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2023-09-01 11:27:10 -0600
committerBin Meng <[email protected]>2023-09-22 06:03:46 +0800
commitb95bc64b06a1ec1786d9c82d3041c63ca1b4e147 (patch)
tree75dec7434f83278c19127f53992e902d471b1488 /include
parent2e977b2ce8f63aee6a5197eeb2330da093af44a1 (diff)
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 <[email protected]> Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_table.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h
index 7ed0443c821..1f85de091d3 100644
--- a/include/acpi/acpi_table.h
+++ b/include/acpi/acpi_table.h
@@ -883,6 +883,13 @@ void acpi_inc_align(struct acpi_ctx *ctx, uint amount);
*/
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
*