[PATCH] lib: fwts_acpi_tables: fake table start address when loading from file.
Alex Hung
alex.hung at canonical.com
Mon Jun 11 10:35:23 UTC 2012
On 05/31/2012 09:12 PM, Colin King wrote:
> From: Colin Ian King<colin.king at canonical.com>
>
> Loading dumped ACPI tables from file is problematic because we have
> no idea of their original physical location. The current situation
> is that we fake their address to physical location zero, which means
> the table lookup against the RSDT or XSDT produced random first come
> first dumped hash table lookups since all the tables were at a fake
> address zero. The way around this is simple, it has already been solved
> for loading in tables from a raw ACPI dump file with null addresses - we
> just create ascending fake addresses using fwts_fake_physical_addr()
> for each table being loaded.
>
> Signed-off-by: Colin Ian King<colin.king at canonical.com>
> ---
> src/lib/src/fwts_acpi_tables.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index f09e94c..eabc2ea 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -469,7 +469,8 @@ static int fwts_acpi_load_tables_from_file(fwts_framework *fw)
> strcpy(name, direntry->d_name);
> name[strlen(name)-4] = '\0';
> if ((table = fwts_acpi_load_table_from_file(fd,&length)) != NULL)
> - fwts_acpi_add_table(name, table, (uint64_t)0, length);
> + fwts_acpi_add_table(name, table,
> + (uint64_t)fwts_fake_physical_addr(length), length);
> close(fd);
> } else
> fwts_log_error(fw, "Cannot load ACPI table from file '%s'\n", path);
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list