From 93f7f82782cb3d2bd55215ce984887efc6cddfed Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 26 Apr 2020 09:19:46 -0600 Subject: acpi: Add a method to write tables for a device A device may want to write out ACPI tables to describe itself to Linux. Add a method to permit this. Signed-off-by: Simon Glass Reviewed-by: Wolfgang Wallner --- lib/acpi/acpi_table.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c index 4633dcb9488..372f19b16d5 100644 --- a/lib/acpi/acpi_table.c +++ b/lib/acpi/acpi_table.c @@ -9,9 +9,8 @@ #include #include #include +#include -/* Temporary change to ensure bisectability */ -#ifndef CONFIG_SANDBOX int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags) { struct acpi_table_header *header = &dmar->header; @@ -37,7 +36,6 @@ int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags) return 0; } -#endif int acpi_get_table_revision(enum acpi_tables table) { @@ -91,3 +89,12 @@ int acpi_get_table_revision(enum acpi_tables table) return -EINVAL; } } + +void acpi_fill_header(struct acpi_table_header *header, char *signature) +{ + memcpy(header->signature, signature, 4); + memcpy(header->oem_id, OEM_ID, 6); + memcpy(header->oem_table_id, OEM_TABLE_ID, 8); + header->oem_revision = U_BOOT_BUILD_DATE; + memcpy(header->aslc_id, ASLC_ID, 4); +} -- cgit v1.3.1