diff options
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) | |||
366 | 366 | ||
367 | /* Compare original length and checksum to current values */ | 367 | /* Compare original length and checksum to current values */ |
368 | 368 | ||
369 | if (acpi_gbl_original_dsdt_header.length != | 369 | if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || |
370 | acpi_gbl_DSDT->pointer->length | 370 | acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { |
371 | || acpi_gbl_original_dsdt_header.checksum != | ||
372 | acpi_gbl_DSDT->pointer->checksum) { | ||
373 | ACPI_ERROR((AE_INFO, | 371 | ACPI_ERROR((AE_INFO, |
374 | "The DSDT has been corrupted or replaced - old, new headers below")); | 372 | "The DSDT has been corrupted or replaced - old, new headers below")); |
375 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); | 373 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); |
376 | acpi_tb_print_table_header(acpi_gbl_DSDT->address, | 374 | acpi_tb_print_table_header(0, acpi_gbl_DSDT); |
377 | acpi_gbl_DSDT->pointer); | ||
378 | 375 | ||
379 | /* Disable further error messages */ | 376 | /* Disable further error messages */ |
380 | 377 | ||
381 | acpi_gbl_original_dsdt_header.length = | 378 | acpi_gbl_original_dsdt_header.length = acpi_gbl_DSDT->length; |
382 | acpi_gbl_DSDT->pointer->length; | ||
383 | acpi_gbl_original_dsdt_header.checksum = | 379 | acpi_gbl_original_dsdt_header.checksum = |
384 | acpi_gbl_DSDT->pointer->checksum; | 380 | acpi_gbl_DSDT->checksum; |
385 | } | 381 | } |
386 | } | 382 | } |
387 | 383 | ||
@@ -399,15 +395,18 @@ void acpi_tb_check_dsdt_header(void) | |||
399 | * | 395 | * |
400 | ******************************************************************************/ | 396 | ******************************************************************************/ |
401 | 397 | ||
402 | void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc) | 398 | struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) |
403 | { | 399 | { |
404 | struct acpi_table_header *new_table; | 400 | struct acpi_table_header *new_table; |
401 | struct acpi_table_desc *table_desc; | ||
402 | |||
403 | table_desc = &acpi_gbl_root_table_list.tables[table_index]; | ||
405 | 404 | ||
406 | new_table = ACPI_ALLOCATE(table_desc->length); | 405 | new_table = ACPI_ALLOCATE(table_desc->length); |
407 | if (!new_table) { | 406 | if (!new_table) { |
408 | ACPI_ERROR((AE_INFO, "Could not copy DSDT of length 0x%X", | 407 | ACPI_ERROR((AE_INFO, "Could not copy DSDT of length 0x%X", |
409 | table_desc->length)); | 408 | table_desc->length)); |
410 | return; | 409 | return (NULL); |
411 | } | 410 | } |
412 | 411 | ||
413 | ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length); | 412 | 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) | |||
418 | ACPI_INFO((AE_INFO, | 417 | ACPI_INFO((AE_INFO, |
419 | "Forced DSDT copy: length 0x%05X copied locally, original unmapped", | 418 | "Forced DSDT copy: length 0x%05X copied locally, original unmapped", |
420 | new_table->length)); | 419 | new_table->length)); |
420 | |||
421 | return (new_table); | ||
421 | } | 422 | } |
422 | 423 | ||
423 | /******************************************************************************* | 424 | /******************************************************************************* |