diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-05 19:41:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-05 19:41:06 -0400 |
commit | d1ce3bb95511dacf8b9eea899c421f1b18a3ef6a (patch) | |
tree | 40a9215d60f1bd11ba246d1884abb1e7533327e5 /tools/power | |
parent | 93d68841a23a5779cef6fb9aa0ef32e7c5bd00da (diff) | |
parent | 878a872ead5d178b1947b480990de186529ff0b9 (diff) |
Merge back new ACPICA material for v4.7.
Diffstat (limited to 'tools/power')
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 47 | ||||
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/osunixmap.c | 2 | ||||
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/osunixxf.c | 24 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/Makefile | 1 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apdump.c | 13 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apmain.c | 3 |
6 files changed, 49 insertions, 41 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c index d0e6b857d8d1..546cf4a503b7 100644 --- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | |||
@@ -91,7 +91,7 @@ osl_get_customized_table(char *pathname, | |||
91 | char *signature, | 91 | char *signature, |
92 | u32 instance, | 92 | u32 instance, |
93 | struct acpi_table_header **table, | 93 | struct acpi_table_header **table, |
94 | acpi_physical_address * address); | 94 | acpi_physical_address *address); |
95 | 95 | ||
96 | static acpi_status osl_list_bios_tables(void); | 96 | static acpi_status osl_list_bios_tables(void); |
97 | 97 | ||
@@ -99,7 +99,7 @@ static acpi_status | |||
99 | osl_get_bios_table(char *signature, | 99 | osl_get_bios_table(char *signature, |
100 | u32 instance, | 100 | u32 instance, |
101 | struct acpi_table_header **table, | 101 | struct acpi_table_header **table, |
102 | acpi_physical_address * address); | 102 | acpi_physical_address *address); |
103 | 103 | ||
104 | static acpi_status osl_get_last_status(acpi_status default_status); | 104 | static acpi_status osl_get_last_status(acpi_status default_status); |
105 | 105 | ||
@@ -187,7 +187,7 @@ static acpi_status osl_get_last_status(acpi_status default_status) | |||
187 | 187 | ||
188 | acpi_status | 188 | acpi_status |
189 | acpi_os_get_table_by_address(acpi_physical_address address, | 189 | acpi_os_get_table_by_address(acpi_physical_address address, |
190 | struct acpi_table_header ** table) | 190 | struct acpi_table_header **table) |
191 | { | 191 | { |
192 | u32 table_length; | 192 | u32 table_length; |
193 | struct acpi_table_header *mapped_table; | 193 | struct acpi_table_header *mapped_table; |
@@ -252,8 +252,8 @@ exit: | |||
252 | acpi_status | 252 | acpi_status |
253 | acpi_os_get_table_by_name(char *signature, | 253 | acpi_os_get_table_by_name(char *signature, |
254 | u32 instance, | 254 | u32 instance, |
255 | struct acpi_table_header ** table, | 255 | struct acpi_table_header **table, |
256 | acpi_physical_address * address) | 256 | acpi_physical_address *address) |
257 | { | 257 | { |
258 | acpi_status status; | 258 | acpi_status status; |
259 | 259 | ||
@@ -380,8 +380,8 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance) | |||
380 | 380 | ||
381 | acpi_status | 381 | acpi_status |
382 | acpi_os_get_table_by_index(u32 index, | 382 | acpi_os_get_table_by_index(u32 index, |
383 | struct acpi_table_header ** table, | 383 | struct acpi_table_header **table, |
384 | u32 *instance, acpi_physical_address * address) | 384 | u32 *instance, acpi_physical_address *address) |
385 | { | 385 | { |
386 | struct osl_table_info *info; | 386 | struct osl_table_info *info; |
387 | acpi_status status; | 387 | acpi_status status; |
@@ -447,7 +447,7 @@ osl_find_rsdp_via_efi_by_keyword(FILE * file, const char *keyword) | |||
447 | } | 447 | } |
448 | } | 448 | } |
449 | 449 | ||
450 | return ((acpi_physical_address) (address)); | 450 | return ((acpi_physical_address)(address)); |
451 | } | 451 | } |
452 | 452 | ||
453 | /****************************************************************************** | 453 | /****************************************************************************** |
@@ -751,10 +751,10 @@ static acpi_status osl_list_bios_tables(void) | |||
751 | for (i = 0; i < number_of_tables; ++i, table_data += item_size) { | 751 | for (i = 0; i < number_of_tables; ++i, table_data += item_size) { |
752 | if (osl_can_use_xsdt()) { | 752 | if (osl_can_use_xsdt()) { |
753 | table_address = | 753 | table_address = |
754 | (acpi_physical_address) (*ACPI_CAST64(table_data)); | 754 | (acpi_physical_address)(*ACPI_CAST64(table_data)); |
755 | } else { | 755 | } else { |
756 | table_address = | 756 | table_address = |
757 | (acpi_physical_address) (*ACPI_CAST32(table_data)); | 757 | (acpi_physical_address)(*ACPI_CAST32(table_data)); |
758 | } | 758 | } |
759 | 759 | ||
760 | /* Skip NULL entries in RSDT/XSDT */ | 760 | /* Skip NULL entries in RSDT/XSDT */ |
@@ -800,7 +800,7 @@ static acpi_status | |||
800 | osl_get_bios_table(char *signature, | 800 | osl_get_bios_table(char *signature, |
801 | u32 instance, | 801 | u32 instance, |
802 | struct acpi_table_header **table, | 802 | struct acpi_table_header **table, |
803 | acpi_physical_address * address) | 803 | acpi_physical_address *address) |
804 | { | 804 | { |
805 | struct acpi_table_header *local_table = NULL; | 805 | struct acpi_table_header *local_table = NULL; |
806 | struct acpi_table_header *mapped_table = NULL; | 806 | struct acpi_table_header *mapped_table = NULL; |
@@ -833,38 +833,37 @@ osl_get_bios_table(char *signature, | |||
833 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_XDSDT) && | 833 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_XDSDT) && |
834 | gbl_fadt->Xdsdt) { | 834 | gbl_fadt->Xdsdt) { |
835 | table_address = | 835 | table_address = |
836 | (acpi_physical_address) gbl_fadt->Xdsdt; | 836 | (acpi_physical_address)gbl_fadt->Xdsdt; |
837 | } else | 837 | } else |
838 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_DSDT) | 838 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_DSDT) |
839 | && gbl_fadt->dsdt) { | 839 | && gbl_fadt->dsdt) { |
840 | table_address = | 840 | table_address = |
841 | (acpi_physical_address) gbl_fadt->dsdt; | 841 | (acpi_physical_address)gbl_fadt->dsdt; |
842 | } | 842 | } |
843 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { | 843 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { |
844 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_XFACS) && | 844 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_XFACS) && |
845 | gbl_fadt->Xfacs) { | 845 | gbl_fadt->Xfacs) { |
846 | table_address = | 846 | table_address = |
847 | (acpi_physical_address) gbl_fadt->Xfacs; | 847 | (acpi_physical_address)gbl_fadt->Xfacs; |
848 | } else | 848 | } else |
849 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_FACS) | 849 | if ((gbl_fadt->header.length >= MIN_FADT_FOR_FACS) |
850 | && gbl_fadt->facs) { | 850 | && gbl_fadt->facs) { |
851 | table_address = | 851 | table_address = |
852 | (acpi_physical_address) gbl_fadt->facs; | 852 | (acpi_physical_address)gbl_fadt->facs; |
853 | } | 853 | } |
854 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { | 854 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { |
855 | if (!gbl_revision) { | 855 | if (!gbl_revision) { |
856 | return (AE_BAD_SIGNATURE); | 856 | return (AE_BAD_SIGNATURE); |
857 | } | 857 | } |
858 | table_address = | 858 | table_address = |
859 | (acpi_physical_address) gbl_rsdp. | 859 | (acpi_physical_address)gbl_rsdp. |
860 | xsdt_physical_address; | 860 | xsdt_physical_address; |
861 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) { | 861 | } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) { |
862 | table_address = | 862 | table_address = |
863 | (acpi_physical_address) gbl_rsdp. | 863 | (acpi_physical_address)gbl_rsdp. |
864 | rsdt_physical_address; | 864 | rsdt_physical_address; |
865 | } else { | 865 | } else { |
866 | table_address = | 866 | table_address = (acpi_physical_address)gbl_rsdp_address; |
867 | (acpi_physical_address) gbl_rsdp_address; | ||
868 | signature = ACPI_SIG_RSDP; | 867 | signature = ACPI_SIG_RSDP; |
869 | } | 868 | } |
870 | 869 | ||
@@ -904,12 +903,12 @@ osl_get_bios_table(char *signature, | |||
904 | for (i = 0; i < number_of_tables; ++i, table_data += item_size) { | 903 | for (i = 0; i < number_of_tables; ++i, table_data += item_size) { |
905 | if (osl_can_use_xsdt()) { | 904 | if (osl_can_use_xsdt()) { |
906 | table_address = | 905 | table_address = |
907 | (acpi_physical_address) (*ACPI_CAST64 | 906 | (acpi_physical_address)(*ACPI_CAST64 |
908 | (table_data)); | 907 | (table_data)); |
909 | } else { | 908 | } else { |
910 | table_address = | 909 | table_address = |
911 | (acpi_physical_address) (*ACPI_CAST32 | 910 | (acpi_physical_address)(*ACPI_CAST32 |
912 | (table_data)); | 911 | (table_data)); |
913 | } | 912 | } |
914 | 913 | ||
915 | /* Skip NULL entries in RSDT/XSDT */ | 914 | /* Skip NULL entries in RSDT/XSDT */ |
@@ -1301,7 +1300,7 @@ osl_get_customized_table(char *pathname, | |||
1301 | char *signature, | 1300 | char *signature, |
1302 | u32 instance, | 1301 | u32 instance, |
1303 | struct acpi_table_header **table, | 1302 | struct acpi_table_header **table, |
1304 | acpi_physical_address * address) | 1303 | acpi_physical_address *address) |
1305 | { | 1304 | { |
1306 | void *table_dir; | 1305 | void *table_dir; |
1307 | u32 current_instance = 0; | 1306 | u32 current_instance = 0; |
diff --git a/tools/power/acpi/os_specific/service_layers/osunixmap.c b/tools/power/acpi/os_specific/service_layers/osunixmap.c index 3818fd07e50f..cbfbce18783d 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixmap.c +++ b/tools/power/acpi/os_specific/service_layers/osunixmap.c | |||
@@ -54,7 +54,7 @@ ACPI_MODULE_NAME("osunixmap") | |||
54 | #ifndef O_BINARY | 54 | #ifndef O_BINARY |
55 | #define O_BINARY 0 | 55 | #define O_BINARY 0 |
56 | #endif | 56 | #endif |
57 | #if defined(_dragon_fly) || defined(_free_BSD) | 57 | #if defined(_dragon_fly) || defined(_free_BSD) || defined(_QNX) |
58 | #define MMAP_FLAGS MAP_SHARED | 58 | #define MMAP_FLAGS MAP_SHARED |
59 | #else | 59 | #else |
60 | #define MMAP_FLAGS MAP_PRIVATE | 60 | #define MMAP_FLAGS MAP_PRIVATE |
diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c index 08cb8b2035f2..88aa66ef4ad5 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixxf.c +++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c | |||
@@ -246,8 +246,8 @@ acpi_physical_address acpi_os_get_root_pointer(void) | |||
246 | *****************************************************************************/ | 246 | *****************************************************************************/ |
247 | 247 | ||
248 | acpi_status | 248 | acpi_status |
249 | acpi_os_predefined_override(const struct acpi_predefined_names * init_val, | 249 | acpi_os_predefined_override(const struct acpi_predefined_names *init_val, |
250 | acpi_string * new_val) | 250 | acpi_string *new_val) |
251 | { | 251 | { |
252 | 252 | ||
253 | if (!init_val || !new_val) { | 253 | if (!init_val || !new_val) { |
@@ -274,8 +274,8 @@ acpi_os_predefined_override(const struct acpi_predefined_names * init_val, | |||
274 | *****************************************************************************/ | 274 | *****************************************************************************/ |
275 | 275 | ||
276 | acpi_status | 276 | acpi_status |
277 | acpi_os_table_override(struct acpi_table_header * existing_table, | 277 | acpi_os_table_override(struct acpi_table_header *existing_table, |
278 | struct acpi_table_header ** new_table) | 278 | struct acpi_table_header **new_table) |
279 | { | 279 | { |
280 | 280 | ||
281 | if (!existing_table || !new_table) { | 281 | if (!existing_table || !new_table) { |
@@ -311,8 +311,8 @@ acpi_os_table_override(struct acpi_table_header * existing_table, | |||
311 | *****************************************************************************/ | 311 | *****************************************************************************/ |
312 | 312 | ||
313 | acpi_status | 313 | acpi_status |
314 | acpi_os_physical_table_override(struct acpi_table_header * existing_table, | 314 | acpi_os_physical_table_override(struct acpi_table_header *existing_table, |
315 | acpi_physical_address * new_address, | 315 | acpi_physical_address *new_address, |
316 | u32 *new_table_length) | 316 | u32 *new_table_length) |
317 | { | 317 | { |
318 | 318 | ||
@@ -506,7 +506,7 @@ acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read) | |||
506 | void *acpi_os_map_memory(acpi_physical_address where, acpi_size length) | 506 | void *acpi_os_map_memory(acpi_physical_address where, acpi_size length) |
507 | { | 507 | { |
508 | 508 | ||
509 | return (ACPI_TO_POINTER((acpi_size) where)); | 509 | return (ACPI_TO_POINTER((acpi_size)where)); |
510 | } | 510 | } |
511 | 511 | ||
512 | /****************************************************************************** | 512 | /****************************************************************************** |
@@ -603,9 +603,9 @@ void acpi_os_free(void *mem) | |||
603 | 603 | ||
604 | acpi_status | 604 | acpi_status |
605 | acpi_os_create_semaphore(u32 max_units, | 605 | acpi_os_create_semaphore(u32 max_units, |
606 | u32 initial_units, acpi_handle * out_handle) | 606 | u32 initial_units, acpi_handle *out_handle) |
607 | { | 607 | { |
608 | *out_handle = (acpi_handle) 1; | 608 | *out_handle = (acpi_handle)1; |
609 | return (AE_OK); | 609 | return (AE_OK); |
610 | } | 610 | } |
611 | 611 | ||
@@ -640,7 +640,7 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units) | |||
640 | 640 | ||
641 | acpi_status | 641 | acpi_status |
642 | acpi_os_create_semaphore(u32 max_units, | 642 | acpi_os_create_semaphore(u32 max_units, |
643 | u32 initial_units, acpi_handle * out_handle) | 643 | u32 initial_units, acpi_handle *out_handle) |
644 | { | 644 | { |
645 | sem_t *sem; | 645 | sem_t *sem; |
646 | 646 | ||
@@ -672,7 +672,7 @@ acpi_os_create_semaphore(u32 max_units, | |||
672 | } | 672 | } |
673 | #endif | 673 | #endif |
674 | 674 | ||
675 | *out_handle = (acpi_handle) sem; | 675 | *out_handle = (acpi_handle)sem; |
676 | return (AE_OK); | 676 | return (AE_OK); |
677 | } | 677 | } |
678 | 678 | ||
@@ -1035,7 +1035,7 @@ acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, | |||
1035 | *****************************************************************************/ | 1035 | *****************************************************************************/ |
1036 | 1036 | ||
1037 | acpi_status | 1037 | acpi_status |
1038 | acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, | 1038 | acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, |
1039 | u32 pci_register, u64 value, u32 width) | 1039 | u32 pci_register, u64 value, u32 width) |
1040 | { | 1040 | { |
1041 | 1041 | ||
diff --git a/tools/power/acpi/tools/acpidump/Makefile b/tools/power/acpi/tools/acpidump/Makefile index 8d761576e91b..2942cdced2ad 100644 --- a/tools/power/acpi/tools/acpidump/Makefile +++ b/tools/power/acpi/tools/acpidump/Makefile | |||
@@ -31,6 +31,7 @@ TOOL_OBJS = \ | |||
31 | osunixxf.o\ | 31 | osunixxf.o\ |
32 | tbprint.o\ | 32 | tbprint.o\ |
33 | tbxfroot.o\ | 33 | tbxfroot.o\ |
34 | utascii.o\ | ||
34 | utbuffer.o\ | 35 | utbuffer.o\ |
35 | utdebug.o\ | 36 | utdebug.o\ |
36 | utexcep.o\ | 37 | utexcep.o\ |
diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c index da44458d3b6c..fb8f1d9e3b1b 100644 --- a/tools/power/acpi/tools/acpidump/apdump.c +++ b/tools/power/acpi/tools/acpidump/apdump.c | |||
@@ -68,7 +68,7 @@ u8 ap_is_valid_header(struct acpi_table_header *table) | |||
68 | 68 | ||
69 | /* Make sure signature is all ASCII and a valid ACPI name */ | 69 | /* Make sure signature is all ASCII and a valid ACPI name */ |
70 | 70 | ||
71 | if (!acpi_ut_valid_acpi_name(table->signature)) { | 71 | if (!acpi_ut_valid_nameseg(table->signature)) { |
72 | acpi_log_error("Table signature (0x%8.8X) is invalid\n", | 72 | acpi_log_error("Table signature (0x%8.8X) is invalid\n", |
73 | *(u32 *)table->signature); | 73 | *(u32 *)table->signature); |
74 | return (FALSE); | 74 | return (FALSE); |
@@ -286,14 +286,15 @@ int ap_dump_table_by_address(char *ascii_address) | |||
286 | 286 | ||
287 | /* Convert argument to an integer physical address */ | 287 | /* Convert argument to an integer physical address */ |
288 | 288 | ||
289 | status = acpi_ut_strtoul64(ascii_address, 0, &long_address); | 289 | status = acpi_ut_strtoul64(ascii_address, ACPI_ANY_BASE, |
290 | ACPI_MAX64_BYTE_WIDTH, &long_address); | ||
290 | if (ACPI_FAILURE(status)) { | 291 | if (ACPI_FAILURE(status)) { |
291 | acpi_log_error("%s: Could not convert to a physical address\n", | 292 | acpi_log_error("%s: Could not convert to a physical address\n", |
292 | ascii_address); | 293 | ascii_address); |
293 | return (-1); | 294 | return (-1); |
294 | } | 295 | } |
295 | 296 | ||
296 | address = (acpi_physical_address) long_address; | 297 | address = (acpi_physical_address)long_address; |
297 | status = acpi_os_get_table_by_address(address, &table); | 298 | status = acpi_os_get_table_by_address(address, &table); |
298 | if (ACPI_FAILURE(status)) { | 299 | if (ACPI_FAILURE(status)) { |
299 | acpi_log_error("Could not get table at 0x%8.8X%8.8X, %s\n", | 300 | acpi_log_error("Could not get table at 0x%8.8X%8.8X, %s\n", |
@@ -406,6 +407,12 @@ int ap_dump_table_from_file(char *pathname) | |||
406 | return (-1); | 407 | return (-1); |
407 | } | 408 | } |
408 | 409 | ||
410 | if (!acpi_ut_valid_nameseg(table->signature)) { | ||
411 | acpi_log_error | ||
412 | ("No valid ACPI signature was found in input file %s\n", | ||
413 | pathname); | ||
414 | } | ||
415 | |||
409 | /* File must be at least as long as the table length */ | 416 | /* File must be at least as long as the table length */ |
410 | 417 | ||
411 | if (table->length > file_size) { | 418 | if (table->length > file_size) { |
diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c index c3c09152fac6..7692e6b887e1 100644 --- a/tools/power/acpi/tools/acpidump/apmain.c +++ b/tools/power/acpi/tools/acpidump/apmain.c | |||
@@ -209,7 +209,8 @@ static int ap_do_options(int argc, char **argv) | |||
209 | case 'r': /* Dump tables from specified RSDP */ | 209 | case 'r': /* Dump tables from specified RSDP */ |
210 | 210 | ||
211 | status = | 211 | status = |
212 | acpi_ut_strtoul64(acpi_gbl_optarg, 0, | 212 | acpi_ut_strtoul64(acpi_gbl_optarg, ACPI_ANY_BASE, |
213 | ACPI_MAX64_BYTE_WIDTH, | ||
213 | &gbl_rsdp_base); | 214 | &gbl_rsdp_base); |
214 | if (ACPI_FAILURE(status)) { | 215 | if (ACPI_FAILURE(status)) { |
215 | acpi_log_error | 216 | acpi_log_error |