diff options
author | Bob Moore <robert.moore@intel.com> | 2010-04-07 11:05:11 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-04-20 10:43:16 -0400 |
commit | 43323cb4c4b619414913f54fef9d492aabadd033 (patch) | |
tree | f5b434b93688972995eeed01ec86260f24311925 /drivers/acpi/acpica/tbutils.c | |
parent | 69ec87efa815d69140423014bb5f91e034faac22 (diff) | |
download | blackbird-op-linux-43323cb4c4b619414913f54fef9d492aabadd033.tar.gz blackbird-op-linux-43323cb4c4b619414913f54fef9d492aabadd033.zip |
ACPICA: Update DSDT copy/detection.
Move initialization of DSDT pointer. Emit address of DSDT
in the dump of both table headers (good/bad DSDT).
Now handles the case where the root table can be reallocated,
which would invalidate the original pointer.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/tbutils.c')
-rw-r--r-- | drivers/acpi/acpica/tbutils.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 1efb0940e8b2..54a8712bae62 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -366,22 +366,18 @@ void acpi_tb_check_dsdt_header(void) /* Compare original length and checksum to current values */ - if (acpi_gbl_original_dsdt_header.length != - acpi_gbl_DSDT->pointer->length - || acpi_gbl_original_dsdt_header.checksum != - acpi_gbl_DSDT->pointer->checksum) { + if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || + acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { ACPI_ERROR((AE_INFO, "The DSDT has been corrupted or replaced - old, new headers below")); acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); - acpi_tb_print_table_header(acpi_gbl_DSDT->address, - acpi_gbl_DSDT->pointer); + acpi_tb_print_table_header(0, acpi_gbl_DSDT); /* Disable further error messages */ - acpi_gbl_original_dsdt_header.length = - acpi_gbl_DSDT->pointer->length; + acpi_gbl_original_dsdt_header.length = acpi_gbl_DSDT->length; acpi_gbl_original_dsdt_header.checksum = - acpi_gbl_DSDT->pointer->checksum; + acpi_gbl_DSDT->checksum; } } @@ -399,15 +395,18 @@ void acpi_tb_check_dsdt_header(void) * ******************************************************************************/ -void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc) +struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) { struct acpi_table_header *new_table; + struct acpi_table_desc *table_desc; + + table_desc = &acpi_gbl_root_table_list.tables[table_index]; new_table = ACPI_ALLOCATE(table_desc->length); if (!new_table) { ACPI_ERROR((AE_INFO, "Could not copy DSDT of length 0x%X", table_desc->length)); - return; + return (NULL); } ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length); @@ -418,6 +417,8 @@ void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc) ACPI_INFO((AE_INFO, "Forced DSDT copy: length 0x%05X copied locally, original unmapped", new_table->length)); + + return (new_table); } /******************************************************************************* |