diff options
author | Simon Glass | 2020-04-26 09:19:50 -0600 |
---|---|---|
committer | Bin Meng | 2020-04-30 17:16:12 +0800 |
commit | 29b351122ed23124f70473a411c65074d5a61146 (patch) | |
tree | 3291b96b1660fcc0fad1db917def8f2f14768370 /include/acpi/acpi_table.h | |
parent | 288edc78213433526e42cbc7c3dabca4fdf8e671 (diff) |
acpi: Move acpi_add_table() to generic code
Move this code to a generic location so that we can test it with sandbox.
This requires adding a few new fields to acpi_ctx, so drop the local
variables used in the original code.
Also use mapmem to avoid pointer-to-address casts which don't work on
sandbox.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Diffstat (limited to 'include/acpi/acpi_table.h')
-rw-r--r-- | include/acpi/acpi_table.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index 6fd4c5241a5..55349c0bb63 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -551,6 +551,15 @@ void acpi_inc(struct acpi_ctx *ctx, uint amount); */ void acpi_inc_align(struct acpi_ctx *ctx, uint amount); +/** + * acpi_add_table() - Add a new table to the RSDP and XSDT + * + * @ctx: ACPI context + * @table: Table to add + * @return 0 if OK, -E2BIG if too many tables + */ +int acpi_add_table(struct acpi_ctx *ctx, void *table); + #endif /* !__ACPI__*/ #include <asm/acpi_table.h> |