Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-4.7/acpi6.1' into libnvdimm-for-next

+1065 -752
+1
drivers/acpi/acpica/Makefile
··· 43 43 evxfregn.o 44 44 45 45 acpi-y += \ 46 + exconcat.o \ 46 47 exconfig.o \ 47 48 exconvrt.o \ 48 49 excreate.o \
+2 -2
drivers/acpi/acpica/acdebug.h
··· 53 53 #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */ 54 54 55 55 struct acpi_db_command_info { 56 - char *name; /* Command Name */ 56 + const char *name; /* Command Name */ 57 57 u8 min_args; /* Minimum arguments required */ 58 58 }; 59 59 ··· 64 64 }; 65 65 66 66 struct acpi_db_argument_info { 67 - char *name; /* Argument Name */ 67 + const char *name; /* Argument Name */ 68 68 }; 69 69 70 70 struct acpi_db_execute_walk {
-2
drivers/acpi/acpica/acevents.h
··· 198 198 acpi_ev_detach_region(union acpi_operand_object *region_obj, 199 199 u8 acpi_ns_is_locked); 200 200 201 - void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj); 202 - 203 201 void 204 202 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, 205 203 acpi_adr_space_type space_id, u32 function);
+11
drivers/acpi/acpica/acglobal.h
··· 187 187 extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS]; 188 188 extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS]; 189 189 extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; 190 + extern const char acpi_gbl_lower_hex_digits[]; 191 + extern const char acpi_gbl_upper_hex_digits[]; 190 192 extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; 191 193 192 194 #ifdef ACPI_DBG_TRACK_ALLOCATIONS ··· 362 360 ACPI_GLOBAL(u32, acpi_gbl_num_objects); 363 361 364 362 #endif /* ACPI_DEBUGGER */ 363 + 364 + #if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER) 365 + 366 + ACPI_GLOBAL(const char, *acpi_gbl_pld_panel_list[]); 367 + ACPI_GLOBAL(const char, *acpi_gbl_pld_vertical_position_list[]); 368 + ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]); 369 + ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]); 370 + 371 + #endif 365 372 366 373 /***************************************************************************** 367 374 *
+1 -1
drivers/acpi/acpica/acinterp.h
··· 67 67 typedef const struct acpi_exdump_info { 68 68 u8 opcode; 69 69 u8 offset; 70 - char *name; 70 + const char *name; 71 71 72 72 } acpi_exdump_info; 73 73
+1
drivers/acpi/acpica/aclocal.h
··· 1096 1096 #define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */ 1097 1097 #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ 1098 1098 #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ 1099 + #define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */ 1099 1100 1100 1101 struct acpi_external_file { 1101 1102 char *path;
+6 -2
drivers/acpi/acpica/acmacros.h
··· 260 260 261 261 #define ACPI_IS_MISALIGNED(value) (((acpi_size) value) & (sizeof(acpi_size)-1)) 262 262 263 + /* Generic (power-of-two) rounding */ 264 + 265 + #define ACPI_IS_POWER_OF_TWO(a) (((a) & ((a) - 1)) == 0) 266 + 263 267 /* 264 268 * Bitmask creation 265 269 * Bit positions start at zero. ··· 287 283 /* Generic bitfield macros and masks */ 288 284 289 285 #define ACPI_GET_BITS(source_ptr, position, mask) \ 290 - ((*source_ptr >> position) & mask) 286 + ((*(source_ptr) >> (position)) & (mask)) 291 287 292 288 #define ACPI_SET_BITS(target_ptr, position, mask, value) \ 293 - (*target_ptr |= ((value & mask) << position)) 289 + (*(target_ptr) |= (((value) & (mask)) << (position))) 294 290 295 291 #define ACPI_1BIT_MASK 0x00000001 296 292 #define ACPI_2BIT_MASK 0x00000003
+3 -2
drivers/acpi/acpica/acnamesp.h
··· 206 206 void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level); 207 207 208 208 void 209 - acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component); 209 + acpi_ns_dump_pathname(acpi_handle handle, 210 + const char *msg, u32 level, u32 component); 210 211 211 - void acpi_ns_print_pathname(u32 num_segments, char *pathname); 212 + void acpi_ns_print_pathname(u32 num_segments, const char *pathname); 212 213 213 214 acpi_status 214 215 acpi_ns_dump_one_object(acpi_handle obj_handle,
+1 -1
drivers/acpi/acpica/acparser.h
··· 139 139 */ 140 140 const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode); 141 141 142 - char *acpi_ps_get_opcode_name(u16 opcode); 142 + const char *acpi_ps_get_opcode_name(u16 opcode); 143 143 144 144 u8 acpi_ps_get_argument_count(u32 op_type); 145 145
+9
drivers/acpi/acpica/acpredef.h
··· 523 523 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ 524 524 PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0), 525 525 526 + {{"_FIT", METHOD_0ARGS, 527 + METHOD_RETURNS(ACPI_RTYPE_BUFFER)}}, /* ACPI 6.0 */ 528 + 526 529 {{"_FIX", METHOD_0ARGS, 527 530 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */ 528 531 PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0), ··· 1055 1052 {{"_WED", METHOD_1ARGS(ACPI_TYPE_INTEGER), 1056 1053 METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | 1057 1054 ACPI_RTYPE_BUFFER)}}, 1055 + 1056 + {{"_WPC", METHOD_0ARGS, 1057 + METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */ 1058 + 1059 + {{"_WPP", METHOD_0ARGS, 1060 + METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */ 1058 1061 1059 1062 PACKAGE_INFO(0, 0, 0, 0, 0, 0) /* Table terminator */ 1060 1063 };
+2 -2
drivers/acpi/acpica/acresrc.h
··· 124 124 typedef const struct acpi_rsdump_info { 125 125 u8 opcode; 126 126 u8 offset; 127 - char *name; 127 + const char *name; 128 128 const char **pointer; 129 129 130 130 } acpi_rsdump_info; ··· 209 209 210 210 acpi_status 211 211 acpi_rs_get_method_data(acpi_handle handle, 212 - char *path, struct acpi_buffer *ret_buffer); 212 + const char *path, struct acpi_buffer *ret_buffer); 213 213 214 214 acpi_status 215 215 acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
+1 -1
drivers/acpi/acpica/acstruct.h
··· 184 184 /* The first 3 elements are passed by the caller to acpi_ns_evaluate */ 185 185 186 186 struct acpi_namespace_node *prefix_node; /* Input: starting node */ 187 - char *relative_pathname; /* Input: path relative to prefix_node */ 187 + const char *relative_pathname; /* Input: path relative to prefix_node */ 188 188 union acpi_operand_object **parameters; /* Input: argument list */ 189 189 190 190 struct acpi_namespace_node *node; /* Resolved node (prefix_node:relative_pathname) */
+16 -7
drivers/acpi/acpica/acutils.h
··· 175 175 176 176 int acpi_ut_stricmp(char *string1, char *string2); 177 177 178 - acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer); 178 + acpi_status 179 + acpi_ut_strtoul64(char *string, 180 + u32 base, u32 max_integer_byte_width, u64 *ret_integer); 181 + 182 + /* Values for max_integer_byte_width above */ 183 + 184 + #define ACPI_MAX32_BYTE_WIDTH 4 185 + #define ACPI_MAX64_BYTE_WIDTH 8 179 186 180 187 /* 181 188 * utglobal - Global data structures and procedures ··· 273 266 void 274 267 acpi_ut_trace_ptr(u32 line_number, 275 268 const char *function_name, 276 - const char *module_name, u32 component_id, void *pointer); 269 + const char *module_name, 270 + u32 component_id, const void *pointer); 277 271 278 272 void 279 273 acpi_ut_trace_u32(u32 line_number, ··· 284 276 void 285 277 acpi_ut_trace_str(u32 line_number, 286 278 const char *function_name, 287 - const char *module_name, u32 component_id, char *string); 279 + const char *module_name, 280 + u32 component_id, const char *string); 288 281 289 282 void 290 283 acpi_ut_exit(u32 line_number, ··· 344 335 */ 345 336 acpi_status 346 337 acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, 347 - char *path, 338 + const char *path, 348 339 u32 expected_return_btypes, 349 340 union acpi_operand_object **return_desc); 350 341 351 342 acpi_status 352 - acpi_ut_evaluate_numeric_object(char *object_name, 343 + acpi_ut_evaluate_numeric_object(const char *object_name, 353 344 struct acpi_namespace_node *device_node, 354 345 u64 *value); 355 346 ··· 535 526 void 536 527 acpi_ut_display_init_pathname(u8 type, 537 528 struct acpi_namespace_node *obj_handle, 538 - char *path); 529 + const char *path); 539 530 #endif 540 531 541 532 /* ··· 637 628 void acpi_ut_dump_allocations(u32 component, const char *module); 638 629 639 630 acpi_status 640 - acpi_ut_create_list(char *list_name, 631 + acpi_ut_create_list(const char *list_name, 641 632 u16 object_size, struct acpi_memory_list **return_cache); 642 633 643 634 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+3 -1
drivers/acpi/acpica/dbconvert.c
··· 277 277 default: 278 278 279 279 object->type = ACPI_TYPE_INTEGER; 280 - status = acpi_ut_strtoul64(string, 16, &object->integer.value); 280 + status = 281 + acpi_ut_strtoul64(string, 16, acpi_gbl_integer_byte_width, 282 + &object->integer.value); 281 283 break; 282 284 } 283 285
+7 -6
drivers/acpi/acpica/dbinput.c
··· 57 57 58 58 static u32 acpi_db_match_command(char *user_command); 59 59 60 - static void acpi_db_display_command_info(char *command, u8 display_all); 60 + static void acpi_db_display_command_info(const char *command, u8 display_all); 61 61 62 62 static void acpi_db_display_help(char *command); 63 63 64 64 static u8 65 - acpi_db_match_command_help(char *command, 65 + acpi_db_match_command_help(const char *command, 66 66 const struct acpi_db_command_help *help); 67 67 68 68 /* ··· 348 348 ******************************************************************************/ 349 349 350 350 static u8 351 - acpi_db_match_command_help(char *command, 351 + acpi_db_match_command_help(const char *command, 352 352 const struct acpi_db_command_help *help) 353 353 { 354 354 char *invocation = help->invocation; ··· 402 402 * 403 403 ******************************************************************************/ 404 404 405 - static void acpi_db_display_command_info(char *command, u8 display_all) 405 + static void acpi_db_display_command_info(const char *command, u8 display_all) 406 406 { 407 407 const struct acpi_db_command_help *next; 408 408 u8 matched; ··· 656 656 } 657 657 658 658 for (i = CMD_FIRST_VALID; acpi_gbl_db_commands[i].name; i++) { 659 - if (strstr(acpi_gbl_db_commands[i].name, user_command) == 660 - acpi_gbl_db_commands[i].name) { 659 + if (strstr 660 + (ACPI_CAST_PTR(char, acpi_gbl_db_commands[i].name), 661 + user_command) == acpi_gbl_db_commands[i].name) { 661 662 return (i); 662 663 } 663 664 }
+4 -5
drivers/acpi/acpica/dbutils.c
··· 56 56 void acpi_db_dump_buffer(u32 address); 57 57 #endif 58 58 59 - static char *gbl_hex_to_ascii = "0123456789ABCDEF"; 60 - 61 59 /******************************************************************************* 62 60 * 63 61 * FUNCTION: acpi_db_match_argument ··· 80 82 } 81 83 82 84 for (i = 0; arguments[i].name; i++) { 83 - if (strstr(arguments[i].name, user_argument) == 84 - arguments[i].name) { 85 + if (strstr(ACPI_CAST_PTR(char, arguments[i].name), 86 + ACPI_CAST_PTR(char, 87 + user_argument)) == arguments[i].name) { 85 88 return (i); 86 89 } 87 90 } ··· 338 339 buffer[8] = '\0'; 339 340 340 341 for (i = 7; i >= 0; i--) { 341 - buffer[i] = gbl_hex_to_ascii[value & 0x0F]; 342 + buffer[i] = acpi_gbl_upper_hex_digits[value & 0x0F]; 342 343 value = value >> 4; 343 344 } 344 345 }
+27 -49
drivers/acpi/acpica/evregion.c
··· 526 526 527 527 /******************************************************************************* 528 528 * 529 - * FUNCTION: acpi_ev_associate_reg_method 530 - * 531 - * PARAMETERS: region_obj - Region object 532 - * 533 - * RETURN: Status 534 - * 535 - * DESCRIPTION: Find and associate _REG method to a region 536 - * 537 - ******************************************************************************/ 538 - 539 - void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj) 540 - { 541 - acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG; 542 - struct acpi_namespace_node *method_node; 543 - struct acpi_namespace_node *node; 544 - union acpi_operand_object *region_obj2; 545 - acpi_status status; 546 - 547 - ACPI_FUNCTION_TRACE(ev_associate_reg_method); 548 - 549 - region_obj2 = acpi_ns_get_secondary_object(region_obj); 550 - if (!region_obj2) { 551 - return_VOID; 552 - } 553 - 554 - node = region_obj->region.node->parent; 555 - 556 - /* Find any "_REG" method associated with this region definition */ 557 - 558 - status = 559 - acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD, 560 - &method_node); 561 - if (ACPI_SUCCESS(status)) { 562 - /* 563 - * The _REG method is optional and there can be only one per region 564 - * definition. This will be executed when the handler is attached 565 - * or removed 566 - */ 567 - region_obj2->extra.method_REG = method_node; 568 - } 569 - 570 - return_VOID; 571 - } 572 - 573 - /******************************************************************************* 574 - * 575 529 * FUNCTION: acpi_ev_execute_reg_method 576 530 * 577 531 * PARAMETERS: region_obj - Region object ··· 543 589 struct acpi_evaluate_info *info; 544 590 union acpi_operand_object *args[3]; 545 591 union acpi_operand_object *region_obj2; 592 + const acpi_name *reg_name_ptr = 593 + ACPI_CAST_PTR(acpi_name, METHOD_NAME__REG); 594 + struct acpi_namespace_node *method_node; 595 + struct acpi_namespace_node *node; 546 596 acpi_status status; 547 597 548 598 ACPI_FUNCTION_TRACE(ev_execute_reg_method); 599 + 600 + if (!acpi_gbl_namespace_initialized || 601 + region_obj->region.handler == NULL) { 602 + return_ACPI_STATUS(AE_OK); 603 + } 549 604 550 605 region_obj2 = acpi_ns_get_secondary_object(region_obj); 551 606 if (!region_obj2) { 552 607 return_ACPI_STATUS(AE_NOT_EXIST); 553 608 } 554 609 555 - if (region_obj2->extra.method_REG == NULL || 556 - region_obj->region.handler == NULL || 557 - !acpi_gbl_namespace_initialized) { 610 + /* 611 + * Find any "_REG" method associated with this region definition. 612 + * The method should always be updated as this function may be 613 + * invoked after a namespace change. 614 + */ 615 + node = region_obj->region.node->parent; 616 + status = 617 + acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD, 618 + &method_node); 619 + if (ACPI_SUCCESS(status)) { 620 + /* 621 + * The _REG method is optional and there can be only one per 622 + * region definition. This will be executed when the handler is 623 + * attached or removed. 624 + */ 625 + region_obj2->extra.method_REG = method_node; 626 + } 627 + if (region_obj2->extra.method_REG == NULL) { 558 628 return_ACPI_STATUS(AE_OK); 559 629 } 560 630
-1
drivers/acpi/acpica/evrgnini.c
··· 518 518 return_ACPI_STATUS(AE_OK); 519 519 } 520 520 521 - acpi_ev_associate_reg_method(region_obj); 522 521 region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED; 523 522 524 523 node = region_obj->region.node->parent;
+439
drivers/acpi/acpica/exconcat.c
··· 1 + /****************************************************************************** 2 + * 3 + * Module Name: exconcat - Concatenate-type AML operators 4 + * 5 + *****************************************************************************/ 6 + 7 + /* 8 + * Copyright (C) 2000 - 2016, Intel Corp. 9 + * All rights reserved. 10 + * 11 + * Redistribution and use in source and binary forms, with or without 12 + * modification, are permitted provided that the following conditions 13 + * are met: 14 + * 1. Redistributions of source code must retain the above copyright 15 + * notice, this list of conditions, and the following disclaimer, 16 + * without modification. 17 + * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 + * substantially similar to the "NO WARRANTY" disclaimer below 19 + * ("Disclaimer") and any redistribution must be conditioned upon 20 + * including a substantially similar Disclaimer requirement for further 21 + * binary redistribution. 22 + * 3. Neither the names of the above-listed copyright holders nor the names 23 + * of any contributors may be used to endorse or promote products derived 24 + * from this software without specific prior written permission. 25 + * 26 + * Alternatively, this software may be distributed under the terms of the 27 + * GNU General Public License ("GPL") version 2 as published by the Free 28 + * Software Foundation. 29 + * 30 + * NO WARRANTY 31 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 + * POSSIBILITY OF SUCH DAMAGES. 42 + */ 43 + 44 + #include <acpi/acpi.h> 45 + #include "accommon.h" 46 + #include "acinterp.h" 47 + #include "amlresrc.h" 48 + 49 + #define _COMPONENT ACPI_EXECUTER 50 + ACPI_MODULE_NAME("exconcat") 51 + 52 + /* Local Prototypes */ 53 + static acpi_status 54 + acpi_ex_convert_to_object_type_string(union acpi_operand_object *obj_desc, 55 + union acpi_operand_object **result_desc); 56 + 57 + /******************************************************************************* 58 + * 59 + * FUNCTION: acpi_ex_do_concatenate 60 + * 61 + * PARAMETERS: operand0 - First source object 62 + * operand1 - Second source object 63 + * actual_return_desc - Where to place the return object 64 + * walk_state - Current walk state 65 + * 66 + * RETURN: Status 67 + * 68 + * DESCRIPTION: Concatenate two objects with the ACPI-defined conversion 69 + * rules as necessary. 70 + * NOTE: 71 + * Per the ACPI spec (up to 6.1), Concatenate only supports Integer, 72 + * String, and Buffer objects. However, we support all objects here 73 + * as an extension. This improves the usefulness of both Concatenate 74 + * and the Printf/Fprintf macros. The extension returns a string 75 + * describing the object type for the other objects. 76 + * 02/2016. 77 + * 78 + ******************************************************************************/ 79 + 80 + acpi_status 81 + acpi_ex_do_concatenate(union acpi_operand_object *operand0, 82 + union acpi_operand_object *operand1, 83 + union acpi_operand_object **actual_return_desc, 84 + struct acpi_walk_state *walk_state) 85 + { 86 + union acpi_operand_object *local_operand0 = operand0; 87 + union acpi_operand_object *local_operand1 = operand1; 88 + union acpi_operand_object *temp_operand1 = NULL; 89 + union acpi_operand_object *return_desc; 90 + char *buffer; 91 + acpi_object_type operand0_type; 92 + acpi_object_type operand1_type; 93 + acpi_status status; 94 + 95 + ACPI_FUNCTION_TRACE(ex_do_concatenate); 96 + 97 + /* Operand 0 preprocessing */ 98 + 99 + switch (operand0->common.type) { 100 + case ACPI_TYPE_INTEGER: 101 + case ACPI_TYPE_STRING: 102 + case ACPI_TYPE_BUFFER: 103 + 104 + operand0_type = operand0->common.type; 105 + break; 106 + 107 + default: 108 + 109 + /* For all other types, get the "object type" string */ 110 + 111 + status = 112 + acpi_ex_convert_to_object_type_string(operand0, 113 + &local_operand0); 114 + if (ACPI_FAILURE(status)) { 115 + goto cleanup; 116 + } 117 + 118 + operand0_type = ACPI_TYPE_STRING; 119 + break; 120 + } 121 + 122 + /* Operand 1 preprocessing */ 123 + 124 + switch (operand1->common.type) { 125 + case ACPI_TYPE_INTEGER: 126 + case ACPI_TYPE_STRING: 127 + case ACPI_TYPE_BUFFER: 128 + 129 + operand1_type = operand1->common.type; 130 + break; 131 + 132 + default: 133 + 134 + /* For all other types, get the "object type" string */ 135 + 136 + status = 137 + acpi_ex_convert_to_object_type_string(operand1, 138 + &local_operand1); 139 + if (ACPI_FAILURE(status)) { 140 + goto cleanup; 141 + } 142 + 143 + operand1_type = ACPI_TYPE_STRING; 144 + break; 145 + } 146 + 147 + /* 148 + * Convert the second operand if necessary. The first operand (0) 149 + * determines the type of the second operand (1) (See the Data Types 150 + * section of the ACPI specification). Both object types are 151 + * guaranteed to be either Integer/String/Buffer by the operand 152 + * resolution mechanism. 153 + */ 154 + switch (operand0_type) { 155 + case ACPI_TYPE_INTEGER: 156 + 157 + status = 158 + acpi_ex_convert_to_integer(local_operand1, &temp_operand1, 159 + 16); 160 + break; 161 + 162 + case ACPI_TYPE_BUFFER: 163 + 164 + status = 165 + acpi_ex_convert_to_buffer(local_operand1, &temp_operand1); 166 + break; 167 + 168 + case ACPI_TYPE_STRING: 169 + 170 + switch (operand1_type) { 171 + case ACPI_TYPE_INTEGER: 172 + case ACPI_TYPE_STRING: 173 + case ACPI_TYPE_BUFFER: 174 + 175 + /* Other types have already been converted to string */ 176 + 177 + status = 178 + acpi_ex_convert_to_string(local_operand1, 179 + &temp_operand1, 180 + ACPI_IMPLICIT_CONVERT_HEX); 181 + break; 182 + 183 + default: 184 + 185 + status = AE_OK; 186 + break; 187 + } 188 + break; 189 + 190 + default: 191 + 192 + ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X", 193 + operand0->common.type)); 194 + status = AE_AML_INTERNAL; 195 + } 196 + 197 + if (ACPI_FAILURE(status)) { 198 + goto cleanup; 199 + } 200 + 201 + /* Take care with any newly created operand objects */ 202 + 203 + if ((local_operand1 != operand1) && (local_operand1 != temp_operand1)) { 204 + acpi_ut_remove_reference(local_operand1); 205 + } 206 + 207 + local_operand1 = temp_operand1; 208 + 209 + /* 210 + * Both operands are now known to be the same object type 211 + * (Both are Integer, String, or Buffer), and we can now perform 212 + * the concatenation. 213 + * 214 + * There are three cases to handle, as per the ACPI spec: 215 + * 216 + * 1) Two Integers concatenated to produce a new Buffer 217 + * 2) Two Strings concatenated to produce a new String 218 + * 3) Two Buffers concatenated to produce a new Buffer 219 + */ 220 + switch (operand0_type) { 221 + case ACPI_TYPE_INTEGER: 222 + 223 + /* Result of two Integers is a Buffer */ 224 + /* Need enough buffer space for two integers */ 225 + 226 + return_desc = acpi_ut_create_buffer_object((acpi_size) 227 + ACPI_MUL_2 228 + (acpi_gbl_integer_byte_width)); 229 + if (!return_desc) { 230 + status = AE_NO_MEMORY; 231 + goto cleanup; 232 + } 233 + 234 + buffer = (char *)return_desc->buffer.pointer; 235 + 236 + /* Copy the first integer, LSB first */ 237 + 238 + memcpy(buffer, &operand0->integer.value, 239 + acpi_gbl_integer_byte_width); 240 + 241 + /* Copy the second integer (LSB first) after the first */ 242 + 243 + memcpy(buffer + acpi_gbl_integer_byte_width, 244 + &local_operand1->integer.value, 245 + acpi_gbl_integer_byte_width); 246 + break; 247 + 248 + case ACPI_TYPE_STRING: 249 + 250 + /* Result of two Strings is a String */ 251 + 252 + return_desc = acpi_ut_create_string_object(((acpi_size) 253 + local_operand0-> 254 + string.length + 255 + local_operand1-> 256 + string.length)); 257 + if (!return_desc) { 258 + status = AE_NO_MEMORY; 259 + goto cleanup; 260 + } 261 + 262 + buffer = return_desc->string.pointer; 263 + 264 + /* Concatenate the strings */ 265 + 266 + strcpy(buffer, local_operand0->string.pointer); 267 + strcat(buffer, local_operand1->string.pointer); 268 + break; 269 + 270 + case ACPI_TYPE_BUFFER: 271 + 272 + /* Result of two Buffers is a Buffer */ 273 + 274 + return_desc = acpi_ut_create_buffer_object(((acpi_size) 275 + operand0->buffer. 276 + length + 277 + local_operand1-> 278 + buffer.length)); 279 + if (!return_desc) { 280 + status = AE_NO_MEMORY; 281 + goto cleanup; 282 + } 283 + 284 + buffer = (char *)return_desc->buffer.pointer; 285 + 286 + /* Concatenate the buffers */ 287 + 288 + memcpy(buffer, operand0->buffer.pointer, 289 + operand0->buffer.length); 290 + memcpy(buffer + operand0->buffer.length, 291 + local_operand1->buffer.pointer, 292 + local_operand1->buffer.length); 293 + break; 294 + 295 + default: 296 + 297 + /* Invalid object type, should not happen here */ 298 + 299 + ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X", 300 + operand0->common.type)); 301 + status = AE_AML_INTERNAL; 302 + goto cleanup; 303 + } 304 + 305 + *actual_return_desc = return_desc; 306 + 307 + cleanup: 308 + if (local_operand0 != operand0) { 309 + acpi_ut_remove_reference(local_operand0); 310 + } 311 + 312 + if (local_operand1 != operand1) { 313 + acpi_ut_remove_reference(local_operand1); 314 + } 315 + 316 + return_ACPI_STATUS(status); 317 + } 318 + 319 + /******************************************************************************* 320 + * 321 + * FUNCTION: acpi_ex_convert_to_object_type_string 322 + * 323 + * PARAMETERS: obj_desc - Object to be converted 324 + * return_desc - Where to place the return object 325 + * 326 + * RETURN: Status 327 + * 328 + * DESCRIPTION: Convert an object of arbitrary type to a string object that 329 + * contains the namestring for the object. Used for the 330 + * concatenate operator. 331 + * 332 + ******************************************************************************/ 333 + 334 + static acpi_status 335 + acpi_ex_convert_to_object_type_string(union acpi_operand_object *obj_desc, 336 + union acpi_operand_object **result_desc) 337 + { 338 + union acpi_operand_object *return_desc; 339 + const char *type_string; 340 + 341 + type_string = acpi_ut_get_type_name(obj_desc->common.type); 342 + 343 + return_desc = acpi_ut_create_string_object(((acpi_size) strlen(type_string) + 9)); /* 9 For "[ Object]" */ 344 + if (!return_desc) { 345 + return (AE_NO_MEMORY); 346 + } 347 + 348 + strcpy(return_desc->string.pointer, "["); 349 + strcat(return_desc->string.pointer, type_string); 350 + strcat(return_desc->string.pointer, " Object]"); 351 + 352 + *result_desc = return_desc; 353 + return (AE_OK); 354 + } 355 + 356 + /******************************************************************************* 357 + * 358 + * FUNCTION: acpi_ex_concat_template 359 + * 360 + * PARAMETERS: operand0 - First source object 361 + * operand1 - Second source object 362 + * actual_return_desc - Where to place the return object 363 + * walk_state - Current walk state 364 + * 365 + * RETURN: Status 366 + * 367 + * DESCRIPTION: Concatenate two resource templates 368 + * 369 + ******************************************************************************/ 370 + 371 + acpi_status 372 + acpi_ex_concat_template(union acpi_operand_object *operand0, 373 + union acpi_operand_object *operand1, 374 + union acpi_operand_object **actual_return_desc, 375 + struct acpi_walk_state * walk_state) 376 + { 377 + acpi_status status; 378 + union acpi_operand_object *return_desc; 379 + u8 *new_buf; 380 + u8 *end_tag; 381 + acpi_size length0; 382 + acpi_size length1; 383 + acpi_size new_length; 384 + 385 + ACPI_FUNCTION_TRACE(ex_concat_template); 386 + 387 + /* 388 + * Find the end_tag descriptor in each resource template. 389 + * Note1: returned pointers point TO the end_tag, not past it. 390 + * Note2: zero-length buffers are allowed; treated like one end_tag 391 + */ 392 + 393 + /* Get the length of the first resource template */ 394 + 395 + status = acpi_ut_get_resource_end_tag(operand0, &end_tag); 396 + if (ACPI_FAILURE(status)) { 397 + return_ACPI_STATUS(status); 398 + } 399 + 400 + length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer); 401 + 402 + /* Get the length of the second resource template */ 403 + 404 + status = acpi_ut_get_resource_end_tag(operand1, &end_tag); 405 + if (ACPI_FAILURE(status)) { 406 + return_ACPI_STATUS(status); 407 + } 408 + 409 + length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer); 410 + 411 + /* Combine both lengths, minimum size will be 2 for end_tag */ 412 + 413 + new_length = length0 + length1 + sizeof(struct aml_resource_end_tag); 414 + 415 + /* Create a new buffer object for the result (with one end_tag) */ 416 + 417 + return_desc = acpi_ut_create_buffer_object(new_length); 418 + if (!return_desc) { 419 + return_ACPI_STATUS(AE_NO_MEMORY); 420 + } 421 + 422 + /* 423 + * Copy the templates to the new buffer, 0 first, then 1 follows. One 424 + * end_tag descriptor is copied from Operand1. 425 + */ 426 + new_buf = return_desc->buffer.pointer; 427 + memcpy(new_buf, operand0->buffer.pointer, length0); 428 + memcpy(new_buf + length0, operand1->buffer.pointer, length1); 429 + 430 + /* Insert end_tag and set the checksum to zero, means "ignore checksum" */ 431 + 432 + new_buf[new_length - 1] = 0; 433 + new_buf[new_length - 2] = ACPI_RESOURCE_NAME_END_TAG | 1; 434 + 435 + /* Return the completed resource template */ 436 + 437 + *actual_return_desc = return_desc; 438 + return_ACPI_STATUS(AE_OK); 439 + }
+3 -1
drivers/acpi/acpica/exconfig.c
··· 118 118 /* Execute any module-level code that was found in the table */ 119 119 120 120 acpi_ex_exit_interpreter(); 121 - acpi_ns_exec_module_code_list(); 121 + if (acpi_gbl_group_module_level_code) { 122 + acpi_ns_exec_module_code_list(); 123 + } 122 124 acpi_ex_enter_interpreter(); 123 125 124 126 /*
+3 -1
drivers/acpi/acpica/exconvrt.c
··· 124 124 * of ACPI 3.0) is that the to_integer() operator allows both decimal 125 125 * and hexadecimal strings (hex prefixed with "0x"). 126 126 */ 127 - status = acpi_ut_strtoul64((char *)pointer, flags, &result); 127 + status = acpi_ut_strtoul64((char *)pointer, flags, 128 + acpi_gbl_integer_byte_width, 129 + &result); 128 130 if (ACPI_FAILURE(status)) { 129 131 return_ACPI_STATUS(status); 130 132 }
+7 -8
drivers/acpi/acpica/exdump.c
··· 55 55 */ 56 56 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 57 57 /* Local prototypes */ 58 - static void acpi_ex_out_string(char *title, char *value); 58 + static void acpi_ex_out_string(const char *title, const char *value); 59 59 60 - static void acpi_ex_out_pointer(char *title, void *value); 60 + static void acpi_ex_out_pointer(const char *title, const void *value); 61 61 62 62 static void 63 63 acpi_ex_dump_object(union acpi_operand_object *obj_desc, ··· 365 365 struct acpi_exdump_info *info) 366 366 { 367 367 u8 *target; 368 - char *name; 369 - const char *reference_name; 368 + const char *name; 370 369 u8 count; 371 370 union acpi_operand_object *start; 372 371 union acpi_operand_object *data = NULL; ··· 458 459 459 460 case ACPI_EXD_REFERENCE: 460 461 461 - reference_name = acpi_ut_get_reference_name(obj_desc); 462 462 acpi_ex_out_string("Class Name", 463 - ACPI_CAST_PTR(char, reference_name)); 463 + acpi_ut_get_reference_name 464 + (obj_desc)); 464 465 acpi_ex_dump_reference_obj(obj_desc); 465 466 break; 466 467 ··· 933 934 * 934 935 ******************************************************************************/ 935 936 936 - static void acpi_ex_out_string(char *title, char *value) 937 + static void acpi_ex_out_string(const char *title, const char *value) 937 938 { 938 939 acpi_os_printf("%20s : %s\n", title, value); 939 940 } 940 941 941 - static void acpi_ex_out_pointer(char *title, void *value) 942 + static void acpi_ex_out_pointer(const char *title, const void *value) 942 943 { 943 944 acpi_os_printf("%20s : %p\n", title, value); 944 945 }
-290
drivers/acpi/acpica/exmisc.c
··· 45 45 #include "accommon.h" 46 46 #include "acinterp.h" 47 47 #include "amlcode.h" 48 - #include "amlresrc.h" 49 48 50 49 #define _COMPONENT ACPI_EXECUTER 51 50 ACPI_MODULE_NAME("exmisc") ··· 135 136 *return_desc)); 136 137 137 138 return_ACPI_STATUS(AE_OK); 138 - } 139 - 140 - /******************************************************************************* 141 - * 142 - * FUNCTION: acpi_ex_concat_template 143 - * 144 - * PARAMETERS: operand0 - First source object 145 - * operand1 - Second source object 146 - * actual_return_desc - Where to place the return object 147 - * walk_state - Current walk state 148 - * 149 - * RETURN: Status 150 - * 151 - * DESCRIPTION: Concatenate two resource templates 152 - * 153 - ******************************************************************************/ 154 - 155 - acpi_status 156 - acpi_ex_concat_template(union acpi_operand_object *operand0, 157 - union acpi_operand_object *operand1, 158 - union acpi_operand_object **actual_return_desc, 159 - struct acpi_walk_state *walk_state) 160 - { 161 - acpi_status status; 162 - union acpi_operand_object *return_desc; 163 - u8 *new_buf; 164 - u8 *end_tag; 165 - acpi_size length0; 166 - acpi_size length1; 167 - acpi_size new_length; 168 - 169 - ACPI_FUNCTION_TRACE(ex_concat_template); 170 - 171 - /* 172 - * Find the end_tag descriptor in each resource template. 173 - * Note1: returned pointers point TO the end_tag, not past it. 174 - * Note2: zero-length buffers are allowed; treated like one end_tag 175 - */ 176 - 177 - /* Get the length of the first resource template */ 178 - 179 - status = acpi_ut_get_resource_end_tag(operand0, &end_tag); 180 - if (ACPI_FAILURE(status)) { 181 - return_ACPI_STATUS(status); 182 - } 183 - 184 - length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer); 185 - 186 - /* Get the length of the second resource template */ 187 - 188 - status = acpi_ut_get_resource_end_tag(operand1, &end_tag); 189 - if (ACPI_FAILURE(status)) { 190 - return_ACPI_STATUS(status); 191 - } 192 - 193 - length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer); 194 - 195 - /* Combine both lengths, minimum size will be 2 for end_tag */ 196 - 197 - new_length = length0 + length1 + sizeof(struct aml_resource_end_tag); 198 - 199 - /* Create a new buffer object for the result (with one end_tag) */ 200 - 201 - return_desc = acpi_ut_create_buffer_object(new_length); 202 - if (!return_desc) { 203 - return_ACPI_STATUS(AE_NO_MEMORY); 204 - } 205 - 206 - /* 207 - * Copy the templates to the new buffer, 0 first, then 1 follows. One 208 - * end_tag descriptor is copied from Operand1. 209 - */ 210 - new_buf = return_desc->buffer.pointer; 211 - memcpy(new_buf, operand0->buffer.pointer, length0); 212 - memcpy(new_buf + length0, operand1->buffer.pointer, length1); 213 - 214 - /* Insert end_tag and set the checksum to zero, means "ignore checksum" */ 215 - 216 - new_buf[new_length - 1] = 0; 217 - new_buf[new_length - 2] = ACPI_RESOURCE_NAME_END_TAG | 1; 218 - 219 - /* Return the completed resource template */ 220 - 221 - *actual_return_desc = return_desc; 222 - return_ACPI_STATUS(AE_OK); 223 - } 224 - 225 - /******************************************************************************* 226 - * 227 - * FUNCTION: acpi_ex_do_concatenate 228 - * 229 - * PARAMETERS: operand0 - First source object 230 - * operand1 - Second source object 231 - * actual_return_desc - Where to place the return object 232 - * walk_state - Current walk state 233 - * 234 - * RETURN: Status 235 - * 236 - * DESCRIPTION: Concatenate two objects OF THE SAME TYPE. 237 - * 238 - ******************************************************************************/ 239 - 240 - acpi_status 241 - acpi_ex_do_concatenate(union acpi_operand_object *operand0, 242 - union acpi_operand_object *operand1, 243 - union acpi_operand_object **actual_return_desc, 244 - struct acpi_walk_state *walk_state) 245 - { 246 - union acpi_operand_object *local_operand1 = operand1; 247 - union acpi_operand_object *return_desc; 248 - char *new_buf; 249 - const char *type_string; 250 - acpi_status status; 251 - 252 - ACPI_FUNCTION_TRACE(ex_do_concatenate); 253 - 254 - /* 255 - * Convert the second operand if necessary. The first operand 256 - * determines the type of the second operand, (See the Data Types 257 - * section of the ACPI specification.) Both object types are 258 - * guaranteed to be either Integer/String/Buffer by the operand 259 - * resolution mechanism. 260 - */ 261 - switch (operand0->common.type) { 262 - case ACPI_TYPE_INTEGER: 263 - 264 - status = 265 - acpi_ex_convert_to_integer(operand1, &local_operand1, 16); 266 - break; 267 - 268 - case ACPI_TYPE_STRING: 269 - /* 270 - * Per the ACPI spec, Concatenate only supports int/str/buf. 271 - * However, we support all objects here as an extension. 272 - * This improves the usefulness of the Printf() macro. 273 - * 12/2015. 274 - */ 275 - switch (operand1->common.type) { 276 - case ACPI_TYPE_INTEGER: 277 - case ACPI_TYPE_STRING: 278 - case ACPI_TYPE_BUFFER: 279 - 280 - status = 281 - acpi_ex_convert_to_string(operand1, &local_operand1, 282 - ACPI_IMPLICIT_CONVERT_HEX); 283 - break; 284 - 285 - default: 286 - /* 287 - * Just emit a string containing the object type. 288 - */ 289 - type_string = 290 - acpi_ut_get_type_name(operand1->common.type); 291 - 292 - local_operand1 = acpi_ut_create_string_object(((acpi_size) strlen(type_string) + 9)); /* 9 For "[Object]" */ 293 - if (!local_operand1) { 294 - status = AE_NO_MEMORY; 295 - goto cleanup; 296 - } 297 - 298 - strcpy(local_operand1->string.pointer, "["); 299 - strcat(local_operand1->string.pointer, type_string); 300 - strcat(local_operand1->string.pointer, " Object]"); 301 - status = AE_OK; 302 - break; 303 - } 304 - break; 305 - 306 - case ACPI_TYPE_BUFFER: 307 - 308 - status = acpi_ex_convert_to_buffer(operand1, &local_operand1); 309 - break; 310 - 311 - default: 312 - 313 - ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X", 314 - operand0->common.type)); 315 - status = AE_AML_INTERNAL; 316 - } 317 - 318 - if (ACPI_FAILURE(status)) { 319 - goto cleanup; 320 - } 321 - 322 - /* 323 - * Both operands are now known to be the same object type 324 - * (Both are Integer, String, or Buffer), and we can now perform the 325 - * concatenation. 326 - */ 327 - 328 - /* 329 - * There are three cases to handle: 330 - * 331 - * 1) Two Integers concatenated to produce a new Buffer 332 - * 2) Two Strings concatenated to produce a new String 333 - * 3) Two Buffers concatenated to produce a new Buffer 334 - */ 335 - switch (operand0->common.type) { 336 - case ACPI_TYPE_INTEGER: 337 - 338 - /* Result of two Integers is a Buffer */ 339 - /* Need enough buffer space for two integers */ 340 - 341 - return_desc = acpi_ut_create_buffer_object((acpi_size) 342 - ACPI_MUL_2 343 - (acpi_gbl_integer_byte_width)); 344 - if (!return_desc) { 345 - status = AE_NO_MEMORY; 346 - goto cleanup; 347 - } 348 - 349 - new_buf = (char *)return_desc->buffer.pointer; 350 - 351 - /* Copy the first integer, LSB first */ 352 - 353 - memcpy(new_buf, &operand0->integer.value, 354 - acpi_gbl_integer_byte_width); 355 - 356 - /* Copy the second integer (LSB first) after the first */ 357 - 358 - memcpy(new_buf + acpi_gbl_integer_byte_width, 359 - &local_operand1->integer.value, 360 - acpi_gbl_integer_byte_width); 361 - break; 362 - 363 - case ACPI_TYPE_STRING: 364 - 365 - /* Result of two Strings is a String */ 366 - 367 - return_desc = acpi_ut_create_string_object(((acpi_size) 368 - operand0->string. 369 - length + 370 - local_operand1-> 371 - string.length)); 372 - if (!return_desc) { 373 - status = AE_NO_MEMORY; 374 - goto cleanup; 375 - } 376 - 377 - new_buf = return_desc->string.pointer; 378 - 379 - /* Concatenate the strings */ 380 - 381 - strcpy(new_buf, operand0->string.pointer); 382 - strcat(new_buf, local_operand1->string.pointer); 383 - break; 384 - 385 - case ACPI_TYPE_BUFFER: 386 - 387 - /* Result of two Buffers is a Buffer */ 388 - 389 - return_desc = acpi_ut_create_buffer_object(((acpi_size) 390 - operand0->buffer. 391 - length + 392 - local_operand1-> 393 - buffer.length)); 394 - if (!return_desc) { 395 - status = AE_NO_MEMORY; 396 - goto cleanup; 397 - } 398 - 399 - new_buf = (char *)return_desc->buffer.pointer; 400 - 401 - /* Concatenate the buffers */ 402 - 403 - memcpy(new_buf, operand0->buffer.pointer, 404 - operand0->buffer.length); 405 - memcpy(new_buf + operand0->buffer.length, 406 - local_operand1->buffer.pointer, 407 - local_operand1->buffer.length); 408 - break; 409 - 410 - default: 411 - 412 - /* Invalid object type, should not happen here */ 413 - 414 - ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X", 415 - operand0->common.type)); 416 - status = AE_AML_INTERNAL; 417 - goto cleanup; 418 - } 419 - 420 - *actual_return_desc = return_desc; 421 - 422 - cleanup: 423 - if (local_operand1 != operand1) { 424 - acpi_ut_remove_reference(local_operand1); 425 - } 426 - return_ACPI_STATUS(status); 427 139 } 428 140 429 141 /*******************************************************************************
+6 -6
drivers/acpi/acpica/exutils.c
··· 301 301 * 302 302 * FUNCTION: acpi_ex_eisa_id_to_string 303 303 * 304 - * PARAMETERS: compressed_id - EISAID to be converted 305 - * out_string - Where to put the converted string (8 bytes) 304 + * PARAMETERS: out_string - Where to put the converted string (8 bytes) 305 + * compressed_id - EISAID to be converted 306 306 * 307 307 * RETURN: None 308 308 * ··· 354 354 * possible 64-bit integer. 355 355 * value - Value to be converted 356 356 * 357 - * RETURN: None, string 357 + * RETURN: Converted string in out_string 358 358 * 359 359 * DESCRIPTION: Convert a 64-bit integer to decimal string representation. 360 360 * Assumes string buffer is large enough to hold the string. The ··· 384 384 * FUNCTION: acpi_ex_pci_cls_to_string 385 385 * 386 386 * PARAMETERS: out_string - Where to put the converted string (7 bytes) 387 - * PARAMETERS: class_code - PCI class code to be converted (3 bytes) 387 + * class_code - PCI class code to be converted (3 bytes) 388 388 * 389 - * RETURN: None 389 + * RETURN: Converted string in out_string 390 390 * 391 391 * DESCRIPTION: Convert 3-bytes PCI class code to string representation. 392 392 * Return buffer must be large enough to hold the string. The ··· 417 417 * 418 418 * PARAMETERS: space_id - ID to be validated 419 419 * 420 - * RETURN: TRUE if valid/supported ID. 420 + * RETURN: TRUE if space_id is a valid/supported ID. 421 421 * 422 422 * DESCRIPTION: Validate an operation region space_ID. 423 423 *
+15 -10
drivers/acpi/acpica/hwregs.c
··· 83 83 acpi_hw_validate_register(struct acpi_generic_address *reg, 84 84 u8 max_bit_width, u64 *address) 85 85 { 86 + u8 bit_width; 87 + u8 access_width; 86 88 87 89 /* Must have a valid pointer to a GAS structure */ 88 90 ··· 111 109 return (AE_SUPPORT); 112 110 } 113 111 114 - /* Validate the bit_width */ 112 + /* Validate the access_width */ 115 113 116 - if ((reg->bit_width != 8) && 117 - (reg->bit_width != 16) && 118 - (reg->bit_width != 32) && (reg->bit_width != max_bit_width)) { 114 + if (reg->access_width > 4) { 119 115 ACPI_ERROR((AE_INFO, 120 - "Unsupported register bit width: 0x%X", 121 - reg->bit_width)); 116 + "Unsupported register access width: 0x%X", 117 + reg->access_width)); 122 118 return (AE_SUPPORT); 123 119 } 124 120 125 - /* Validate the bit_offset. Just a warning for now. */ 121 + /* Validate the bit_width, convert access_width into number of bits */ 126 122 127 - if (reg->bit_offset != 0) { 123 + access_width = reg->access_width ? reg->access_width : 1; 124 + access_width = 1 << (access_width + 2); 125 + bit_width = 126 + ACPI_ROUND_UP(reg->bit_offset + reg->bit_width, access_width); 127 + if (max_bit_width < bit_width) { 128 128 ACPI_WARNING((AE_INFO, 129 - "Unsupported register bit offset: 0x%X", 130 - reg->bit_offset)); 129 + "Requested bit width 0x%X is smaller than register bit width 0x%X", 130 + max_bit_width, bit_width)); 131 + return (AE_SUPPORT); 131 132 } 132 133 133 134 return (AE_OK);
+1 -3
drivers/acpi/acpica/hwxface.c
··· 504 504 * Evaluate the \_Sx namespace object containing the register values 505 505 * for this state 506 506 */ 507 - info->relative_pathname = ACPI_CAST_PTR(char, 508 - acpi_gbl_sleep_state_names 509 - [sleep_state]); 507 + info->relative_pathname = acpi_gbl_sleep_state_names[sleep_state]; 510 508 511 509 status = acpi_ns_evaluate(info); 512 510 if (ACPI_FAILURE(status)) {
+4 -3
drivers/acpi/acpica/nsaccess.c
··· 107 107 continue; 108 108 } 109 109 110 - status = acpi_ns_lookup(NULL, init_val->name, init_val->type, 111 - ACPI_IMODE_LOAD_PASS2, 112 - ACPI_NS_NO_UPSEARCH, NULL, &new_node); 110 + status = 111 + acpi_ns_lookup(NULL, (char *)init_val->name, init_val->type, 112 + ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, 113 + NULL, &new_node); 113 114 if (ACPI_FAILURE(status)) { 114 115 ACPI_EXCEPTION((AE_INFO, status, 115 116 "Could not create predefined name %s",
+2 -1
drivers/acpi/acpica/nsconvert.c
··· 79 79 /* String-to-Integer conversion */ 80 80 81 81 status = acpi_ut_strtoul64(original_object->string.pointer, 82 - ACPI_ANY_BASE, &value); 82 + ACPI_ANY_BASE, 83 + acpi_gbl_integer_byte_width, &value); 83 84 if (ACPI_FAILURE(status)) { 84 85 return (status); 85 86 }
+7 -2
drivers/acpi/acpica/nsdump.c
··· 81 81 * 82 82 ******************************************************************************/ 83 83 84 - void acpi_ns_print_pathname(u32 num_segments, char *pathname) 84 + void acpi_ns_print_pathname(u32 num_segments, const char *pathname) 85 85 { 86 86 u32 i; 87 87 ··· 114 114 acpi_os_printf("]\n"); 115 115 } 116 116 117 + #ifdef ACPI_OBSOLETE_FUNCTIONS 118 + /* Not used at this time, perhaps later */ 119 + 117 120 /******************************************************************************* 118 121 * 119 122 * FUNCTION: acpi_ns_dump_pathname ··· 134 131 ******************************************************************************/ 135 132 136 133 void 137 - acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component) 134 + acpi_ns_dump_pathname(acpi_handle handle, 135 + const char *msg, u32 level, u32 component) 138 136 { 139 137 140 138 ACPI_FUNCTION_TRACE(ns_dump_pathname); ··· 152 148 acpi_os_printf("\n"); 153 149 return_VOID; 154 150 } 151 + #endif 155 152 156 153 /******************************************************************************* 157 154 *
+52 -20
drivers/acpi/acpica/nsinit.c
··· 140 140 { 141 141 acpi_status status = AE_OK; 142 142 struct acpi_device_walk_info info; 143 + acpi_handle handle; 143 144 144 145 ACPI_FUNCTION_TRACE(ns_initialize_devices); 145 146 ··· 191 190 if (ACPI_SUCCESS(status)) { 192 191 info.num_INI++; 193 192 } 193 + 194 + /* 195 + * Execute \_SB._INI. 196 + * There appears to be a strict order requirement for \_SB._INI, 197 + * which should be evaluated before any _REG evaluations. 198 + */ 199 + status = acpi_get_handle(NULL, "\\_SB", &handle); 200 + if (ACPI_SUCCESS(status)) { 201 + memset(info.evaluate_info, 0, 202 + sizeof(struct acpi_evaluate_info)); 203 + info.evaluate_info->prefix_node = handle; 204 + info.evaluate_info->relative_pathname = 205 + METHOD_NAME__INI; 206 + info.evaluate_info->parameters = NULL; 207 + info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE; 208 + 209 + status = acpi_ns_evaluate(info.evaluate_info); 210 + if (ACPI_SUCCESS(status)) { 211 + info.num_INI++; 212 + } 213 + } 194 214 } 195 215 196 216 /* ··· 220 198 * Note: Any objects accessed by the _REG methods will be automatically 221 199 * initialized, even if they contain executable AML (see the call to 222 200 * acpi_ns_initialize_objects below). 201 + * 202 + * Note: According to the ACPI specification, we actually needn't execute 203 + * _REG for system_memory/system_io operation regions, but for PCI_Config 204 + * operation regions, it is required to evaluate _REG for those on a PCI 205 + * root bus that doesn't contain _BBN object. So this code is kept here 206 + * in order not to break things. 223 207 */ 224 208 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { 225 209 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ··· 620 592 * Note: We know there is an _INI within this subtree, but it may not be 621 593 * under this particular device, it may be lower in the branch. 622 594 */ 623 - ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname 624 - (ACPI_TYPE_METHOD, device_node, METHOD_NAME__INI)); 595 + if (!ACPI_COMPARE_NAME(device_node->name.ascii, "_SB_") || 596 + device_node->parent != acpi_gbl_root_node) { 597 + ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname 598 + (ACPI_TYPE_METHOD, device_node, 599 + METHOD_NAME__INI)); 625 600 626 - memset(info, 0, sizeof(struct acpi_evaluate_info)); 627 - info->prefix_node = device_node; 628 - info->relative_pathname = METHOD_NAME__INI; 629 - info->parameters = NULL; 630 - info->flags = ACPI_IGNORE_RETURN_VALUE; 601 + memset(info, 0, sizeof(struct acpi_evaluate_info)); 602 + info->prefix_node = device_node; 603 + info->relative_pathname = METHOD_NAME__INI; 604 + info->parameters = NULL; 605 + info->flags = ACPI_IGNORE_RETURN_VALUE; 631 606 632 - status = acpi_ns_evaluate(info); 633 - 634 - if (ACPI_SUCCESS(status)) { 635 - walk_info->num_INI++; 636 - } 607 + status = acpi_ns_evaluate(info); 608 + if (ACPI_SUCCESS(status)) { 609 + walk_info->num_INI++; 610 + } 637 611 #ifdef ACPI_DEBUG_OUTPUT 638 - else if (status != AE_NOT_FOUND) { 612 + else if (status != AE_NOT_FOUND) { 639 613 640 - /* Ignore error and move on to next device */ 614 + /* Ignore error and move on to next device */ 641 615 642 - char *scope_name = 643 - acpi_ns_get_normalized_pathname(device_node, TRUE); 616 + char *scope_name = 617 + acpi_ns_get_normalized_pathname(device_node, TRUE); 644 618 645 - ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution", 646 - scope_name)); 647 - ACPI_FREE(scope_name); 648 - } 619 + ACPI_EXCEPTION((AE_INFO, status, 620 + "during %s._INI execution", 621 + scope_name)); 622 + ACPI_FREE(scope_name); 623 + } 649 624 #endif 625 + } 650 626 651 627 /* Ignore errors from above */ 652 628
+1 -1
drivers/acpi/acpica/nsload.c
··· 123 123 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 124 124 acpi_ns_delete_namespace_by_owner(acpi_gbl_root_table_list. 125 125 tables[table_index].owner_id); 126 - acpi_tb_release_owner_id(table_index); 127 126 127 + acpi_tb_release_owner_id(table_index); 128 128 return_ACPI_STATUS(status); 129 129 } 130 130
+6
drivers/acpi/acpica/nsprepkg.c
··· 179 179 if (ACPI_FAILURE(status)) { 180 180 return (status); 181 181 } 182 + 182 183 elements++; 183 184 } 184 185 break; ··· 226 225 return (status); 227 226 } 228 227 } 228 + 229 229 elements++; 230 230 } 231 231 break; ··· 571 569 if (sub_package->package.count < expected_count) { 572 570 goto package_too_small; 573 571 } 572 + 574 573 if (sub_package->package.count < 575 574 package->ret_info.count1) { 576 575 expected_count = package->ret_info.count1; 577 576 goto package_too_small; 578 577 } 578 + 579 579 if (expected_count == 0) { 580 580 /* 581 581 * Either the num_entries element was originally zero or it was ··· 665 661 if (ACPI_FAILURE(status)) { 666 662 return (status); 667 663 } 664 + 668 665 this_element++; 669 666 } 670 667 ··· 676 671 if (ACPI_FAILURE(status)) { 677 672 return (status); 678 673 } 674 + 679 675 this_element++; 680 676 } 681 677
+1 -1
drivers/acpi/acpica/psopinfo.c
··· 158 158 * 159 159 ******************************************************************************/ 160 160 161 - char *acpi_ps_get_opcode_name(u16 opcode) 161 + const char *acpi_ps_get_opcode_name(u16 opcode) 162 162 { 163 163 #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) 164 164
+21 -29
drivers/acpi/acpica/rsdump.c
··· 52 52 * All functions in this module are used by the AML Debugger only 53 53 */ 54 54 /* Local prototypes */ 55 - static void acpi_rs_out_string(char *title, char *value); 55 + static void acpi_rs_out_string(const char *title, const char *value); 56 56 57 - static void acpi_rs_out_integer8(char *title, u8 value); 57 + static void acpi_rs_out_integer8(const char *title, u8 value); 58 58 59 - static void acpi_rs_out_integer16(char *title, u16 value); 59 + static void acpi_rs_out_integer16(const char *title, u16 value); 60 60 61 - static void acpi_rs_out_integer32(char *title, u32 value); 61 + static void acpi_rs_out_integer32(const char *title, u32 value); 62 62 63 - static void acpi_rs_out_integer64(char *title, u64 value); 63 + static void acpi_rs_out_integer64(const char *title, u64 value); 64 64 65 - static void acpi_rs_out_title(char *title); 65 + static void acpi_rs_out_title(const char *title); 66 66 67 67 static void acpi_rs_dump_byte_list(u16 length, u8 *data); 68 68 ··· 208 208 { 209 209 u8 *target = NULL; 210 210 u8 *previous_target; 211 - char *name; 211 + const char *name; 212 212 u8 count; 213 213 214 214 /* First table entry must contain the table length (# of table entries) */ ··· 248 248 case ACPI_RSD_UINT8: 249 249 250 250 if (table->pointer) { 251 - acpi_rs_out_string(name, ACPI_CAST_PTR(char, 252 - table-> 253 - pointer 254 - [*target])); 251 + acpi_rs_out_string(name, 252 + table->pointer[*target]); 255 253 } else { 256 254 acpi_rs_out_integer8(name, ACPI_GET8(target)); 257 255 } ··· 274 276 275 277 case ACPI_RSD_1BITFLAG: 276 278 277 - acpi_rs_out_string(name, ACPI_CAST_PTR(char, 278 - table-> 279 - pointer[*target & 280 - 0x01])); 279 + acpi_rs_out_string(name, 280 + table->pointer[*target & 0x01]); 281 281 break; 282 282 283 283 case ACPI_RSD_2BITFLAG: 284 284 285 - acpi_rs_out_string(name, ACPI_CAST_PTR(char, 286 - table-> 287 - pointer[*target & 288 - 0x03])); 285 + acpi_rs_out_string(name, 286 + table->pointer[*target & 0x03]); 289 287 break; 290 288 291 289 case ACPI_RSD_3BITFLAG: 292 290 293 - acpi_rs_out_string(name, ACPI_CAST_PTR(char, 294 - table-> 295 - pointer[*target & 296 - 0x07])); 291 + acpi_rs_out_string(name, 292 + table->pointer[*target & 0x07]); 297 293 break; 298 294 299 295 case ACPI_RSD_SHORTLIST: ··· 473 481 * 474 482 ******************************************************************************/ 475 483 476 - static void acpi_rs_out_string(char *title, char *value) 484 + static void acpi_rs_out_string(const char *title, const char *value) 477 485 { 478 486 479 487 acpi_os_printf("%27s : %s", title, value); ··· 483 491 acpi_os_printf("\n"); 484 492 } 485 493 486 - static void acpi_rs_out_integer8(char *title, u8 value) 494 + static void acpi_rs_out_integer8(const char *title, u8 value) 487 495 { 488 496 acpi_os_printf("%27s : %2.2X\n", title, value); 489 497 } 490 498 491 - static void acpi_rs_out_integer16(char *title, u16 value) 499 + static void acpi_rs_out_integer16(const char *title, u16 value) 492 500 { 493 501 494 502 acpi_os_printf("%27s : %4.4X\n", title, value); 495 503 } 496 504 497 - static void acpi_rs_out_integer32(char *title, u32 value) 505 + static void acpi_rs_out_integer32(const char *title, u32 value) 498 506 { 499 507 500 508 acpi_os_printf("%27s : %8.8X\n", title, value); 501 509 } 502 510 503 - static void acpi_rs_out_integer64(char *title, u64 value) 511 + static void acpi_rs_out_integer64(const char *title, u64 value) 504 512 { 505 513 506 514 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value)); 507 515 } 508 516 509 - static void acpi_rs_out_title(char *title) 517 + static void acpi_rs_out_title(const char *title) 510 518 { 511 519 512 520 acpi_os_printf("%27s : ", title);
+1 -1
drivers/acpi/acpica/rsutils.c
··· 671 671 672 672 acpi_status 673 673 acpi_rs_get_method_data(acpi_handle handle, 674 - char *path, struct acpi_buffer *ret_buffer) 674 + const char *path, struct acpi_buffer *ret_buffer) 675 675 { 676 676 union acpi_operand_object *obj_desc; 677 677 acpi_status status;
+15 -11
drivers/acpi/acpica/tbfadt.c
··· 53 53 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, 54 54 u8 space_id, 55 55 u8 byte_width, 56 - u64 address, char *register_name, u8 flags); 56 + u64 address, const char *register_name, u8 flags); 57 57 58 58 static void acpi_tb_convert_fadt(void); 59 59 ··· 65 65 /* Table for conversion of FADT to common internal format and FADT validation */ 66 66 67 67 typedef struct acpi_fadt_info { 68 - char *name; 68 + const char *name; 69 69 u16 address64; 70 70 u16 address32; 71 71 u16 length; ··· 192 192 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, 193 193 u8 space_id, 194 194 u8 byte_width, 195 - u64 address, char *register_name, u8 flags) 195 + u64 address, const char *register_name, u8 flags) 196 196 { 197 197 u8 bit_width; 198 198 ··· 385 385 { 386 386 /* 387 387 * Check if the FADT is larger than the largest table that we expect 388 - * (the ACPI 5.0 version). If so, truncate the table, and issue 389 - * a warning. 388 + * (typically the current ACPI specification version). If so, truncate 389 + * the table, and issue a warning. 390 390 */ 391 391 if (length > sizeof(struct acpi_table_fadt)) { 392 392 ACPI_BIOS_WARNING((AE_INFO, 393 - "FADT (revision %u) is longer than ACPI 5.0 version, " 393 + "FADT (revision %u) is longer than %s length, " 394 394 "truncating length %u to %u", 395 - table->revision, length, 395 + table->revision, ACPI_FADT_CONFORMANCE, 396 + length, 396 397 (u32)sizeof(struct acpi_table_fadt))); 397 398 } 398 399 ··· 468 467 469 468 static void acpi_tb_convert_fadt(void) 470 469 { 471 - char *name; 470 + const char *name; 472 471 struct acpi_generic_address *address64; 473 472 u32 address32; 474 473 u8 length; ··· 647 646 if ((address64->address && !length) || 648 647 (!address64->address && length)) { 649 648 ACPI_BIOS_WARNING((AE_INFO, 650 - "Optional FADT field %s has zero address or length: " 651 - "0x%8.8X%8.8X/0x%X", 652 - name, 649 + "Optional FADT field %s has valid %s but zero %s: " 650 + "0x%8.8X%8.8X/0x%X", name, 651 + (length ? "Length" : 652 + "Address"), 653 + (length ? "Address" : 654 + "Length"), 653 655 ACPI_FORMAT_UINT64 654 656 (address64->address), 655 657 length));
+1 -1
drivers/acpi/acpica/tbxfload.c
··· 82 82 * their customized default region handlers. 83 83 */ 84 84 status = acpi_ev_install_region_handlers(); 85 - if (ACPI_FAILURE(status) && status != AE_ALREADY_EXISTS) { 85 + if (ACPI_FAILURE(status)) { 86 86 ACPI_EXCEPTION((AE_INFO, status, 87 87 "During Region initialization")); 88 88 return_ACPI_STATUS(status);
+23 -24
drivers/acpi/acpica/utdebug.c
··· 51 51 ACPI_MODULE_NAME("utdebug") 52 52 53 53 #ifdef ACPI_DEBUG_OUTPUT 54 - static acpi_thread_id acpi_gbl_prev_thread_id = (acpi_thread_id) 0xFFFFFFFF; 55 - static char *acpi_gbl_fn_entry_str = "----Entry"; 56 - static char *acpi_gbl_fn_exit_str = "----Exit-"; 57 - 58 - /* Local prototypes */ 59 - 60 - static const char *acpi_ut_trim_function_name(const char *function_name); 54 + static acpi_thread_id acpi_gbl_previous_thread_id = (acpi_thread_id) 0xFFFFFFFF; 55 + static const char *acpi_gbl_function_entry_prefix = "----Entry"; 56 + static const char *acpi_gbl_function_exit_prefix = "----Exit-"; 61 57 62 58 /******************************************************************************* 63 59 * ··· 174 178 * Thread tracking and context switch notification 175 179 */ 176 180 thread_id = acpi_os_get_thread_id(); 177 - if (thread_id != acpi_gbl_prev_thread_id) { 181 + if (thread_id != acpi_gbl_previous_thread_id) { 178 182 if (ACPI_LV_THREADS & acpi_dbg_level) { 179 183 acpi_os_printf 180 184 ("\n**** Context Switch from TID %u to TID %u ****\n\n", 181 - (u32)acpi_gbl_prev_thread_id, (u32)thread_id); 185 + (u32)acpi_gbl_previous_thread_id, (u32)thread_id); 182 186 } 183 187 184 - acpi_gbl_prev_thread_id = thread_id; 188 + acpi_gbl_previous_thread_id = thread_id; 185 189 acpi_gbl_nesting_level = 0; 186 190 } 187 191 ··· 283 287 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 284 288 acpi_debug_print(ACPI_LV_FUNCTIONS, 285 289 line_number, function_name, module_name, 286 - component_id, "%s\n", acpi_gbl_fn_entry_str); 290 + component_id, "%s\n", 291 + acpi_gbl_function_entry_prefix); 287 292 } 288 293 } 289 294 ··· 309 312 void 310 313 acpi_ut_trace_ptr(u32 line_number, 311 314 const char *function_name, 312 - const char *module_name, u32 component_id, void *pointer) 315 + const char *module_name, 316 + u32 component_id, const void *pointer) 313 317 { 314 318 315 319 acpi_gbl_nesting_level++; ··· 321 323 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 322 324 acpi_debug_print(ACPI_LV_FUNCTIONS, 323 325 line_number, function_name, module_name, 324 - component_id, "%s %p\n", acpi_gbl_fn_entry_str, 325 - pointer); 326 + component_id, "%s %p\n", 327 + acpi_gbl_function_entry_prefix, pointer); 326 328 } 327 329 } 328 330 ··· 346 348 void 347 349 acpi_ut_trace_str(u32 line_number, 348 350 const char *function_name, 349 - const char *module_name, u32 component_id, char *string) 351 + const char *module_name, u32 component_id, const char *string) 350 352 { 351 353 352 354 acpi_gbl_nesting_level++; ··· 357 359 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 358 360 acpi_debug_print(ACPI_LV_FUNCTIONS, 359 361 line_number, function_name, module_name, 360 - component_id, "%s %s\n", acpi_gbl_fn_entry_str, 361 - string); 362 + component_id, "%s %s\n", 363 + acpi_gbl_function_entry_prefix, string); 362 364 } 363 365 } 364 366 ··· 394 396 acpi_debug_print(ACPI_LV_FUNCTIONS, 395 397 line_number, function_name, module_name, 396 398 component_id, "%s %08X\n", 397 - acpi_gbl_fn_entry_str, integer); 399 + acpi_gbl_function_entry_prefix, integer); 398 400 } 399 401 } 400 402 ··· 425 427 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 426 428 acpi_debug_print(ACPI_LV_FUNCTIONS, 427 429 line_number, function_name, module_name, 428 - component_id, "%s\n", acpi_gbl_fn_exit_str); 430 + component_id, "%s\n", 431 + acpi_gbl_function_exit_prefix); 429 432 } 430 433 431 434 if (acpi_gbl_nesting_level) { ··· 466 467 acpi_debug_print(ACPI_LV_FUNCTIONS, 467 468 line_number, function_name, 468 469 module_name, component_id, "%s %s\n", 469 - acpi_gbl_fn_exit_str, 470 + acpi_gbl_function_exit_prefix, 470 471 acpi_format_exception(status)); 471 472 } else { 472 473 acpi_debug_print(ACPI_LV_FUNCTIONS, 473 474 line_number, function_name, 474 475 module_name, component_id, 475 476 "%s ****Exception****: %s\n", 476 - acpi_gbl_fn_exit_str, 477 + acpi_gbl_function_exit_prefix, 477 478 acpi_format_exception(status)); 478 479 } 479 480 } ··· 513 514 acpi_debug_print(ACPI_LV_FUNCTIONS, 514 515 line_number, function_name, module_name, 515 516 component_id, "%s %8.8X%8.8X\n", 516 - acpi_gbl_fn_exit_str, 517 + acpi_gbl_function_exit_prefix, 517 518 ACPI_FORMAT_UINT64(value)); 518 519 } 519 520 ··· 551 552 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 552 553 acpi_debug_print(ACPI_LV_FUNCTIONS, 553 554 line_number, function_name, module_name, 554 - component_id, "%s %p\n", acpi_gbl_fn_exit_str, 555 - ptr); 555 + component_id, "%s %p\n", 556 + acpi_gbl_function_exit_prefix, ptr); 556 557 } 557 558 558 559 if (acpi_gbl_nesting_level) {
+17 -13
drivers/acpi/acpica/utdecode.c
··· 446 446 447 447 /* Names for Notify() values, used for debug output */ 448 448 449 - static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = { 449 + static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = { 450 450 /* 00 */ "Bus Check", 451 451 /* 01 */ "Device Check", 452 452 /* 02 */ "Device Wake", ··· 459 459 /* 09 */ "Device PLD Check", 460 460 /* 0A */ "Reserved", 461 461 /* 0B */ "System Locality Update", 462 - /* 0C */ "Shutdown Request", 462 + /* 0C */ "Shutdown Request", 463 + /* Reserved in ACPI 6.0 */ 463 464 /* 0D */ "System Resource Affinity Update" 464 465 }; 465 466 466 - static const char *acpi_gbl_device_notify[4] = { 467 + static const char *acpi_gbl_device_notify[5] = { 467 468 /* 80 */ "Status Change", 468 469 /* 81 */ "Information Change", 469 470 /* 82 */ "Device-Specific Change", 470 - /* 83 */ "Device-Specific Change" 471 + /* 83 */ "Device-Specific Change", 472 + /* 84 */ "Reserved" 471 473 }; 472 474 473 - static const char *acpi_gbl_processor_notify[4] = { 475 + static const char *acpi_gbl_processor_notify[5] = { 474 476 /* 80 */ "Performance Capability Change", 475 477 /* 81 */ "C-State Change", 476 478 /* 82 */ "Throttling Capability Change", 477 - /* 83 */ "Device-Specific Change" 479 + /* 83 */ "Guaranteed Change", 480 + /* 84 */ "Minimum Excursion" 478 481 }; 479 482 480 - static const char *acpi_gbl_thermal_notify[4] = { 483 + static const char *acpi_gbl_thermal_notify[5] = { 481 484 /* 80 */ "Thermal Status Change", 482 485 /* 81 */ "Thermal Trip Point Change", 483 486 /* 82 */ "Thermal Device List Change", 484 - /* 83 */ "Thermal Relationship Change" 487 + /* 83 */ "Thermal Relationship Change", 488 + /* 84 */ "Reserved" 485 489 }; 486 490 487 491 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type) 488 492 { 489 493 490 - /* 00 - 0D are common to all object types */ 494 + /* 00 - 0D are "common to all object types" (from ACPI Spec) */ 491 495 492 - if (notify_value <= ACPI_NOTIFY_MAX) { 496 + if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) { 493 497 return (acpi_gbl_generic_notify[notify_value]); 494 498 } 495 499 496 - /* 0D - 7F are reserved */ 500 + /* 0E - 7F are reserved */ 497 501 498 502 if (notify_value <= ACPI_MAX_SYS_NOTIFY) { 499 503 return ("Reserved"); 500 504 } 501 505 502 - /* 80 - 83 are per-object-type */ 506 + /* 80 - 84 are per-object-type */ 503 507 504 - if (notify_value <= 0x83) { 508 + if (notify_value <= ACPI_SPECIFIC_NOTIFY_MAX) { 505 509 switch (type) { 506 510 case ACPI_TYPE_ANY: 507 511 case ACPI_TYPE_DEVICE:
+2 -2
drivers/acpi/acpica/uteval.c
··· 69 69 70 70 acpi_status 71 71 acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, 72 - char *path, 72 + const char *path, 73 73 u32 expected_return_btypes, 74 74 union acpi_operand_object **return_desc) 75 75 { ··· 204 204 ******************************************************************************/ 205 205 206 206 acpi_status 207 - acpi_ut_evaluate_numeric_object(char *object_name, 207 + acpi_ut_evaluate_numeric_object(const char *object_name, 208 208 struct acpi_namespace_node *device_node, 209 209 u64 *value) 210 210 {
+48
drivers/acpi/acpica/utglobal.c
··· 80 80 "_S4D" 81 81 }; 82 82 83 + /* Hex-to-ascii */ 84 + 85 + const char acpi_gbl_lower_hex_digits[] = "0123456789abcdef"; 86 + const char acpi_gbl_upper_hex_digits[] = "0123456789ABCDEF"; 87 + 83 88 /******************************************************************************* 84 89 * 85 90 * Namespace globals ··· 225 220 ACPI_BITMASK_RT_CLOCK_ENABLE}, 226 221 }; 227 222 #endif /* !ACPI_REDUCED_HARDWARE */ 223 + 224 + #if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER) 225 + 226 + /* to_pld macro: compile/disassemble strings */ 227 + 228 + const char *acpi_gbl_pld_panel_list[] = { 229 + "TOP", 230 + "BOTTOM", 231 + "LEFT", 232 + "RIGHT", 233 + "FRONT", 234 + "BACK", 235 + "UNKNOWN", 236 + NULL 237 + }; 238 + 239 + const char *acpi_gbl_pld_vertical_position_list[] = { 240 + "UPPER", 241 + "CENTER", 242 + "LOWER", 243 + NULL 244 + }; 245 + 246 + const char *acpi_gbl_pld_horizontal_position_list[] = { 247 + "LEFT", 248 + "CENTER", 249 + "RIGHT", 250 + NULL 251 + }; 252 + 253 + const char *acpi_gbl_pld_shape_list[] = { 254 + "ROUND", 255 + "OVAL", 256 + "SQUARE", 257 + "VERTICALRECTANGLE", 258 + "HORIZONTALRECTANGLE", 259 + "VERTICALTRAPEZOID", 260 + "HORIZONTALTRAPEZOID", 261 + "UNKNOWN", 262 + "CHAMFERED", 263 + NULL 264 + }; 265 + #endif 228 266 229 267 /* Public globals */ 230 268
+1 -1
drivers/acpi/acpica/utmisc.c
··· 361 361 void 362 362 acpi_ut_display_init_pathname(u8 type, 363 363 struct acpi_namespace_node *obj_handle, 364 - char *path) 364 + const char *path) 365 365 { 366 366 acpi_status status; 367 367 struct acpi_buffer buffer;
+37 -30
drivers/acpi/acpica/utnonansi.c
··· 205 205 * 206 206 * FUNCTION: acpi_ut_strtoul64 207 207 * 208 - * PARAMETERS: string - Null terminated string 209 - * base - Radix of the string: 16 or ACPI_ANY_BASE; 210 - * ACPI_ANY_BASE means 'in behalf of to_integer' 211 - * ret_integer - Where the converted integer is returned 208 + * PARAMETERS: string - Null terminated string 209 + * base - Radix of the string: 16 or 10 or 210 + * ACPI_ANY_BASE 211 + * max_integer_byte_width - Maximum allowable integer,in bytes: 212 + * 4 or 8 (32 or 64 bits) 213 + * ret_integer - Where the converted integer is 214 + * returned 212 215 * 213 216 * RETURN: Status and Converted value 214 217 * 215 218 * DESCRIPTION: Convert a string into an unsigned value. Performs either a 216 - * 32-bit or 64-bit conversion, depending on the current mode 217 - * of the interpreter. 219 + * 32-bit or 64-bit conversion, depending on the input integer 220 + * size (often the current mode of the interpreter). 218 221 * 219 - * NOTES: acpi_gbl_integer_byte_width should be set to the proper width. 222 + * NOTES: Negative numbers are not supported, as they are not supported 223 + * by ACPI. 224 + * 225 + * acpi_gbl_integer_byte_width should be set to the proper width. 220 226 * For the core ACPICA code, this width depends on the DSDT 221 - * version. For iASL, the default byte width is always 8. 227 + * version. For iASL, the default byte width is always 8 for the 228 + * parser, but error checking is performed later to flag cases 229 + * where a 64-bit constant is defined in a 32-bit DSDT/SSDT. 222 230 * 223 231 * Does not support Octal strings, not needed at this time. 224 232 * 225 - * There is an earlier version of the function after this one, 226 - * below. It is slightly different than this one, and the two 227 - * may eventually may need to be merged. (01/2016). 228 - * 229 233 ******************************************************************************/ 230 234 231 - acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) 235 + acpi_status 236 + acpi_ut_strtoul64(char *string, 237 + u32 base, u32 max_integer_byte_width, u64 *ret_integer) 232 238 { 233 239 u32 this_digit = 0; 234 240 u64 return_value = 0; 235 241 u64 quotient; 236 242 u64 dividend; 237 - u32 to_integer_op = (base == ACPI_ANY_BASE); 238 - u32 mode32 = (acpi_gbl_integer_byte_width == 4); 239 243 u8 valid_digits = 0; 240 244 u8 sign_of0x = 0; 241 245 u8 term = 0; ··· 248 244 249 245 switch (base) { 250 246 case ACPI_ANY_BASE: 247 + case 10: 251 248 case 16: 252 249 253 250 break; ··· 270 265 string++; 271 266 } 272 267 273 - if (to_integer_op) { 268 + if (base == ACPI_ANY_BASE) { 274 269 /* 275 - * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. 270 + * Base equal to ACPI_ANY_BASE means 'Either decimal or hex'. 276 271 * We need to determine if it is decimal or hexadecimal. 277 272 */ 278 273 if ((*string == '0') && (tolower((int)*(string + 1)) == 'x')) { ··· 289 284 /* Any string left? Check that '0x' is not followed by white space. */ 290 285 291 286 if (!(*string) || isspace((int)*string) || *string == '\t') { 292 - if (to_integer_op) { 287 + if (base == ACPI_ANY_BASE) { 293 288 goto error_exit; 294 289 } else { 295 290 goto all_done; ··· 297 292 } 298 293 299 294 /* 300 - * Perform a 32-bit or 64-bit conversion, depending upon the current 301 - * execution mode of the interpreter 295 + * Perform a 32-bit or 64-bit conversion, depending upon the input 296 + * byte width 302 297 */ 303 - dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; 298 + dividend = (max_integer_byte_width <= ACPI_MAX32_BYTE_WIDTH) ? 299 + ACPI_UINT32_MAX : ACPI_UINT64_MAX; 304 300 305 301 /* Main loop: convert the string to a 32- or 64-bit integer */ 306 302 ··· 329 323 } 330 324 331 325 if (term) { 332 - if (to_integer_op) { 326 + if (base == ACPI_ANY_BASE) { 333 327 goto error_exit; 334 328 } else { 335 329 break; ··· 344 338 345 339 valid_digits++; 346 340 347 - if (sign_of0x 348 - && ((valid_digits > 16) 349 - || ((valid_digits > 8) && mode32))) { 341 + if (sign_of0x && ((valid_digits > 16) || 342 + ((valid_digits > 8) 343 + && (max_integer_byte_width <= 344 + ACPI_MAX32_BYTE_WIDTH)))) { 350 345 /* 351 346 * This is to_integer operation case. 352 - * No any restrictions for string-to-integer conversion, 347 + * No restrictions for string-to-integer conversion, 353 348 * see ACPI spec. 354 349 */ 355 350 goto error_exit; ··· 362 355 &quotient, NULL); 363 356 364 357 if (return_value > quotient) { 365 - if (to_integer_op) { 358 + if (base == ACPI_ANY_BASE) { 366 359 goto error_exit; 367 360 } else { 368 361 break; ··· 385 378 return_ACPI_STATUS(AE_OK); 386 379 387 380 error_exit: 388 - /* Base was set/validated above */ 381 + 382 + /* Base was set/validated above (10 or 16) */ 389 383 390 384 if (base == 10) { 391 385 return_ACPI_STATUS(AE_BAD_DECIMAL_CONSTANT); ··· 396 388 } 397 389 398 390 #ifdef _OBSOLETE_FUNCTIONS 399 - /* TBD: use version in ACPICA main code base? */ 400 - /* DONE: 01/2016 */ 391 + /* Removed: 01/2016 */ 401 392 402 393 /******************************************************************************* 403 394 *
-5
drivers/acpi/acpica/utprint.c
··· 67 67 68 68 static char *acpi_ut_put_number(char *string, u64 number, u8 base, u8 upper); 69 69 70 - /* Module globals */ 71 - 72 - static const char acpi_gbl_lower_hex_digits[] = "0123456789abcdef"; 73 - static const char acpi_gbl_upper_hex_digits[] = "0123456789ABCDEF"; 74 - 75 70 /******************************************************************************* 76 71 * 77 72 * FUNCTION: acpi_ut_bound_string_length
+1 -1
drivers/acpi/acpica/uttrack.c
··· 90 90 ******************************************************************************/ 91 91 92 92 acpi_status 93 - acpi_ut_create_list(char *list_name, 93 + acpi_ut_create_list(const char *list_name, 94 94 u16 object_size, struct acpi_memory_list **return_cache) 95 95 { 96 96 struct acpi_memory_list *cache;
+58 -7
drivers/acpi/nfit.c
··· 861 861 { 862 862 struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 863 863 864 - return sprintf(buf, "%#x\n", dcr->vendor_id); 864 + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->vendor_id)); 865 865 } 866 866 static DEVICE_ATTR_RO(vendor); 867 867 ··· 870 870 { 871 871 struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 872 872 873 - return sprintf(buf, "%#x\n", dcr->revision_id); 873 + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->revision_id)); 874 874 } 875 875 static DEVICE_ATTR_RO(rev_id); 876 876 ··· 879 879 { 880 880 struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 881 881 882 - return sprintf(buf, "%#x\n", dcr->device_id); 882 + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->device_id)); 883 883 } 884 884 static DEVICE_ATTR_RO(device); 885 + 886 + static ssize_t subsystem_vendor_show(struct device *dev, 887 + struct device_attribute *attr, char *buf) 888 + { 889 + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 890 + 891 + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->subsystem_vendor_id)); 892 + } 893 + static DEVICE_ATTR_RO(subsystem_vendor); 894 + 895 + static ssize_t subsystem_rev_id_show(struct device *dev, 896 + struct device_attribute *attr, char *buf) 897 + { 898 + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 899 + 900 + return sprintf(buf, "0x%04x\n", 901 + be16_to_cpu(dcr->subsystem_revision_id)); 902 + } 903 + static DEVICE_ATTR_RO(subsystem_rev_id); 904 + 905 + static ssize_t subsystem_device_show(struct device *dev, 906 + struct device_attribute *attr, char *buf) 907 + { 908 + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 909 + 910 + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->subsystem_device_id)); 911 + } 912 + static DEVICE_ATTR_RO(subsystem_device); 885 913 886 914 static int num_nvdimm_formats(struct nvdimm *nvdimm) 887 915 { ··· 928 900 { 929 901 struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 930 902 931 - return sprintf(buf, "%#x\n", dcr->code); 903 + return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->code)); 932 904 } 933 905 static DEVICE_ATTR_RO(format); 934 906 ··· 961 933 continue; 962 934 if (nfit_dcr->dcr->code == dcr->code) 963 935 continue; 964 - rc = sprintf(buf, "%#x\n", nfit_dcr->dcr->code); 936 + rc = sprintf(buf, "%#x\n", 937 + be16_to_cpu(nfit_dcr->dcr->code)); 965 938 break; 966 939 } 967 940 if (rc != ENXIO) ··· 987 958 { 988 959 struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 989 960 990 - return sprintf(buf, "%#x\n", dcr->serial_number); 961 + return sprintf(buf, "0x%08x\n", be32_to_cpu(dcr->serial_number)); 991 962 } 992 963 static DEVICE_ATTR_RO(serial); 993 964 ··· 1029 1000 } 1030 1001 static DEVICE_ATTR_RO(flags); 1031 1002 1003 + static ssize_t id_show(struct device *dev, 1004 + struct device_attribute *attr, char *buf) 1005 + { 1006 + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev); 1007 + 1008 + if (dcr->valid_fields & ACPI_NFIT_CONTROL_MFG_INFO_VALID) 1009 + return sprintf(buf, "%04x-%02x-%04x-%08x\n", 1010 + be16_to_cpu(dcr->vendor_id), 1011 + dcr->manufacturing_location, 1012 + be16_to_cpu(dcr->manufacturing_date), 1013 + be32_to_cpu(dcr->serial_number)); 1014 + else 1015 + return sprintf(buf, "%04x-%08x\n", 1016 + be16_to_cpu(dcr->vendor_id), 1017 + be32_to_cpu(dcr->serial_number)); 1018 + } 1019 + static DEVICE_ATTR_RO(id); 1020 + 1032 1021 static struct attribute *acpi_nfit_dimm_attributes[] = { 1033 1022 &dev_attr_handle.attr, 1034 1023 &dev_attr_phys_id.attr, 1035 1024 &dev_attr_vendor.attr, 1036 1025 &dev_attr_device.attr, 1026 + &dev_attr_rev_id.attr, 1027 + &dev_attr_subsystem_vendor.attr, 1028 + &dev_attr_subsystem_device.attr, 1029 + &dev_attr_subsystem_rev_id.attr, 1037 1030 &dev_attr_format.attr, 1038 1031 &dev_attr_formats.attr, 1039 1032 &dev_attr_format1.attr, 1040 1033 &dev_attr_serial.attr, 1041 - &dev_attr_rev_id.attr, 1042 1034 &dev_attr_flags.attr, 1035 + &dev_attr_id.attr, 1043 1036 &dev_attr_family.attr, 1044 1037 &dev_attr_dsm_mask.attr, 1045 1038 NULL,
+7 -5
drivers/acpi/nfit.h
··· 52 52 NFIT_UUID_MAX, 53 53 }; 54 54 55 - enum nfit_fic { 56 - NFIT_FIC_BYTE = 0x101, /* byte-addressable energy backed */ 57 - NFIT_FIC_BLK = 0x201, /* block-addressable non-energy backed */ 58 - NFIT_FIC_BYTEN = 0x301, /* byte-addressable non-energy backed */ 59 - }; 55 + /* 56 + * Region format interface codes are stored as an array of bytes in the 57 + * NFIT DIMM Control Region structure 58 + */ 59 + #define NFIT_FIC_BYTE cpu_to_be16(0x101) /* byte-addressable energy backed */ 60 + #define NFIT_FIC_BLK cpu_to_be16(0x201) /* block-addressable non-energy backed */ 61 + #define NFIT_FIC_BYTEN cpu_to_be16(0x301) /* byte-addressable non-energy backed */ 60 62 61 63 enum { 62 64 NFIT_BLK_READ_FLUSH = 1,
+1 -1
drivers/acpi/osl.c
··· 582 582 583 583 acpi_status 584 584 acpi_os_predefined_override(const struct acpi_predefined_names *init_val, 585 - char **new_val) 585 + acpi_string *new_val) 586 586 { 587 587 if (!init_val || !new_val) 588 588 return AE_BAD_PARAMETER;
+1 -1
include/acpi/acpiosxf.h
··· 96 96 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_predefined_override 97 97 acpi_status 98 98 acpi_os_predefined_override(const struct acpi_predefined_names *init_val, 99 - char **new_val); 99 + acpi_string *new_val); 100 100 #endif 101 101 102 102 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_table_override
+1 -1
include/acpi/acpixf.h
··· 46 46 47 47 /* Current ACPICA subsystem version in YYYYMMDD format */ 48 48 49 - #define ACPI_CA_VERSION 0x20160108 49 + #define ACPI_CA_VERSION 0x20160318 50 50 51 51 #include <acpi/acconfig.h> 52 52 #include <acpi/actypes.h>
+3 -1
include/acpi/actbl.h
··· 223 223 /******************************************************************************* 224 224 * 225 225 * FADT - Fixed ACPI Description Table (Signature "FACP") 226 - * Version 4 226 + * Version 6 227 227 * 228 228 ******************************************************************************/ 229 229 ··· 412 412 #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) 413 413 #define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id)) 414 414 #define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt)) 415 + 416 + #define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)" 415 417 416 418 #endif /* __ACTBL_H__ */
+67 -7
include/acpi/actbl1.h
··· 236 236 ACPI_EINJ_CHECK_BUSY_STATUS = 6, 237 237 ACPI_EINJ_GET_COMMAND_STATUS = 7, 238 238 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, 239 - ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */ 239 + ACPI_EINJ_GET_EXECUTE_TIMINGS = 9, 240 + ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */ 240 241 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ 241 242 }; 242 243 ··· 349 348 ACPI_ERST_GET_ERROR_RANGE = 13, 350 349 ACPI_ERST_GET_ERROR_LENGTH = 14, 351 350 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15, 352 - ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */ 351 + ACPI_ERST_EXECUTE_TIMINGS = 16, 352 + ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */ 353 353 }; 354 354 355 355 /* Values for Instruction field above */ ··· 429 427 ACPI_HEST_TYPE_AER_ENDPOINT = 7, 430 428 ACPI_HEST_TYPE_AER_BRIDGE = 8, 431 429 ACPI_HEST_TYPE_GENERIC_ERROR = 9, 432 - ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */ 430 + ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10, 431 + ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */ 433 432 }; 434 433 435 434 /* ··· 509 506 ACPI_HEST_NOTIFY_NMI = 4, 510 507 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ 511 508 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ 512 - ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */ 509 + ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */ 510 + ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */ 511 + ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */ 512 + ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */ 513 + ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */ 513 514 }; 514 515 515 516 /* Values for config_write_enable bitfield above */ ··· 610 603 u32 error_block_length; 611 604 }; 612 605 606 + /* 10: Generic Hardware Error Source, version 2 */ 607 + 608 + struct acpi_hest_generic_v2 { 609 + struct acpi_hest_header header; 610 + u16 related_source_id; 611 + u8 reserved; 612 + u8 enabled; 613 + u32 records_to_preallocate; 614 + u32 max_sections_per_record; 615 + u32 max_raw_data_length; 616 + struct acpi_generic_address error_status_address; 617 + struct acpi_hest_notify notify; 618 + u32 error_block_length; 619 + struct acpi_generic_address read_ack_register; 620 + u64 read_ack_preserve; 621 + u64 read_ack_write; 622 + }; 623 + 613 624 /* Generic Error Status block */ 614 625 615 626 struct acpi_hest_generic_status { ··· 658 633 u8 fru_id[16]; 659 634 u8 fru_text[20]; 660 635 }; 636 + 637 + /* Extension for revision 0x0300 */ 638 + 639 + struct acpi_hest_generic_data_v300 { 640 + u8 section_type[16]; 641 + u32 error_severity; 642 + u16 revision; 643 + u8 validation_bits; 644 + u8 flags; 645 + u32 error_data_length; 646 + u8 fru_id[16]; 647 + u8 fru_text[20]; 648 + u64 time_stamp; 649 + }; 650 + 651 + /* Values for error_severity above */ 652 + 653 + #define ACPI_HEST_GEN_ERROR_RECOVERABLE 0 654 + #define ACPI_HEST_GEN_ERROR_FATAL 1 655 + #define ACPI_HEST_GEN_ERROR_CORRECTED 2 656 + #define ACPI_HEST_GEN_ERROR_NONE 3 657 + 658 + /* Flags for validation_bits above */ 659 + 660 + #define ACPI_HEST_GEN_VALID_FRU_ID (1) 661 + #define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1) 662 + #define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2) 661 663 662 664 /******************************************************************************* 663 665 * ··· 986 934 987 935 /******************************************************************************* 988 936 * 989 - * NFIT - NVDIMM Interface Table (ACPI 6.0) 937 + * NFIT - NVDIMM Interface Table (ACPI 6.0+) 990 938 * Version 1 991 939 * 992 940 ******************************************************************************/ ··· 1067 1015 #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */ 1068 1016 #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */ 1069 1017 #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */ 1018 + #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */ 1070 1019 1071 1020 /* 2: Interleave Structure */ 1072 1021 ··· 1099 1046 u16 subsystem_vendor_id; 1100 1047 u16 subsystem_device_id; 1101 1048 u16 subsystem_revision_id; 1102 - u8 reserved[6]; /* Reserved, must be zero */ 1049 + u8 valid_fields; 1050 + u8 manufacturing_location; 1051 + u16 manufacturing_date; 1052 + u8 reserved[2]; /* Reserved, must be zero */ 1103 1053 u32 serial_number; 1104 1054 u16 code; 1105 1055 u16 windows; ··· 1117 1061 1118 1062 /* Flags */ 1119 1063 1120 - #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */ 1064 + #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */ 1065 + 1066 + /* valid_fields bits */ 1067 + 1068 + #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */ 1121 1069 1122 1070 /* 5: NVDIMM Block Data Window Region Structure */ 1123 1071
+33 -6
include/acpi/actbl2.h
··· 321 321 * DBG2 - Debug Port Table 2 322 322 * Version 0 (Both main table and subtables) 323 323 * 324 - * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012. 324 + * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015 325 325 * 326 326 ******************************************************************************/ 327 327 ··· 371 371 372 372 #define ACPI_DBG2_16550_COMPATIBLE 0x0000 373 373 #define ACPI_DBG2_16550_SUBSET 0x0001 374 + #define ACPI_DBG2_ARM_PL011 0x0003 375 + #define ACPI_DBG2_ARM_SBSA_32BIT 0x000D 376 + #define ACPI_DBG2_ARM_SBSA_GENERIC 0x000E 377 + #define ACPI_DBG2_ARM_DCC 0x000F 378 + #define ACPI_DBG2_BCM2835 0x0010 374 379 375 380 #define ACPI_DBG2_1394_STANDARD 0x0000 376 381 ··· 404 399 * Version 1 405 400 * 406 401 * Conforms to "Intel Virtualization Technology for Directed I/O", 407 - * Version 2.2, Sept. 2013 402 + * Version 2.3, October 2014 408 403 * 409 404 ******************************************************************************/ 410 405 ··· 418 413 /* Masks for Flags field above */ 419 414 420 415 #define ACPI_DMAR_INTR_REMAP (1) 416 + #define ACPI_DMAR_X2APIC_OPT_OUT (1<<1) 417 + #define ACPI_DMAR_X2APIC_MODE (1<<2) 421 418 422 419 /* DMAR subtable header */ 423 420 ··· 662 655 * IORT - IO Remapping Table 663 656 * 664 657 * Conforms to "IO Remapping Table System Software on ARM Platforms", 665 - * Document number: ARM DEN 0049A, 2015 658 + * Document number: ARM DEN 0049B, October 2015 666 659 * 667 660 ******************************************************************************/ 668 661 ··· 692 685 ACPI_IORT_NODE_ITS_GROUP = 0x00, 693 686 ACPI_IORT_NODE_NAMED_COMPONENT = 0x01, 694 687 ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02, 695 - ACPI_IORT_NODE_SMMU = 0x03 688 + ACPI_IORT_NODE_SMMU = 0x03, 689 + ACPI_IORT_NODE_SMMU_V3 = 0x04 696 690 }; 697 691 698 692 struct acpi_iort_id_mapping { ··· 782 774 783 775 #define ACPI_IORT_SMMU_DVM_SUPPORTED (1) 784 776 #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1) 777 + 778 + struct acpi_iort_smmu_v3 { 779 + u64 base_address; /* SMMUv3 base address */ 780 + u32 flags; 781 + u32 reserved; 782 + u64 vatos_address; 783 + u32 model; /* O: generic SMMUv3 */ 784 + u32 event_gsiv; 785 + u32 pri_gsiv; 786 + u32 gerr_gsiv; 787 + u32 sync_gsiv; 788 + }; 789 + 790 + /* Masks for Flags field above */ 791 + 792 + #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) 793 + #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1) 785 794 786 795 /******************************************************************************* 787 796 * ··· 1127 1102 /******************************************************************************* 1128 1103 * 1129 1104 * SPCR - Serial Port Console Redirection table 1130 - * Version 1 1105 + * Version 2 1131 1106 * 1132 1107 * Conforms to "Serial Port Console Redirection Table", 1133 - * Version 1.00, January 11, 2002 1108 + * Version 1.03, August 10, 2015 1134 1109 * 1135 1110 ******************************************************************************/ 1136 1111 ··· 1161 1136 /* Masks for pci_flags field above */ 1162 1137 1163 1138 #define ACPI_SPCR_DO_NOT_DISABLE (1) 1139 + 1140 + /* Values for Interface Type: See the definition of the DBG2 table */ 1164 1141 1165 1142 /******************************************************************************* 1166 1143 *
+52 -47
include/acpi/actbl3.h
··· 184 184 struct acpi_table_header header; /* Common ACPI table header */ 185 185 }; 186 186 187 - /* FPDT subtable header */ 187 + /* FPDT subtable header (Performance Record Structure) */ 188 188 189 189 struct acpi_fpdt_header { 190 190 u16 type; ··· 205 205 206 206 /* 0: Firmware Basic Boot Performance Record */ 207 207 208 + struct acpi_fpdt_boot_pointer { 209 + struct acpi_fpdt_header header; 210 + u8 reserved[4]; 211 + u64 address; 212 + }; 213 + 214 + /* 1: S3 Performance Table Pointer Record */ 215 + 216 + struct acpi_fpdt_s3pt_pointer { 217 + struct acpi_fpdt_header header; 218 + u8 reserved[4]; 219 + u64 address; 220 + }; 221 + 222 + /* 223 + * S3PT - S3 Performance Table. This table is pointed to by the 224 + * S3 Pointer Record above. 225 + */ 226 + struct acpi_table_s3pt { 227 + u8 signature[4]; /* "S3PT" */ 228 + u32 length; 229 + }; 230 + 231 + /* 232 + * S3PT Subtables (Not part of the actual FPDT) 233 + */ 234 + 235 + /* Values for Type field in S3PT header */ 236 + 237 + enum acpi_s3pt_type { 238 + ACPI_S3PT_TYPE_RESUME = 0, 239 + ACPI_S3PT_TYPE_SUSPEND = 1, 240 + ACPI_FPDT_BOOT_PERFORMANCE = 2 241 + }; 242 + 243 + struct acpi_s3pt_resume { 244 + struct acpi_fpdt_header header; 245 + u32 resume_count; 246 + u64 full_resume; 247 + u64 average_resume; 248 + }; 249 + 250 + struct acpi_s3pt_suspend { 251 + struct acpi_fpdt_header header; 252 + u64 suspend_start; 253 + u64 suspend_end; 254 + }; 255 + 256 + /* 257 + * FPDT Boot Performance Record (Not part of the actual FPDT) 258 + */ 208 259 struct acpi_fpdt_boot { 209 260 struct acpi_fpdt_header header; 210 261 u8 reserved[4]; ··· 264 213 u64 startup_start; 265 214 u64 exit_services_entry; 266 215 u64 exit_services_exit; 267 - }; 268 - 269 - /* 1: S3 Performance Table Pointer Record */ 270 - 271 - struct acpi_fpdt_s3pt_ptr { 272 - struct acpi_fpdt_header header; 273 - u8 reserved[4]; 274 - u64 address; 275 - }; 276 - 277 - /* 278 - * S3PT - S3 Performance Table. This table is pointed to by the 279 - * FPDT S3 Pointer Record above. 280 - */ 281 - struct acpi_table_s3pt { 282 - u8 signature[4]; /* "S3PT" */ 283 - u32 length; 284 - }; 285 - 286 - /* 287 - * S3PT Subtables 288 - */ 289 - struct acpi_s3pt_header { 290 - u16 type; 291 - u8 length; 292 - u8 revision; 293 - }; 294 - 295 - /* Values for Type field above */ 296 - 297 - enum acpi_s3pt_type { 298 - ACPI_S3PT_TYPE_RESUME = 0, 299 - ACPI_S3PT_TYPE_SUSPEND = 1 300 - }; 301 - 302 - struct acpi_s3pt_resume { 303 - struct acpi_s3pt_header header; 304 - u32 resume_count; 305 - u64 full_resume; 306 - u64 average_resume; 307 - }; 308 - 309 - struct acpi_s3pt_suspend { 310 - struct acpi_s3pt_header header; 311 - u64 suspend_start; 312 - u64 suspend_end; 313 216 }; 314 217 315 218 /*******************************************************************************
+4 -3
include/acpi/actypes.h
··· 630 630 #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C 631 631 #define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D 632 632 633 - #define ACPI_NOTIFY_MAX 0x0D 633 + #define ACPI_GENERIC_NOTIFY_MAX 0x0D 634 + #define ACPI_SPECIFIC_NOTIFY_MAX 0x84 634 635 635 636 /* 636 637 * Types associated with ACPI names and objects. The first group of ··· 995 994 * Predefined Namespace items 996 995 */ 997 996 struct acpi_predefined_names { 998 - char *name; 997 + const char *name; 999 998 u8 type; 1000 999 char *val; 1001 1000 }; ··· 1228 1227 * struct acpi_memory_list is used only if the ACPICA local cache is enabled 1229 1228 */ 1230 1229 struct acpi_memory_list { 1231 - char *list_name; 1230 + const char *list_name; 1232 1231 void *list_head; 1233 1232 u16 object_size; 1234 1233 u16 max_depth;
+24 -20
include/acpi/platform/acenv.h
··· 66 66 * 67 67 *****************************************************************************/ 68 68 69 + /* Common application configuration. All single threaded except for acpi_exec. */ 70 + 71 + #if (defined ACPI_ASL_COMPILER) || \ 72 + (defined ACPI_BIN_APP) || \ 73 + (defined ACPI_DUMP_APP) || \ 74 + (defined ACPI_HELP_APP) || \ 75 + (defined ACPI_NAMES_APP) || \ 76 + (defined ACPI_SRC_APP) || \ 77 + (defined ACPI_XTRACT_APP) || \ 78 + (defined ACPI_EXAMPLE_APP) 79 + #define ACPI_APPLICATION 80 + #define ACPI_SINGLE_THREADED 81 + #endif 82 + 69 83 /* iASL configuration */ 70 84 71 85 #ifdef ACPI_ASL_COMPILER 72 - #define ACPI_APPLICATION 73 86 #define ACPI_DEBUG_OUTPUT 74 87 #define ACPI_CONSTANT_EVAL_ONLY 75 88 #define ACPI_LARGE_NAMESPACE_NODE 76 89 #define ACPI_DATA_TABLE_DISASSEMBLY 77 - #define ACPI_SINGLE_THREADED 78 90 #define ACPI_32BIT_PHYSICAL_ADDRESS 79 - 80 91 #define ACPI_DISASSEMBLER 1 81 92 #endif 82 93 ··· 98 87 #define ACPI_FULL_DEBUG 99 88 #define ACPI_MUTEX_DEBUG 100 89 #define ACPI_DBG_TRACK_ALLOCATIONS 101 - #endif 102 - 103 - /* 104 - * acpi_bin/acpi_dump/acpi_help/acpi_names/acpi_src/acpi_xtract/Example 105 - * configuration. All single threaded. 106 - */ 107 - #if (defined ACPI_BIN_APP) || \ 108 - (defined ACPI_DUMP_APP) || \ 109 - (defined ACPI_HELP_APP) || \ 110 - (defined ACPI_NAMES_APP) || \ 111 - (defined ACPI_SRC_APP) || \ 112 - (defined ACPI_XTRACT_APP) || \ 113 - (defined ACPI_EXAMPLE_APP) 114 - #define ACPI_APPLICATION 115 - #define ACPI_SINGLE_THREADED 116 90 #endif 117 91 118 92 /* acpi_help configuration. Error messages disabled. */ ··· 134 138 #define ACPI_REDUCED_HARDWARE 1 135 139 #endif 136 140 137 - /* Linkable ACPICA library */ 141 + /* Linkable ACPICA library. Two versions, one with full debug. */ 138 142 139 143 #ifdef ACPI_LIBRARY 140 144 #define ACPI_USE_LOCAL_CACHE 141 - #define ACPI_FULL_DEBUG 145 + #define ACPI_DEBUGGER 1 146 + #define ACPI_DISASSEMBLER 1 147 + 148 + #ifdef _DEBUG 149 + #define ACPI_DEBUG_OUTPUT 150 + #endif 142 151 #endif 143 152 144 153 /* Common for all ACPICA applications */ ··· 218 217 219 218 #elif defined(__HAIKU__) 220 219 #include "achaiku.h" 220 + 221 + #elif defined(__QNX__) 222 + #include "acqnx.h" 221 223 222 224 #else 223 225
-54
include/acpi/platform/acmsvcex.h
··· 1 - /****************************************************************************** 2 - * 3 - * Name: acmsvcex.h - Extra VC specific defines, etc. 4 - * 5 - *****************************************************************************/ 6 - 7 - /* 8 - * Copyright (C) 2000 - 2016, Intel Corp. 9 - * All rights reserved. 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 1. Redistributions of source code must retain the above copyright 15 - * notice, this list of conditions, and the following disclaimer, 16 - * without modification. 17 - * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 - * substantially similar to the "NO WARRANTY" disclaimer below 19 - * ("Disclaimer") and any redistribution must be conditioned upon 20 - * including a substantially similar Disclaimer requirement for further 21 - * binary redistribution. 22 - * 3. Neither the names of the above-listed copyright holders nor the names 23 - * of any contributors may be used to endorse or promote products derived 24 - * from this software without specific prior written permission. 25 - * 26 - * Alternatively, this software may be distributed under the terms of the 27 - * GNU General Public License ("GPL") version 2 as published by the Free 28 - * Software Foundation. 29 - * 30 - * NO WARRANTY 31 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 - * POSSIBILITY OF SUCH DAMAGES. 42 - */ 43 - 44 - #ifndef __ACMSVCEX_H__ 45 - #define __ACMSVCEX_H__ 46 - 47 - /* Debug support. */ 48 - 49 - #ifdef _DEBUG 50 - #define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */ 51 - #include <crtdbg.h> 52 - #endif 53 - 54 - #endif /* __ACMSVCEX_H__ */
-49
include/acpi/platform/acwinex.h
··· 1 - /****************************************************************************** 2 - * 3 - * Name: acwinex.h - Extra OS specific defines, etc. 4 - * 5 - *****************************************************************************/ 6 - 7 - /* 8 - * Copyright (C) 2000 - 2016, Intel Corp. 9 - * All rights reserved. 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 1. Redistributions of source code must retain the above copyright 15 - * notice, this list of conditions, and the following disclaimer, 16 - * without modification. 17 - * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 - * substantially similar to the "NO WARRANTY" disclaimer below 19 - * ("Disclaimer") and any redistribution must be conditioned upon 20 - * including a substantially similar Disclaimer requirement for further 21 - * binary redistribution. 22 - * 3. Neither the names of the above-listed copyright holders nor the names 23 - * of any contributors may be used to endorse or promote products derived 24 - * from this software without specific prior written permission. 25 - * 26 - * Alternatively, this software may be distributed under the terms of the 27 - * GNU General Public License ("GPL") version 2 as published by the Free 28 - * Software Foundation. 29 - * 30 - * NO WARRANTY 31 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 - * POSSIBILITY OF SUCH DAMAGES. 42 - */ 43 - 44 - #ifndef __ACWINEX_H__ 45 - #define __ACWINEX_H__ 46 - 47 - /* Windows uses VC */ 48 - 49 - #endif /* __ACWINEX_H__ */
+1 -1
tools/power/acpi/os_specific/service_layers/osunixmap.c
··· 54 54 #ifndef O_BINARY 55 55 #define O_BINARY 0 56 56 #endif 57 - #if defined(_dragon_fly) || defined(_free_BSD) 57 + #if defined(_dragon_fly) || defined(_free_BSD) || defined(_QNX) 58 58 #define MMAP_FLAGS MAP_SHARED 59 59 #else 60 60 #define MMAP_FLAGS MAP_PRIVATE
+2 -1
tools/power/acpi/tools/acpidump/apdump.c
··· 286 286 287 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 291 if (ACPI_FAILURE(status)) { 291 292 acpi_log_error("%s: Could not convert to a physical address\n", 292 293 ascii_address);
+2 -1
tools/power/acpi/tools/acpidump/apmain.c
··· 209 209 case 'r': /* Dump tables from specified RSDP */ 210 210 211 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 214 &gbl_rsdp_base); 214 215 if (ACPI_FAILURE(status)) { 215 216 acpi_log_error