Skip to content

Commit

Permalink
ACPICA: acpiexec: Add support for AML files containing multiple tables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Moore authored and Rafael J. Wysocki committed Jan 1, 2016
1 parent 5df2e3e commit 675dfa0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions drivers/acpi/acpica/utfileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,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)
{
Expand Down

0 comments on commit 675dfa0

Please sign in to comment.