summaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-02 20:11:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-02 20:11:28 -0400
commit9bdc771f2c29a11920f477fba05a58e23ee42554 (patch)
tree20618d7de423f135316cda776a91e4313aa6c029 /tools/power
parent7df9ab845ce5f473c84184873bf5be08bbe8fda5 (diff)
parentea7d521569a70418aa9f6309a1d1916709818b62 (diff)
Merge tag 'acpica-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPICA updates from Rafael Wysocki: "Additional ACPICA material for v4.2-rc1 This will update the ACPICA code in the kernel to upstream revision 20150619 (a bug-fix release mostly including stable-candidate fixes) and restore an earlier ACPICA commit that had to be reverted due to a regression introduced by it (the regression is addressed by blacklisting the only known system affected by it to date). The only new feature added by this update is the support for overriding objects in the ACPI namespace and a new ACPI table that can be used for that called the Override System Definition Table (OSDT). That should allow us to "patch" the ACPI namespace built from incomplete or incorrect ACPI System Definition tables (DSDT, SSDT) during system startup without the need to provide replacements for all of those tables in the future. Specifics: - Fix system resume problems related to 32-bit and 64-bit versions of the Firmware ACPI Control Structure (FACS) in the firmare (Lv Zheng) - Fix double initialization of the FACS (Lv Zheng) - Add _CLS object processing code to ACPICA (Suravee Suthikulpanit) - Add support for the (currently missing) new GIC version field in the Multiple APIC Description Table (MADT) (Hanjun Guo) - Add support for overriding objects in the ACPI namespace to ACPICA and OSDT support (Lv Zheng, Bob Moore, Zhang Rui) - Updates related to the TCPA and TPM2 ACPI tables (Bob Moore) - Restore the commit modifying _REV to always return "2" (as required by ACPI 6) and add a blacklisting mechanism for systems that may be affected by that change (Rafael J Wysocki) - Assorted fixes and cleanups (Bob Moore, Lv Zheng, Sascha Wildner)" * tag 'acpica-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (28 commits) Revert 'Revert "ACPICA: Permanently set _REV to the value '2'."' ACPI / init: Make it possible to override _REV ACPICA: Update version to 20150619 ACPICA: Comment update, no functional change ACPICA: Update TPM2 ACPI table ACPICA: Update definitions for the TCPA and TPM2 ACPI tables ACPICA: Split C library prototypes to new header ACPICA: De-macroize calls to standard C library functions ACPI / acpidump: Update acpidump manual ACPICA: acpidump: Convert the default behavior to dump from /sys/firmware/acpi/tables ACPICA: acpidump: Allow customized tables to be dumped without accessing /dev/mem ACPICA: Cleanup output for the ASL Debug object ACPICA: Update for acpi_install_table memory types ACPICA: Namespace: Change namespace override to avoid node deletion ACPICA: Namespace: Add support of OSDT table ACPICA: Namespace: Add support to allow overriding objects ACPICA: ACPI 6.0: Add values for MADT GIC version field ACPICA: Utilities: Add _CLS processing ACPICA: Add dragon_fly support to unix file mapping file ACPICA: EFI: Add EFI interface definitions to eliminate dependency of GNU EFI ...
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/acpi/common/getopt.c4
-rw-r--r--tools/power/acpi/man/acpidump.817
-rw-r--r--tools/power/acpi/os_specific/service_layers/oslinuxtbl.c95
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixmap.c2
-rw-r--r--tools/power/acpi/tools/acpidump/acpidump.h2
-rw-r--r--tools/power/acpi/tools/acpidump/apdump.c8
-rw-r--r--tools/power/acpi/tools/acpidump/apfiles.c12
-rw-r--r--tools/power/acpi/tools/acpidump/apmain.c15
8 files changed, 87 insertions, 68 deletions
diff --git a/tools/power/acpi/common/getopt.c b/tools/power/acpi/common/getopt.c
index 5da129e10aa2..326e826a5d20 100644
--- a/tools/power/acpi/common/getopt.c
+++ b/tools/power/acpi/common/getopt.c
@@ -127,7 +127,7 @@ int acpi_getopt(int argc, char **argv, char *opts)
127 argv[acpi_gbl_optind][0] != '-' || 127 argv[acpi_gbl_optind][0] != '-' ||
128 argv[acpi_gbl_optind][1] == '\0') { 128 argv[acpi_gbl_optind][1] == '\0') {
129 return (ACPI_OPT_END); 129 return (ACPI_OPT_END);
130 } else if (ACPI_STRCMP(argv[acpi_gbl_optind], "--") == 0) { 130 } else if (strcmp(argv[acpi_gbl_optind], "--") == 0) {
131 acpi_gbl_optind++; 131 acpi_gbl_optind++;
132 return (ACPI_OPT_END); 132 return (ACPI_OPT_END);
133 } 133 }
@@ -140,7 +140,7 @@ int acpi_getopt(int argc, char **argv, char *opts)
140 /* Make sure that the option is legal */ 140 /* Make sure that the option is legal */
141 141
142 if (current_char == ':' || 142 if (current_char == ':' ||
143 (opts_ptr = ACPI_STRCHR(opts, current_char)) == NULL) { 143 (opts_ptr = strchr(opts, current_char)) == NULL) {
144 ACPI_OPTION_ERROR("Illegal option: -", current_char); 144 ACPI_OPTION_ERROR("Illegal option: -", current_char);
145 145
146 if (argv[acpi_gbl_optind][++current_char_ptr] == '\0') { 146 if (argv[acpi_gbl_optind][++current_char_ptr] == '\0') {
diff --git a/tools/power/acpi/man/acpidump.8 b/tools/power/acpi/man/acpidump.8
index 38f095d86b52..79e2d1d435d1 100644
--- a/tools/power/acpi/man/acpidump.8
+++ b/tools/power/acpi/man/acpidump.8
@@ -22,9 +22,6 @@ acpidump options are as follow:
22.B \-b 22.B \-b
23Dump tables to binary files 23Dump tables to binary files
24.TP 24.TP
25.B \-c
26Dump customized tables
27.TP
28.B \-h \-? 25.B \-h \-?
29This help message 26This help message
30.TP 27.TP
@@ -48,15 +45,25 @@ Verbose mode
48.B \-a <Address> 45.B \-a <Address>
49Get table via a physical address 46Get table via a physical address
50.TP 47.TP
48.B \-c <on|off>
49Turning on/off customized table dumping
50.TP
51.B \-f <BinaryFile> 51.B \-f <BinaryFile>
52Get table via a binary file 52Get table via a binary file
53.TP 53.TP
54.B \-n <Signature> 54.B \-n <Signature>
55Get table via a name/signature 55Get table via a name/signature
56.TP 56.TP
57Invocation without parameters dumps all available tables 57.B \-x
58Do not use but dump XSDT
59.TP
60.B \-x \-x
61Do not use or dump XSDT
62.TP
63.fi
64Invocation without parameters dumps all available tables.
58.TP 65.TP
59Multiple mixed instances of -a, -f, and -n are supported 66Multiple mixed instances of -a, -f, and -n are supported.
60 67
61.SH EXAMPLES 68.SH EXAMPLES
62 69
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
index db15c9d2049e..dd5008b0617a 100644
--- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
+++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
@@ -222,7 +222,7 @@ acpi_os_get_table_by_address(acpi_physical_address address,
222 goto exit; 222 goto exit;
223 } 223 }
224 224
225 ACPI_MEMCPY(local_table, mapped_table, table_length); 225 memcpy(local_table, mapped_table, table_length);
226 226
227exit: 227exit:
228 osl_unmap_table(mapped_table); 228 osl_unmap_table(mapped_table);
@@ -531,7 +531,7 @@ static acpi_status osl_load_rsdp(void)
531 gbl_rsdp_address = 531 gbl_rsdp_address =
532 rsdp_base + (ACPI_CAST8(mapped_table) - rsdp_address); 532 rsdp_base + (ACPI_CAST8(mapped_table) - rsdp_address);
533 533
534 ACPI_MEMCPY(&gbl_rsdp, mapped_table, sizeof(struct acpi_table_rsdp)); 534 memcpy(&gbl_rsdp, mapped_table, sizeof(struct acpi_table_rsdp));
535 acpi_os_unmap_memory(rsdp_address, rsdp_size); 535 acpi_os_unmap_memory(rsdp_address, rsdp_size);
536 536
537 return (AE_OK); 537 return (AE_OK);
@@ -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
@@ -961,7 +964,7 @@ osl_get_bios_table(char *signature,
961 goto exit; 964 goto exit;
962 } 965 }
963 966
964 ACPI_MEMCPY(local_table, mapped_table, table_length); 967 memcpy(local_table, mapped_table, table_length);
965 *address = table_address; 968 *address = table_address;
966 *table = local_table; 969 *table = local_table;
967 970
diff --git a/tools/power/acpi/os_specific/service_layers/osunixmap.c b/tools/power/acpi/os_specific/service_layers/osunixmap.c
index 0b1fa290245a..44ad4889d468 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#ifdef _free_BSD 57#if defined(_dragon_fly) || defined(_free_BSD)
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/tools/acpidump/acpidump.h b/tools/power/acpi/tools/acpidump/acpidump.h
index 84bdef0136cb..eed534481434 100644
--- a/tools/power/acpi/tools/acpidump/acpidump.h
+++ b/tools/power/acpi/tools/acpidump/acpidump.h
@@ -66,7 +66,7 @@
66EXTERN u8 INIT_GLOBAL(gbl_summary_mode, FALSE); 66EXTERN u8 INIT_GLOBAL(gbl_summary_mode, FALSE);
67EXTERN u8 INIT_GLOBAL(gbl_verbose_mode, FALSE); 67EXTERN u8 INIT_GLOBAL(gbl_verbose_mode, FALSE);
68EXTERN u8 INIT_GLOBAL(gbl_binary_mode, FALSE); 68EXTERN u8 INIT_GLOBAL(gbl_binary_mode, FALSE);
69EXTERN u8 INIT_GLOBAL(gbl_dump_customized_tables, FALSE); 69EXTERN u8 INIT_GLOBAL(gbl_dump_customized_tables, TRUE);
70EXTERN u8 INIT_GLOBAL(gbl_do_not_dump_xsdt, FALSE); 70EXTERN u8 INIT_GLOBAL(gbl_do_not_dump_xsdt, FALSE);
71EXTERN ACPI_FILE INIT_GLOBAL(gbl_output_file, NULL); 71EXTERN ACPI_FILE INIT_GLOBAL(gbl_output_file, NULL);
72EXTERN char INIT_GLOBAL(*gbl_output_filename, NULL); 72EXTERN char INIT_GLOBAL(*gbl_output_filename, NULL);
diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c
index c736adf5fb55..61d0de804b70 100644
--- a/tools/power/acpi/tools/acpidump/apdump.c
+++ b/tools/power/acpi/tools/acpidump/apdump.c
@@ -329,7 +329,7 @@ int ap_dump_table_by_name(char *signature)
329 acpi_status status; 329 acpi_status status;
330 int table_status; 330 int table_status;
331 331
332 if (ACPI_STRLEN(signature) != ACPI_NAME_SIZE) { 332 if (strlen(signature) != ACPI_NAME_SIZE) {
333 acpi_log_error 333 acpi_log_error
334 ("Invalid table signature [%s]: must be exactly 4 characters\n", 334 ("Invalid table signature [%s]: must be exactly 4 characters\n",
335 signature); 335 signature);
@@ -338,15 +338,15 @@ int ap_dump_table_by_name(char *signature)
338 338
339 /* Table signatures are expected to be uppercase */ 339 /* Table signatures are expected to be uppercase */
340 340
341 ACPI_STRCPY(local_signature, signature); 341 strcpy(local_signature, signature);
342 acpi_ut_strupr(local_signature); 342 acpi_ut_strupr(local_signature);
343 343
344 /* To be friendly, handle tables whose signatures do not match the name */ 344 /* To be friendly, handle tables whose signatures do not match the name */
345 345
346 if (ACPI_COMPARE_NAME(local_signature, "FADT")) { 346 if (ACPI_COMPARE_NAME(local_signature, "FADT")) {
347 ACPI_STRCPY(local_signature, ACPI_SIG_FADT); 347 strcpy(local_signature, ACPI_SIG_FADT);
348 } else if (ACPI_COMPARE_NAME(local_signature, "MADT")) { 348 } else if (ACPI_COMPARE_NAME(local_signature, "MADT")) {
349 ACPI_STRCPY(local_signature, ACPI_SIG_MADT); 349 strcpy(local_signature, ACPI_SIG_MADT);
350 } 350 }
351 351
352 /* Dump all instances of this signature (to handle multiple SSDTs) */ 352 /* Dump all instances of this signature (to handle multiple SSDTs) */
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c
index 8f2fe168228e..a37f9702b2a9 100644
--- a/tools/power/acpi/tools/acpidump/apfiles.c
+++ b/tools/power/acpi/tools/acpidump/apfiles.c
@@ -136,10 +136,10 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
136 } else { 136 } else {
137 ACPI_MOVE_NAME(filename, table->signature); 137 ACPI_MOVE_NAME(filename, table->signature);
138 } 138 }
139 filename[0] = (char)ACPI_TOLOWER(filename[0]); 139 filename[0] = (char)tolower((int)filename[0]);
140 filename[1] = (char)ACPI_TOLOWER(filename[1]); 140 filename[1] = (char)tolower((int)filename[1]);
141 filename[2] = (char)ACPI_TOLOWER(filename[2]); 141 filename[2] = (char)tolower((int)filename[2]);
142 filename[3] = (char)ACPI_TOLOWER(filename[3]); 142 filename[3] = (char)tolower((int)filename[3]);
143 filename[ACPI_NAME_SIZE] = 0; 143 filename[ACPI_NAME_SIZE] = 0;
144 144
145 /* Handle multiple SSDts - create different filenames for each */ 145 /* Handle multiple SSDts - create different filenames for each */
@@ -147,10 +147,10 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
147 if (instance > 0) { 147 if (instance > 0) {
148 acpi_ut_snprintf(instance_str, sizeof(instance_str), "%u", 148 acpi_ut_snprintf(instance_str, sizeof(instance_str), "%u",
149 instance); 149 instance);
150 ACPI_STRCAT(filename, instance_str); 150 strcat(filename, instance_str);
151 } 151 }
152 152
153 ACPI_STRCAT(filename, ACPI_TABLE_FILE_SUFFIX); 153 strcat(filename, ACPI_TABLE_FILE_SUFFIX);
154 154
155 if (gbl_verbose_mode) { 155 if (gbl_verbose_mode) {
156 acpi_log_error 156 acpi_log_error
diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c
index d0ba6535f5af..57620f66ae6c 100644
--- a/tools/power/acpi/tools/acpidump/apmain.c
+++ b/tools/power/acpi/tools/acpidump/apmain.c
@@ -80,7 +80,7 @@ struct ap_dump_action action_table[AP_MAX_ACTIONS];
80u32 current_action = 0; 80u32 current_action = 0;
81 81
82#define AP_UTILITY_NAME "ACPI Binary Table Dump Utility" 82#define AP_UTILITY_NAME "ACPI Binary Table Dump Utility"
83#define AP_SUPPORTED_OPTIONS "?a:bcf:hn:o:r:svxz" 83#define AP_SUPPORTED_OPTIONS "?a:bc:f:hn:o:r:svxz"
84 84
85/****************************************************************************** 85/******************************************************************************
86 * 86 *
@@ -96,7 +96,6 @@ static void ap_display_usage(void)
96 ACPI_USAGE_HEADER("acpidump [options]"); 96 ACPI_USAGE_HEADER("acpidump [options]");
97 97
98 ACPI_OPTION("-b", "Dump tables to binary files"); 98 ACPI_OPTION("-b", "Dump tables to binary files");
99 ACPI_OPTION("-c", "Dump customized tables");
100 ACPI_OPTION("-h -?", "This help message"); 99 ACPI_OPTION("-h -?", "This help message");
101 ACPI_OPTION("-o <File>", "Redirect output to file"); 100 ACPI_OPTION("-o <File>", "Redirect output to file");
102 ACPI_OPTION("-r <Address>", "Dump tables from specified RSDP"); 101 ACPI_OPTION("-r <Address>", "Dump tables from specified RSDP");
@@ -107,6 +106,7 @@ static void ap_display_usage(void)
107 ACPI_USAGE_TEXT("\nTable Options:\n"); 106 ACPI_USAGE_TEXT("\nTable Options:\n");
108 107
109 ACPI_OPTION("-a <Address>", "Get table via a physical address"); 108 ACPI_OPTION("-a <Address>", "Get table via a physical address");
109 ACPI_OPTION("-c <on|off>", "Turning on/off customized table dumping");
110 ACPI_OPTION("-f <BinaryFile>", "Get table via a binary file"); 110 ACPI_OPTION("-f <BinaryFile>", "Get table via a binary file");
111 ACPI_OPTION("-n <Signature>", "Get table via a name/signature"); 111 ACPI_OPTION("-n <Signature>", "Get table via a name/signature");
112 ACPI_OPTION("-x", "Do not use but dump XSDT"); 112 ACPI_OPTION("-x", "Do not use but dump XSDT");
@@ -181,7 +181,16 @@ static int ap_do_options(int argc, char **argv)
181 181
182 case 'c': /* Dump customized tables */ 182 case 'c': /* Dump customized tables */
183 183
184 gbl_dump_customized_tables = TRUE; 184 if (!strcmp(acpi_gbl_optarg, "on")) {
185 gbl_dump_customized_tables = TRUE;
186 } else if (!strcmp(acpi_gbl_optarg, "off")) {
187 gbl_dump_customized_tables = FALSE;
188 } else {
189 acpi_log_error
190 ("%s: Cannot handle this switch, please use on|off\n",
191 acpi_gbl_optarg);
192 return (-1);
193 }
185 continue; 194 continue;
186 195
187 case 'h': 196 case 'h':