diff options
author | Bob Moore <robert.moore@intel.com> | 2015-12-29 13:54:51 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-01 03:47:34 +0100 |
commit | 675dfa0af8414958a11645eb53413f8e5af2f142 (patch) | |
tree | 39c254a19df32a86881d68793612f6dc707436d4 /drivers/acpi | |
parent | 5df2e3ed04862d9e6465b3b2748ef747d31c4bbc (diff) |
ACPICA: acpiexec: Add support for AML files containing multiple tables
ACPICA commit 301f16e4037275888f65b88aec7231c1cd64339f
Add support for multi-AML-table files that originate from
either acpixtract or iASL.
Link: https://github.com/acpica/acpica/commit/301f16e4
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/acutils.h | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/utfileio.c | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index 749542185781..5d3ae91a4152 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h @@ -356,6 +356,10 @@ acpi_ut_execute_power_methods(struct acpi_namespace_node *device_node, * utfileio - file operations */ #ifdef ACPI_APPLICATION + +acpi_status +acpi_ut_read_tables_from_file(FILE * file, struct acpi_table_header **table); + acpi_status acpi_ut_read_table_from_file(char *filename, struct acpi_table_header **table); #endif diff --git a/drivers/acpi/acpica/utfileio.c b/drivers/acpi/acpica/utfileio.c index be49c719f1f5..e72948606039 100644 --- a/drivers/acpi/acpica/utfileio.c +++ b/drivers/acpi/acpica/utfileio.c @@ -292,6 +292,29 @@ acpi_ut_read_table(FILE * fp, ******************************************************************************/ acpi_status +acpi_ut_read_tables_from_file(FILE * file, struct acpi_table_header ** table) +{ + struct acpi_table_header table_header; + s32 count; + long position; + + position = ftell(file); + count = fread(&table_header, 1, sizeof(struct acpi_table_header), file); + if (count < sizeof(struct acpi_table_header)) { + return (AE_CTRL_TERMINATE); + } + + /* Allocate a buffer for the table */ + + *table = acpi_os_allocate((size_t) table_header.length); + fseek(file, position, SEEK_SET); + + count = fread(*table, 1, table_header.length, file); + + return (AE_OK); +} + +acpi_status acpi_ut_read_table_from_file(char *filename, struct acpi_table_header ** table) { FILE *file; |