Commit 675dfa0a authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

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: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5df2e3ed
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+23 −0
Original line number Diff line number Diff line
@@ -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)
{