diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-09-03 17:53:05 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-09-03 17:53:05 -0400 |
commit | b2a84eedca1b827c6e513a8139e47b394f2d988d (patch) | |
tree | e6f9d1d1ebaa46378976a4dbee3670978b554449 /tools | |
parent | 569dbb88e80deb68974ef6fdd6a13edb9d686261 (diff) | |
parent | 4a9673dd50c2362f5bd2d03c89099267b49d400a (diff) |
Merge branch 'acpica'
* acpica: (32 commits)
ACPICA: Update version to 20170728
ACPICA: Revert "Update resource descriptor handling"
ACPICA: Resources: Allow _DMA method in walk resources
ACPICA: Ensure all instances of AE_AML_INTERNAL have error messages
ACPICA: Implement deferred resolution of reference package elements
ACPICA: Debugger: Improve support for Alias objects
ACPICA: Interpreter: Update handling for Alias operator
ACPICA: EFI/EDK2: Cleanup to enable /WX for MSVC builds
ACPICA: acpidump: Add DSDT/FACS instance support for Linux and EFI
ACPICA: CLib: Add short multiply/shift support
ACPICA: EFI/EDK2: Sort acpi.h inclusion order
ACPICA: Add a comment, no functional change
ACPICA: Namespace: Update/fix an error message
ACPICA: iASL: Add support for the SDEI table
ACPICA: Divergences: reduce access size definitions
ACPICA: Update version to 20170629
ACPICA: Update resource descriptor handling
ACPICA: iasl: Update to IORT SMMUv3 disassembling
ACPICA: Disassembler: skip parsing of incorrect external declarations
ACPICA: iASL: Ensure that the target node is valid in acpi_ex_create_alias
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 105 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apfiles.c | 2 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apmain.c | 2 |
3 files changed, 75 insertions, 34 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c index 82a2ff896a95..52a39ecf5ca1 100644 --- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | |||
@@ -759,7 +759,7 @@ static acpi_status osl_list_bios_tables(void) | |||
759 | 759 | ||
760 | /* Skip NULL entries in RSDT/XSDT */ | 760 | /* Skip NULL entries in RSDT/XSDT */ |
761 | 761 | ||
762 | if (!table_address) { | 762 | if (table_address == 0) { |
763 | continue; | 763 | continue; |
764 | } | 764 | } |
765 | 765 | ||
@@ -808,7 +808,8 @@ osl_get_bios_table(char *signature, | |||
808 | u8 number_of_tables; | 808 | u8 number_of_tables; |
809 | u8 item_size; | 809 | u8 item_size; |
810 | u32 current_instance = 0; | 810 | u32 current_instance = 0; |
811 | acpi_physical_address table_address = 0; | 811 | acpi_physical_address table_address; |
812 | acpi_physical_address first_table_address = 0; | ||
812 | u32 table_length = 0; | 813 | u32 table_length = 0; |
813 | acpi_status status = AE_OK; | 814 | acpi_status status = AE_OK; |
814 | u32 i; | 815 | u32 i; |
@@ -820,9 +821,10 @@ osl_get_bios_table(char *signature, | |||
820 | ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT) || | 821 | ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT) || |
821 | ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT) || | 822 | ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT) || |
822 | ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { | 823 | ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { |
823 | if (instance > 0) { | 824 | |
824 | return (AE_LIMIT); | 825 | find_next_instance: |
825 | } | 826 | |
827 | table_address = 0; | ||
826 | 828 | ||
827 | /* | 829 | /* |
828 | * Get the appropriate address, either 32-bit or 64-bit. Be very | 830 | * Get the appropriate address, either 32-bit or 64-bit. Be very |
@@ -830,41 +832,66 @@ osl_get_bios_table(char *signature, | |||
830 | * Note: The 64-bit addresses have priority. | 832 | * Note: The 64-bit addresses have priority. |
831 | */ | 833 | */ |
832 | if (ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT)) { | 834 | if (ACPI_COMPARE_NAME(signature, ACPI_SIG_DSDT)) { |
833 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_XDSDT) && | 835 | if (current_instance < 2) { |
834 | gbl_fadt->Xdsdt) { | 836 | if ((gbl_fadt->header.length >= |
835 | table_address = | 837 | MIN_FADT_FOR_XDSDT) && gbl_fadt->Xdsdt |
836 | (acpi_physical_address)gbl_fadt->Xdsdt; | 838 | && current_instance == 0) { |
837 | } else | 839 | table_address = |
838 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_DSDT) | 840 | (acpi_physical_address)gbl_fadt-> |
839 | && gbl_fadt->dsdt) { | 841 | Xdsdt; |
840 | table_address = | 842 | } else |
841 | (acpi_physical_address)gbl_fadt->dsdt; | 843 | if ((gbl_fadt->header.length >= |
844 | MIN_FADT_FOR_DSDT) | ||
845 | && gbl_fadt->dsdt != | ||
846 | first_table_address) { | ||
847 | table_address = | ||
848 | (acpi_physical_address)gbl_fadt-> | ||
849 | dsdt; | ||
850 | } | ||
842 | } | 851 | } |
843 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { | 852 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { |
844 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_XFACS) && | 853 | if (current_instance < 2) { |
845 | gbl_fadt->Xfacs) { | 854 | if ((gbl_fadt->header.length >= |
846 | table_address = | 855 | MIN_FADT_FOR_XFACS) && gbl_fadt->Xfacs |
847 | (acpi_physical_address)gbl_fadt->Xfacs; | 856 | && current_instance == 0) { |
848 | } else | 857 | table_address = |
849 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_FACS) | 858 | (acpi_physical_address)gbl_fadt-> |
850 | && gbl_fadt->facs) { | 859 | Xfacs; |
851 | table_address = | 860 | } else |
852 | (acpi_physical_address)gbl_fadt->facs; | 861 | if ((gbl_fadt->header.length >= |
862 | MIN_FADT_FOR_FACS) | ||
863 | && gbl_fadt->facs != | ||
864 | first_table_address) { | ||
865 | table_address = | ||
866 | (acpi_physical_address)gbl_fadt-> | ||
867 | facs; | ||
868 | } | ||
853 | } | 869 | } |
854 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { | 870 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { |
855 | if (!gbl_revision) { | 871 | if (!gbl_revision) { |
856 | return (AE_BAD_SIGNATURE); | 872 | return (AE_BAD_SIGNATURE); |
857 | } | 873 | } |
858 | table_address = | 874 | if (current_instance == 0) { |
859 | (acpi_physical_address)gbl_rsdp. | 875 | table_address = |
860 | xsdt_physical_address; | 876 | (acpi_physical_address)gbl_rsdp. |
877 | xsdt_physical_address; | ||
878 | } | ||
861 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) { | 879 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) { |
862 | table_address = | 880 | if (current_instance == 0) { |
863 | (acpi_physical_address)gbl_rsdp. | 881 | table_address = |
864 | rsdt_physical_address; | 882 | (acpi_physical_address)gbl_rsdp. |
883 | rsdt_physical_address; | ||
884 | } | ||
865 | } else { | 885 | } else { |
866 | table_address = (acpi_physical_address)gbl_rsdp_address; | 886 | if (current_instance == 0) { |
867 | signature = ACPI_SIG_RSDP; | 887 | table_address = |
888 | (acpi_physical_address)gbl_rsdp_address; | ||
889 | signature = ACPI_SIG_RSDP; | ||
890 | } | ||
891 | } | ||
892 | |||
893 | if (table_address == 0) { | ||
894 | goto exit_find_table; | ||
868 | } | 895 | } |
869 | 896 | ||
870 | /* Now we can get the requested special table */ | 897 | /* Now we can get the requested special table */ |
@@ -875,6 +902,18 @@ osl_get_bios_table(char *signature, | |||
875 | } | 902 | } |
876 | 903 | ||
877 | table_length = ap_get_table_length(mapped_table); | 904 | table_length = ap_get_table_length(mapped_table); |
905 | if (first_table_address == 0) { | ||
906 | first_table_address = table_address; | ||
907 | } | ||
908 | |||
909 | /* Match table instance */ | ||
910 | |||
911 | if (current_instance != instance) { | ||
912 | osl_unmap_table(mapped_table); | ||
913 | mapped_table = NULL; | ||
914 | current_instance++; | ||
915 | goto find_next_instance; | ||
916 | } | ||
878 | } else { /* Case for a normal ACPI table */ | 917 | } else { /* Case for a normal ACPI table */ |
879 | 918 | ||
880 | if (osl_can_use_xsdt()) { | 919 | if (osl_can_use_xsdt()) { |
@@ -913,7 +952,7 @@ osl_get_bios_table(char *signature, | |||
913 | 952 | ||
914 | /* Skip NULL entries in RSDT/XSDT */ | 953 | /* Skip NULL entries in RSDT/XSDT */ |
915 | 954 | ||
916 | if (!table_address) { | 955 | if (table_address == 0) { |
917 | continue; | 956 | continue; |
918 | } | 957 | } |
919 | 958 | ||
@@ -946,6 +985,8 @@ osl_get_bios_table(char *signature, | |||
946 | } | 985 | } |
947 | } | 986 | } |
948 | 987 | ||
988 | exit_find_table: | ||
989 | |||
949 | if (!mapped_table) { | 990 | if (!mapped_table) { |
950 | return (AE_LIMIT); | 991 | return (AE_LIMIT); |
951 | } | 992 | } |
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c index 31b5a7f74015..d686e11936c4 100644 --- a/tools/power/acpi/tools/acpidump/apfiles.c +++ b/tools/power/acpi/tools/acpidump/apfiles.c | |||
@@ -61,7 +61,7 @@ static int ap_is_existing_file(char *pathname); | |||
61 | 61 | ||
62 | static int ap_is_existing_file(char *pathname) | 62 | static int ap_is_existing_file(char *pathname) |
63 | { | 63 | { |
64 | #ifndef _GNU_EFI | 64 | #if !defined(_GNU_EFI) && !defined(_EDK2_EFI) |
65 | struct stat stat_info; | 65 | struct stat stat_info; |
66 | 66 | ||
67 | if (!stat(pathname, &stat_info)) { | 67 | if (!stat(pathname, &stat_info)) { |
diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c index dd82afa897bd..943b6b614683 100644 --- a/tools/power/acpi/tools/acpidump/apmain.c +++ b/tools/power/acpi/tools/acpidump/apmain.c | |||
@@ -300,7 +300,7 @@ static int ap_do_options(int argc, char **argv) | |||
300 | * | 300 | * |
301 | ******************************************************************************/ | 301 | ******************************************************************************/ |
302 | 302 | ||
303 | #ifndef _GNU_EFI | 303 | #if !defined(_GNU_EFI) && !defined(_EDK2_EFI) |
304 | int ACPI_SYSTEM_XFACE main(int argc, char *argv[]) | 304 | int ACPI_SYSTEM_XFACE main(int argc, char *argv[]) |
305 | #else | 305 | #else |
306 | int ACPI_SYSTEM_XFACE acpi_main(int argc, char *argv[]) | 306 | int ACPI_SYSTEM_XFACE acpi_main(int argc, char *argv[]) |