diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-07-01 02:44:52 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-07-01 17:17:55 -0400 |
commit | 428394dfdfc4596110269873cf5a2e7d82b2422e (patch) | |
tree | 579df7b3252c6a6b613c7adb9ee00b0515126176 | |
parent | fde175e385fc28c31a50be2608113689449a4b75 (diff) |
ACPICA: acpidump: Allow customized tables to be dumped without accessing /dev/mem
ACPICA commit ab29013cfa2424140446aff196a70b211ab343a9
The /dev/mem can be configured out, in which case, acpidump should still
work with "-c" option as tables can be found in /sys/firmware/acpi/tables.
This patch allows acpidump to work without /dev/mem.
This patch has been tested with "acpidump -c" and "acpidump -c -n FADT".
And it worked as expected. Lv Zheng.
Link: https://github.com/acpica/acpica/commit/ab29013c
Reported-by: Al Stone <ahs3@redhat.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c index db15c9d2049e..3aff9a2c7088 100644 --- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | |||
@@ -582,64 +582,67 @@ static acpi_status osl_table_initialize(void) | |||
582 | return (AE_OK); | 582 | return (AE_OK); |
583 | } | 583 | } |
584 | 584 | ||
585 | /* Get RSDP from memory */ | 585 | if (!gbl_dump_customized_tables) { |
586 | 586 | ||
587 | status = osl_load_rsdp(); | 587 | /* Get RSDP from memory */ |
588 | if (ACPI_FAILURE(status)) { | 588 | |
589 | return (status); | 589 | status = osl_load_rsdp(); |
590 | } | 590 | if (ACPI_FAILURE(status)) { |
591 | return (status); | ||
592 | } | ||
591 | 593 | ||
592 | /* Get XSDT from memory */ | 594 | /* Get XSDT from memory */ |
593 | 595 | ||
594 | if (gbl_rsdp.revision && !gbl_do_not_dump_xsdt) { | 596 | if (gbl_rsdp.revision && !gbl_do_not_dump_xsdt) { |
595 | if (gbl_xsdt) { | 597 | if (gbl_xsdt) { |
596 | free(gbl_xsdt); | 598 | free(gbl_xsdt); |
597 | gbl_xsdt = NULL; | 599 | gbl_xsdt = NULL; |
600 | } | ||
601 | |||
602 | gbl_revision = 2; | ||
603 | status = osl_get_bios_table(ACPI_SIG_XSDT, 0, | ||
604 | ACPI_CAST_PTR(struct | ||
605 | acpi_table_header | ||
606 | *, &gbl_xsdt), | ||
607 | &address); | ||
608 | if (ACPI_FAILURE(status)) { | ||
609 | return (status); | ||
610 | } | ||
598 | } | 611 | } |
599 | 612 | ||
600 | gbl_revision = 2; | 613 | /* Get RSDT from memory */ |
601 | status = osl_get_bios_table(ACPI_SIG_XSDT, 0, | 614 | |
602 | ACPI_CAST_PTR(struct | 615 | if (gbl_rsdp.rsdt_physical_address) { |
603 | acpi_table_header *, | 616 | if (gbl_rsdt) { |
604 | &gbl_xsdt), &address); | 617 | free(gbl_rsdt); |
605 | if (ACPI_FAILURE(status)) { | 618 | gbl_rsdt = NULL; |
606 | return (status); | 619 | } |
620 | |||
621 | status = osl_get_bios_table(ACPI_SIG_RSDT, 0, | ||
622 | ACPI_CAST_PTR(struct | ||
623 | acpi_table_header | ||
624 | *, &gbl_rsdt), | ||
625 | &address); | ||
626 | if (ACPI_FAILURE(status)) { | ||
627 | return (status); | ||
628 | } | ||
607 | } | 629 | } |
608 | } | ||
609 | 630 | ||
610 | /* Get RSDT from memory */ | 631 | /* Get FADT from memory */ |
611 | 632 | ||
612 | if (gbl_rsdp.rsdt_physical_address) { | 633 | if (gbl_fadt) { |
613 | if (gbl_rsdt) { | 634 | free(gbl_fadt); |
614 | free(gbl_rsdt); | 635 | gbl_fadt = NULL; |
615 | gbl_rsdt = NULL; | ||
616 | } | 636 | } |
617 | 637 | ||
618 | status = osl_get_bios_table(ACPI_SIG_RSDT, 0, | 638 | status = osl_get_bios_table(ACPI_SIG_FADT, 0, |
619 | ACPI_CAST_PTR(struct | 639 | ACPI_CAST_PTR(struct |
620 | acpi_table_header *, | 640 | acpi_table_header *, |
621 | &gbl_rsdt), &address); | 641 | &gbl_fadt), |
642 | &gbl_fadt_address); | ||
622 | if (ACPI_FAILURE(status)) { | 643 | if (ACPI_FAILURE(status)) { |
623 | return (status); | 644 | return (status); |
624 | } | 645 | } |
625 | } | ||
626 | |||
627 | /* Get FADT from memory */ | ||
628 | |||
629 | if (gbl_fadt) { | ||
630 | free(gbl_fadt); | ||
631 | gbl_fadt = NULL; | ||
632 | } | ||
633 | |||
634 | status = osl_get_bios_table(ACPI_SIG_FADT, 0, | ||
635 | ACPI_CAST_PTR(struct acpi_table_header *, | ||
636 | &gbl_fadt), | ||
637 | &gbl_fadt_address); | ||
638 | if (ACPI_FAILURE(status)) { | ||
639 | return (status); | ||
640 | } | ||
641 | |||
642 | if (!gbl_dump_customized_tables) { | ||
643 | 646 | ||
644 | /* Add mandatory tables to global table list first */ | 647 | /* Add mandatory tables to global table list first */ |
645 | 648 | ||