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

Merge back new ACPICA material for v4.7.

+1957 -1289
+2
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 \ ··· 150 149 acpi-y += \ 151 150 utaddress.o \ 152 151 utalloc.o \ 152 + utascii.o \ 153 153 utbuffer.o \ 154 154 utcopy.o \ 155 155 utexcep.o \
+5 -5
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 { ··· 196 196 acpi_walk_state 197 197 *walk_state)) 198 198 199 - acpi_status acpi_db_display_all_methods(char *display_count_arg); 199 + acpi_status acpi_db_display_all_methods(char *display_count_arg); 200 200 201 201 void acpi_db_display_arguments(void); 202 202 ··· 220 220 * dbexec - debugger control method execution 221 221 */ 222 222 void 223 - acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags); 223 + acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags); 224 224 225 225 void 226 226 acpi_db_create_execution_threads(char *num_threads_arg, ··· 271 271 acpi_status acpi_db_user_commands(void); 272 272 273 273 char *acpi_db_get_next_token(char *string, 274 - char **next, acpi_object_type * return_type); 274 + char **next, acpi_object_type *return_type); 275 275 276 276 /* 277 277 * dbobject
+1 -2
drivers/acpi/acpica/acevents.h
··· 72 72 ACPI_HW_DEPENDENT_RETURN_OK(acpi_status 73 73 acpi_ev_acquire_global_lock(u16 timeout)) 74 74 ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void)) 75 + 75 76 acpi_status acpi_ev_remove_global_lock_handler(void); 76 77 77 78 /* ··· 198 197 void 199 198 acpi_ev_detach_region(union acpi_operand_object *region_obj, 200 199 u8 acpi_ns_is_locked); 201 - 202 - void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj); 203 200 204 201 void 205 202 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
+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 *
+2 -2
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 ··· 370 370 acpi_status 371 371 acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, 372 372 union acpi_operand_object *operand, 373 - acpi_object_type * return_type, 373 + acpi_object_type *return_type, 374 374 union acpi_operand_object **return_desc); 375 375 376 376 /*
+33 -29
drivers/acpi/acpica/aclocal.h
··· 278 278 }; 279 279 280 280 typedef 281 - acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state); 281 + acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state); 282 282 283 283 /* 284 284 * Bitmapped ACPI types. Used internally only ··· 395 395 396 396 /* Return object auto-repair info */ 397 397 398 - typedef acpi_status(*acpi_object_converter) (struct acpi_namespace_node * scope, 399 - union acpi_operand_object 400 - *original_object, 401 - union acpi_operand_object 402 - **converted_object); 398 + typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node * 399 + scope, 400 + union acpi_operand_object * 401 + original_object, 402 + union acpi_operand_object ** 403 + converted_object); 403 404 404 405 struct acpi_simple_repair_info { 405 406 char name[ACPI_NAME_SIZE]; ··· 540 539 struct acpi_namespace_node *gpe_device; 541 540 }; 542 541 543 - typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * 544 - gpe_xrupt_info, 545 - struct acpi_gpe_block_info *gpe_block, 546 - void *context); 542 + typedef acpi_status (*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * 543 + gpe_xrupt_info, 544 + struct acpi_gpe_block_info * 545 + gpe_block, void *context); 547 546 548 547 /* Information about each particular fixed event */ 549 548 ··· 658 657 }; 659 658 660 659 typedef 661 - acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, 662 - union acpi_parse_object ** out_op); 660 + acpi_status (*acpi_parse_downwards) (struct acpi_walk_state * walk_state, 661 + union acpi_parse_object ** out_op); 663 662 664 - typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); 663 + typedef 664 + acpi_status (*acpi_parse_upwards) (struct acpi_walk_state * walk_state); 665 665 666 666 /* Global handlers for AML Notifies */ 667 667 ··· 702 700 * 703 701 ****************************************************************************/ 704 702 705 - typedef acpi_status(*acpi_execute_op) (struct acpi_walk_state * walk_state); 703 + typedef 704 + acpi_status (*acpi_execute_op) (struct acpi_walk_state * walk_state); 706 705 707 706 /* Address Range info block */ 708 707 ··· 856 853 857 854 /* Parse object flags */ 858 855 859 - #define ACPI_PARSEOP_GENERIC 0x01 860 - #define ACPI_PARSEOP_NAMED 0x02 861 - #define ACPI_PARSEOP_DEFERRED 0x04 862 - #define ACPI_PARSEOP_BYTELIST 0x08 863 - #define ACPI_PARSEOP_IN_STACK 0x10 864 - #define ACPI_PARSEOP_TARGET 0x20 865 - #define ACPI_PARSEOP_IN_CACHE 0x80 856 + #define ACPI_PARSEOP_GENERIC 0x01 857 + #define ACPI_PARSEOP_NAMED_OBJECT 0x02 858 + #define ACPI_PARSEOP_DEFERRED 0x04 859 + #define ACPI_PARSEOP_BYTELIST 0x08 860 + #define ACPI_PARSEOP_IN_STACK 0x10 861 + #define ACPI_PARSEOP_TARGET 0x20 862 + #define ACPI_PARSEOP_IN_CACHE 0x80 866 863 867 864 /* Parse object disasm_flags */ 868 865 869 - #define ACPI_PARSEOP_IGNORE 0x01 870 - #define ACPI_PARSEOP_PARAMLIST 0x02 871 - #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 872 - #define ACPI_PARSEOP_PREDEF_CHECKED 0x08 873 - #define ACPI_PARSEOP_CLOSING_PAREN 0x10 874 - #define ACPI_PARSEOP_COMPOUND 0x20 875 - #define ACPI_PARSEOP_ASSIGNMENT 0x40 876 - #define ACPI_PARSEOP_ELSEIF 0x80 866 + #define ACPI_PARSEOP_IGNORE 0x01 867 + #define ACPI_PARSEOP_PARAMETER_LIST 0x02 868 + #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 869 + #define ACPI_PARSEOP_PREDEFINED_CHECKED 0x08 870 + #define ACPI_PARSEOP_CLOSING_PAREN 0x10 871 + #define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x20 872 + #define ACPI_PARSEOP_ASSIGNMENT 0x40 873 + #define ACPI_PARSEOP_ELSEIF 0x80 877 874 878 875 /***************************************************************************** 879 876 * ··· 1099 1096 #define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */ 1100 1097 #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ 1101 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 */ 1102 1100 1103 1101 struct acpi_external_file { 1104 1102 char *path;
+19 -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_ALIGNED(a, s) (((a) & ((s) - 1)) == 0) 266 + #define ACPI_IS_POWER_OF_TWO(a) ACPI_IS_ALIGNED(a, a) 267 + 263 268 /* 264 269 * Bitmask creation 265 270 * Bit positions start at zero. 266 271 * MASK_BITS_ABOVE creates a mask starting AT the position and above 267 272 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position 273 + * MASK_BITS_ABOVE/BELOW accpets a bit offset to create a mask 274 + * MASK_BITS_ABOVE/BELOW_32/64 accpets a bit width to create a mask 275 + * Note: The ACPI_INTEGER_BIT_SIZE check is used to bypass compiler 276 + * differences with the shift operator 268 277 */ 269 278 #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((u32) (position)))) 270 279 #define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((u32) (position))) 280 + #define ACPI_MASK_BITS_ABOVE_32(width) ((u32) ACPI_MASK_BITS_ABOVE(width)) 281 + #define ACPI_MASK_BITS_BELOW_32(width) ((u32) ACPI_MASK_BITS_BELOW(width)) 282 + #define ACPI_MASK_BITS_ABOVE_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \ 283 + ACPI_UINT64_MAX : \ 284 + ACPI_MASK_BITS_ABOVE(width)) 285 + #define ACPI_MASK_BITS_BELOW_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \ 286 + (u64) 0 : \ 287 + ACPI_MASK_BITS_BELOW(width)) 271 288 272 289 /* Bitfields within ACPI registers */ 273 290 ··· 300 283 /* Generic bitfield macros and masks */ 301 284 302 285 #define ACPI_GET_BITS(source_ptr, position, mask) \ 303 - ((*source_ptr >> position) & mask) 286 + ((*(source_ptr) >> (position)) & (mask)) 304 287 305 288 #define ACPI_SET_BITS(target_ptr, position, mask, value) \ 306 - (*target_ptr |= ((value & mask) << position)) 289 + (*(target_ptr) |= (((value) & (mask)) << (position))) 307 290 308 291 #define ACPI_1BIT_MASK 0x00000001 309 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
+12 -2
drivers/acpi/acpica/acpredef.h
··· 129 129 ACPI_PTYPE2_REV_FIXED = 9, 130 130 ACPI_PTYPE2_FIX_VAR = 10, 131 131 ACPI_PTYPE2_VAR_VAR = 11, 132 - ACPI_PTYPE2_UUID_PAIR = 12 132 + ACPI_PTYPE2_UUID_PAIR = 12, 133 + ACPI_PTYPE_CUSTOM = 13 133 134 }; 134 135 135 136 /* Support macros for users of the predefined info table */ ··· 341 340 342 341 {{"_BIX", METHOD_0ARGS, 343 342 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int),(4 Str) */ 344 - PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, 343 + PACKAGE_INFO(ACPI_PTYPE_CUSTOM, ACPI_RTYPE_INTEGER, 16, 345 344 ACPI_RTYPE_STRING, 4, 0), 346 345 347 346 {{"_BLT", ··· 523 522 {{"_FIF", METHOD_0ARGS, 524 523 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ 525 524 PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0), 525 + 526 + {{"_FIT", METHOD_0ARGS, 527 + METHOD_RETURNS(ACPI_RTYPE_BUFFER)}}, /* ACPI 6.0 */ 526 528 527 529 {{"_FIX", METHOD_0ARGS, 528 530 METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */ ··· 1056 1052 {{"_WED", METHOD_1ARGS(ACPI_TYPE_INTEGER), 1057 1053 METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | 1058 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 */ 1059 1061 1060 1062 PACKAGE_INFO(0, 0, 0, 0, 0, 0) /* Table terminator */ 1061 1063 };
+6 -6
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, ··· 223 223 * rscalc 224 224 */ 225 225 acpi_status 226 - acpi_rs_get_list_length(u8 * aml_buffer, 227 - u32 aml_buffer_length, acpi_size * size_needed); 226 + acpi_rs_get_list_length(u8 *aml_buffer, 227 + u32 aml_buffer_length, acpi_size *size_needed); 228 228 229 229 acpi_status 230 230 acpi_rs_get_aml_length(struct acpi_resource *resource_list, 231 - acpi_size resource_list_size, acpi_size * size_needed); 231 + acpi_size resource_list_size, acpi_size *size_needed); 232 232 233 233 acpi_status 234 234 acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, 235 - acpi_size * buffer_size_needed); 235 + acpi_size *buffer_size_needed); 236 236 237 237 acpi_status 238 238 acpi_rs_convert_aml_to_resources(u8 * aml,
+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) */
-2
drivers/acpi/acpica/actables.h
··· 161 161 162 162 acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address); 163 163 164 - u8 acpi_is_valid_signature(char *signature); 165 - 166 164 /* 167 165 * tbxfload 168 166 */
+36 -22
drivers/acpi/acpica/acutils.h
··· 136 136 #define ACPI_SMALL_VARIABLE_LENGTH 3 137 137 138 138 typedef 139 - acpi_status(*acpi_walk_aml_callback) (u8 *aml, 140 - u32 length, 141 - u32 offset, 142 - u8 resource_index, void **context); 139 + acpi_status (*acpi_walk_aml_callback) (u8 *aml, 140 + u32 length, 141 + u32 offset, 142 + u8 resource_index, void **context); 143 143 144 144 typedef 145 - acpi_status(*acpi_pkg_callback) (u8 object_type, 146 - union acpi_operand_object *source_object, 147 - union acpi_generic_state * state, 148 - void *context); 145 + acpi_status (*acpi_pkg_callback) (u8 object_type, 146 + union acpi_operand_object * source_object, 147 + union acpi_generic_state * state, 148 + void *context); 149 149 150 150 struct acpi_pkg_info { 151 151 u8 *free_space; ··· 167 167 #define DB_QWORD_DISPLAY 8 168 168 169 169 /* 170 + * utascii - ASCII utilities 171 + */ 172 + u8 acpi_ut_valid_nameseg(char *signature); 173 + 174 + u8 acpi_ut_valid_name_char(char character, u32 position); 175 + 176 + void acpi_ut_check_and_repair_ascii(u8 *name, char *repaired_name, u32 count); 177 + 178 + /* 170 179 * utnonansi - Non-ANSI C library functions 171 180 */ 172 181 void acpi_ut_strupr(char *src_string); ··· 184 175 185 176 int acpi_ut_stricmp(char *string1, char *string2); 186 177 187 - 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 188 186 189 187 /* 190 188 * utglobal - Global data structures and procedures ··· 282 266 void 283 267 acpi_ut_trace_ptr(u32 line_number, 284 268 const char *function_name, 285 - const char *module_name, u32 component_id, void *pointer); 269 + const char *module_name, 270 + u32 component_id, const void *pointer); 286 271 287 272 void 288 273 acpi_ut_trace_u32(u32 line_number, ··· 293 276 void 294 277 acpi_ut_trace_str(u32 line_number, 295 278 const char *function_name, 296 - const char *module_name, u32 component_id, char *string); 279 + const char *module_name, 280 + u32 component_id, const char *string); 297 281 298 282 void 299 283 acpi_ut_exit(u32 line_number, ··· 353 335 */ 354 336 acpi_status 355 337 acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, 356 - char *path, 338 + const char *path, 357 339 u32 expected_return_btypes, 358 340 union acpi_operand_object **return_desc); 359 341 360 342 acpi_status 361 - acpi_ut_evaluate_numeric_object(char *object_name, 343 + acpi_ut_evaluate_numeric_object(const char *object_name, 362 344 struct acpi_namespace_node *device_node, 363 345 u64 *value); 364 346 ··· 433 415 union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); 434 416 435 417 acpi_status 436 - acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length); 418 + acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size *obj_length); 437 419 438 420 /* 439 421 * utosi - Support for the _OSI predefined control method ··· 544 526 void 545 527 acpi_ut_display_init_pathname(u8 type, 546 528 struct acpi_namespace_node *obj_handle, 547 - char *path); 529 + const char *path); 548 530 #endif 549 531 550 532 /* 551 533 * utownerid - Support for Table/Method Owner IDs 552 534 */ 553 - acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); 535 + acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id); 554 536 555 - void acpi_ut_release_owner_id(acpi_owner_id * owner_id); 537 + void acpi_ut_release_owner_id(acpi_owner_id *owner_id); 556 538 557 539 /* 558 540 * utresrc ··· 587 569 #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP 588 570 void ut_convert_backslashes(char *pathname); 589 571 #endif 590 - 591 - u8 acpi_ut_valid_acpi_name(char *name); 592 - 593 - u8 acpi_ut_valid_acpi_char(char character, u32 position); 594 572 595 573 void acpi_ut_repair_name(char *name); 596 574 ··· 642 628 void acpi_ut_dump_allocations(u32 component, const char *module); 643 629 644 630 acpi_status 645 - acpi_ut_create_list(char *list_name, 631 + acpi_ut_create_list(const char *list_name, 646 632 u16 object_size, struct acpi_memory_list **return_cache); 647 633 648 634 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+2 -2
drivers/acpi/acpica/dbcmds.c
··· 738 738 original_aml = return_buffer.pointer; 739 739 740 740 acpi_dm_compare_aml_resources(original_aml->buffer.pointer, 741 - (acpi_rsdesc_size) original_aml->buffer. 741 + (acpi_rsdesc_size)original_aml->buffer. 742 742 length, new_aml.pointer, 743 - (acpi_rsdesc_size) new_aml.length); 743 + (acpi_rsdesc_size)new_aml.length); 744 744 745 745 /* Cleanup and exit */ 746 746
+5 -3
drivers/acpi/acpica/dbconvert.c
··· 194 194 * 195 195 ******************************************************************************/ 196 196 197 - acpi_status acpi_db_convert_to_package(char *string, union acpi_object * object) 197 + acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object) 198 198 { 199 199 char *this; 200 200 char *next; ··· 252 252 253 253 acpi_status 254 254 acpi_db_convert_to_object(acpi_object_type type, 255 - char *string, union acpi_object * object) 255 + char *string, union acpi_object *object) 256 256 { 257 257 acpi_status status = AE_OK; 258 258 ··· 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
+1 -1
drivers/acpi/acpica/dbexec.c
··· 361 361 ******************************************************************************/ 362 362 363 363 void 364 - acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags) 364 + acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) 365 365 { 366 366 acpi_status status; 367 367 struct acpi_buffer return_obj;
+10 -9
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; ··· 466 466 ******************************************************************************/ 467 467 468 468 char *acpi_db_get_next_token(char *string, 469 - char **next, acpi_object_type * return_type) 469 + char **next, acpi_object_type *return_type) 470 470 { 471 471 char *start; 472 472 u32 depth; ··· 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 } ··· 684 683 685 684 acpi_status 686 685 acpi_db_command_dispatch(char *input_buffer, 687 - struct acpi_walk_state * walk_state, 688 - union acpi_parse_object * op) 686 + struct acpi_walk_state *walk_state, 687 + union acpi_parse_object *op) 689 688 { 690 689 u32 temp; 691 690 u32 command_index;
+2 -2
drivers/acpi/acpica/dbnames.c
··· 285 285 u32 max_depth = ACPI_UINT32_MAX; 286 286 acpi_owner_id owner_id; 287 287 288 - owner_id = (acpi_owner_id) strtoul(owner_arg, NULL, 0); 288 + owner_id = (acpi_owner_id)strtoul(owner_arg, NULL, 0); 289 289 290 290 /* Now we can check for the depth argument */ 291 291 ··· 709 709 return (AE_OK); 710 710 } 711 711 712 - if (!acpi_ut_valid_acpi_name(node->name.ascii)) { 712 + if (!acpi_ut_valid_nameseg(node->name.ascii)) { 713 713 acpi_os_printf("Invalid AcpiName for Node %p\n", node); 714 714 return (AE_OK); 715 715 }
+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 }
+2 -2
drivers/acpi/acpica/dbxface.c
··· 162 162 ******************************************************************************/ 163 163 164 164 acpi_status 165 - acpi_db_single_step(struct acpi_walk_state * walk_state, 166 - union acpi_parse_object * op, u32 opcode_class) 165 + acpi_db_single_step(struct acpi_walk_state *walk_state, 166 + union acpi_parse_object *op, u32 opcode_class) 167 167 { 168 168 union acpi_parse_object *next; 169 169 acpi_status status = AE_OK;
+2 -2
drivers/acpi/acpica/dscontrol.c
··· 163 163 ******************************************************************************/ 164 164 165 165 acpi_status 166 - acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state, 167 - union acpi_parse_object * op) 166 + acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state, 167 + union acpi_parse_object *op) 168 168 { 169 169 acpi_status status = AE_OK; 170 170 union acpi_generic_state *control_state;
+1 -1
drivers/acpi/acpica/dsinit.c
··· 188 188 189 189 acpi_status 190 190 acpi_ds_initialize_objects(u32 table_index, 191 - struct acpi_namespace_node * start_node) 191 + struct acpi_namespace_node *start_node) 192 192 { 193 193 acpi_status status; 194 194 struct acpi_init_walk_info info;
+1 -1
drivers/acpi/acpica/dsmethod.c
··· 209 209 ******************************************************************************/ 210 210 211 211 acpi_status 212 - acpi_ds_method_error(acpi_status status, struct acpi_walk_state * walk_state) 212 + acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) 213 213 { 214 214 u32 aml_offset; 215 215
+1 -1
drivers/acpi/acpica/dsutils.c
··· 569 569 /* TBD: May only be temporary */ 570 570 571 571 obj_desc = 572 - acpi_ut_create_string_object((acpi_size) name_length); 572 + acpi_ut_create_string_object((acpi_size)name_length); 573 573 574 574 strncpy(obj_desc->string.pointer, 575 575 name_string, name_length);
+2 -2
drivers/acpi/acpica/dswload.c
··· 137 137 ******************************************************************************/ 138 138 139 139 acpi_status 140 - acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, 141 - union acpi_parse_object ** out_op) 140 + acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, 141 + union acpi_parse_object **out_op) 142 142 { 143 143 union acpi_parse_object *op; 144 144 struct acpi_namespace_node *node;
+2 -2
drivers/acpi/acpica/dswload2.c
··· 490 490 491 491 status = 492 492 acpi_ds_create_index_field(op, 493 - (acpi_handle) arg-> 494 - common.node, walk_state); 493 + (acpi_handle)arg->common. 494 + node, walk_state); 495 495 break; 496 496 497 497 case AML_BANK_FIELD_OP:
+5 -5
drivers/acpi/acpica/dswstate.c
··· 143 143 ******************************************************************************/ 144 144 145 145 acpi_status 146 - acpi_ds_result_push(union acpi_operand_object * object, 147 - struct acpi_walk_state * walk_state) 146 + acpi_ds_result_push(union acpi_operand_object *object, 147 + struct acpi_walk_state *walk_state) 148 148 { 149 149 union acpi_generic_state *state; 150 150 acpi_status status; ··· 307 307 ******************************************************************************/ 308 308 309 309 acpi_status 310 - acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state) 310 + acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state) 311 311 { 312 312 ACPI_FUNCTION_NAME(ds_obj_stack_push); 313 313 ··· 354 354 ******************************************************************************/ 355 355 356 356 acpi_status 357 - acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state) 357 + acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state) 358 358 { 359 359 u32 i; 360 360 ··· 411 411 return; 412 412 } 413 413 414 - for (i = (s32) pop_count - 1; i >= 0; i--) { 414 + for (i = (s32)pop_count - 1; i >= 0; i--) { 415 415 if (walk_state->num_operands == 0) { 416 416 return; 417 417 }
+2 -2
drivers/acpi/acpica/evgpe.c
··· 440 440 441 441 gpe_event_info = 442 442 &gpe_block-> 443 - event_info[((acpi_size) i * 443 + event_info[((acpi_size)i * 444 444 ACPI_GPE_REGISTER_WIDTH) + j]; 445 445 gpe_number = 446 446 j + gpe_register_info->base_gpe_number; ··· 652 652 * 653 653 ******************************************************************************/ 654 654 655 - acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info * gpe_event_info) 655 + acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info *gpe_event_info) 656 656 { 657 657 acpi_status status; 658 658
+2 -2
drivers/acpi/acpica/evgpeblk.c
··· 211 211 212 212 /* Allocate the GPE register information block */ 213 213 214 - gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block-> 214 + gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size)gpe_block-> 215 215 register_count * 216 216 sizeof(struct 217 217 acpi_gpe_register_info)); ··· 225 225 * Allocate the GPE event_info block. There are eight distinct GPEs 226 226 * per register. Initialization to zeros is sufficient. 227 227 */ 228 - gpe_event_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block->gpe_count * 228 + gpe_event_info = ACPI_ALLOCATE_ZEROED((acpi_size)gpe_block->gpe_count * 229 229 sizeof(struct 230 230 acpi_gpe_event_info)); 231 231 if (!gpe_event_info) {
+2 -2
drivers/acpi/acpica/evgpeutil.c
··· 163 163 164 164 acpi_status 165 165 acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, 166 - struct acpi_gpe_xrupt_info ** gpe_xrupt_block) 166 + struct acpi_gpe_xrupt_info **gpe_xrupt_block) 167 167 { 168 168 struct acpi_gpe_xrupt_info *next_gpe_xrupt; 169 169 struct acpi_gpe_xrupt_info *gpe_xrupt; ··· 320 320 /* Now look at the individual GPEs in this byte register */ 321 321 322 322 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { 323 - gpe_event_info = &gpe_block->event_info[((acpi_size) i * 323 + gpe_event_info = &gpe_block->event_info[((acpi_size)i * 324 324 ACPI_GPE_REGISTER_WIDTH) 325 325 + j]; 326 326
+1 -1
drivers/acpi/acpica/evhandler.c
··· 359 359 ******************************************************************************/ 360 360 361 361 acpi_status 362 - acpi_ev_install_space_handler(struct acpi_namespace_node * node, 362 + acpi_ev_install_space_handler(struct acpi_namespace_node *node, 363 363 acpi_adr_space_type space_id, 364 364 acpi_adr_space_handler handler, 365 365 acpi_adr_space_setup setup, void *context)
+1 -2
drivers/acpi/acpica/evmisc.c
··· 99 99 ******************************************************************************/ 100 100 101 101 acpi_status 102 - acpi_ev_queue_notify_request(struct acpi_namespace_node * node, 103 - u32 notify_value) 102 + acpi_ev_queue_notify_request(struct acpi_namespace_node *node, u32 notify_value) 104 103 { 105 104 union acpi_operand_object *obj_desc; 106 105 union acpi_operand_object *handler_list_head = NULL;
+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 -2
drivers/acpi/acpica/evrgnini.c
··· 227 227 228 228 /* Install a handler for this PCI root bridge */ 229 229 230 - status = acpi_install_address_space_handler((acpi_handle) pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); 230 + status = acpi_install_address_space_handler((acpi_handle)pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); 231 231 if (ACPI_FAILURE(status)) { 232 232 if (status == AE_SAME_HANDLER) { 233 233 /* ··· 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;
+1 -1
drivers/acpi/acpica/evxfgpe.c
··· 917 917 * the FADT-defined gpe blocks. Otherwise, the GPE block device. 918 918 * 919 919 ******************************************************************************/ 920 - acpi_status acpi_get_gpe_device(u32 index, acpi_handle * gpe_device) 920 + acpi_status acpi_get_gpe_device(u32 index, acpi_handle *gpe_device) 921 921 { 922 922 struct acpi_gpe_device_info info; 923 923 acpi_status status;
+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 /*
+5 -3
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 } ··· 441 439 * Need enough space for one ASCII integer (plus null terminator) 442 440 */ 443 441 return_desc = 444 - acpi_ut_create_string_object((acpi_size) string_length); 442 + acpi_ut_create_string_object((acpi_size)string_length); 445 443 if (!return_desc) { 446 444 return_ACPI_STATUS(AE_NO_MEMORY); 447 445 } ··· 520 518 } 521 519 522 520 return_desc = 523 - acpi_ut_create_string_object((acpi_size) string_length); 521 + acpi_ut_create_string_object((acpi_size)string_length); 524 522 if (!return_desc) { 525 523 return_ACPI_STATUS(AE_NO_MEMORY); 526 524 }
+1 -1
drivers/acpi/acpica/excreate.c
··· 394 394 obj_desc->processor.proc_id = (u8) operand[1]->integer.value; 395 395 obj_desc->processor.length = (u8) operand[3]->integer.value; 396 396 obj_desc->processor.address = 397 - (acpi_io_address) operand[2]->integer.value; 397 + (acpi_io_address)operand[2]->integer.value; 398 398 399 399 /* Install the processor object in the parent Node */ 400 400
+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 }
+2 -2
drivers/acpi/acpica/exfield.c
··· 126 126 ******************************************************************************/ 127 127 128 128 acpi_status 129 - acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, 129 + acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, 130 130 union acpi_operand_object *obj_desc, 131 131 union acpi_operand_object **ret_buffer_desc) 132 132 { ··· 233 233 * Note: Field.length is in bits. 234 234 */ 235 235 length = 236 - (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); 236 + (acpi_size)ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); 237 237 238 238 if (length > acpi_gbl_integer_byte_width) { 239 239
+3 -11
drivers/acpi/acpica/exfldio.c
··· 164 164 if (ACPI_ROUND_UP(rgn_desc->region.length, 165 165 obj_desc->common_field. 166 166 access_byte_width) >= 167 - ((acpi_size) obj_desc->common_field. 167 + ((acpi_size)obj_desc->common_field. 168 168 base_byte_offset + 169 169 obj_desc->common_field.access_byte_width + 170 170 field_datum_byte_offset)) { ··· 897 897 898 898 access_bit_width = ACPI_MUL_8(obj_desc->common_field.access_byte_width); 899 899 900 - /* 901 - * Create the bitmasks used for bit insertion. 902 - * Note: This if/else is used to bypass compiler differences with the 903 - * shift operator 904 - */ 905 - if (access_bit_width == ACPI_INTEGER_BIT_SIZE) { 906 - width_mask = ACPI_UINT64_MAX; 907 - } else { 908 - width_mask = ACPI_MASK_BITS_ABOVE(access_bit_width); 909 - } 900 + /* Create the bitmasks used for bit insertion */ 910 901 902 + width_mask = ACPI_MASK_BITS_ABOVE_64(access_bit_width); 911 903 mask = width_mask & 912 904 ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset); 913 905
-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 /*******************************************************************************
+1 -1
drivers/acpi/acpica/exnames.c
··· 178 178 179 179 for (index = 0; 180 180 (index < ACPI_NAME_SIZE) 181 - && (acpi_ut_valid_acpi_char(*aml_address, 0)); index++) { 181 + && (acpi_ut_valid_name_char(*aml_address, 0)); index++) { 182 182 char_buf[index] = *aml_address++; 183 183 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "%c\n", char_buf[index])); 184 184 }
+4 -4
drivers/acpi/acpica/exoparg3.c
··· 184 184 /* Get the Integer values from the objects */ 185 185 186 186 index = operand[1]->integer.value; 187 - length = (acpi_size) operand[2]->integer.value; 187 + length = (acpi_size)operand[2]->integer.value; 188 188 189 189 /* 190 190 * If the index is beyond the length of the String/Buffer, or if the ··· 198 198 199 199 else if ((index + length) > operand[0]->string.length) { 200 200 length = 201 - (acpi_size) operand[0]->string.length - 202 - (acpi_size) index; 201 + (acpi_size)operand[0]->string.length - 202 + (acpi_size)index; 203 203 } 204 204 205 205 /* Strings always have a sub-pointer, not so for buffers */ ··· 209 209 210 210 /* Always allocate a new buffer for the String */ 211 211 212 - buffer = ACPI_ALLOCATE_ZEROED((acpi_size) length + 1); 212 + buffer = ACPI_ALLOCATE_ZEROED((acpi_size)length + 1); 213 213 if (!buffer) { 214 214 status = AE_NO_MEMORY; 215 215 goto cleanup;
+1 -1
drivers/acpi/acpica/exoparg6.c
··· 207 207 * 208 208 ******************************************************************************/ 209 209 210 - acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state) 210 + acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state) 211 211 { 212 212 union acpi_operand_object **operand = &walk_state->operands[0]; 213 213 union acpi_operand_object *return_desc = NULL;
+3 -3
drivers/acpi/acpica/exregion.c
··· 325 325 switch (function) { 326 326 case ACPI_READ: 327 327 328 - status = acpi_hw_read_port((acpi_io_address) address, 328 + status = acpi_hw_read_port((acpi_io_address)address, 329 329 &value32, bit_width); 330 330 *value = value32; 331 331 break; 332 332 333 333 case ACPI_WRITE: 334 334 335 - status = acpi_hw_write_port((acpi_io_address) address, 336 - (u32) * value, bit_width); 335 + status = acpi_hw_write_port((acpi_io_address)address, 336 + (u32)*value, bit_width); 337 337 break; 338 338 339 339 default:
+2 -2
drivers/acpi/acpica/exresnte.c
··· 93 93 */ 94 94 node = *object_ptr; 95 95 source_desc = acpi_ns_get_attached_object(node); 96 - entry_type = acpi_ns_get_type((acpi_handle) node); 96 + entry_type = acpi_ns_get_type((acpi_handle)node); 97 97 98 98 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n", 99 99 node, source_desc, ··· 106 106 107 107 node = ACPI_CAST_PTR(struct acpi_namespace_node, node->object); 108 108 source_desc = acpi_ns_get_attached_object(node); 109 - entry_type = acpi_ns_get_type((acpi_handle) node); 109 + entry_type = acpi_ns_get_type((acpi_handle)node); 110 110 *object_ptr = node; 111 111 } 112 112
+1 -1
drivers/acpi/acpica/exresolv.c
··· 334 334 acpi_status 335 335 acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, 336 336 union acpi_operand_object *operand, 337 - acpi_object_type * return_type, 337 + acpi_object_type *return_type, 338 338 union acpi_operand_object **return_desc) 339 339 { 340 340 union acpi_operand_object *obj_desc = ACPI_CAST_PTR(void, operand);
+2 -2
drivers/acpi/acpica/exresop.c
··· 131 131 132 132 acpi_status 133 133 acpi_ex_resolve_operands(u16 opcode, 134 - union acpi_operand_object ** stack_ptr, 135 - struct acpi_walk_state * walk_state) 134 + union acpi_operand_object **stack_ptr, 135 + struct acpi_walk_state *walk_state) 136 136 { 137 137 union acpi_operand_object *obj_desc; 138 138 acpi_status status = AE_OK;
+2 -2
drivers/acpi/acpica/exstorob.c
··· 188 188 * Clear old string and copy in the new one 189 189 */ 190 190 memset(target_desc->string.pointer, 0, 191 - (acpi_size) target_desc->string.length + 1); 191 + (acpi_size)target_desc->string.length + 1); 192 192 memcpy(target_desc->string.pointer, buffer, length); 193 193 } else { 194 194 /* ··· 204 204 } 205 205 206 206 target_desc->string.pointer = 207 - ACPI_ALLOCATE_ZEROED((acpi_size) length + 1); 207 + ACPI_ALLOCATE_ZEROED((acpi_size)length + 1); 208 208 209 209 if (!target_desc->string.pointer) { 210 210 return_ACPI_STATUS(AE_NO_MEMORY);
+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 *
+3 -3
drivers/acpi/acpica/hwgpe.c
··· 166 166 * 167 167 ******************************************************************************/ 168 168 169 - acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info) 169 + acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info) 170 170 { 171 171 struct acpi_gpe_register_info *gpe_register_info; 172 172 acpi_status status; ··· 206 206 ******************************************************************************/ 207 207 208 208 acpi_status 209 - acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info, 209 + acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, 210 210 acpi_event_status *event_status) 211 211 { 212 212 u32 in_byte; ··· 391 391 392 392 acpi_status 393 393 acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 394 - struct acpi_gpe_block_info * gpe_block, 394 + struct acpi_gpe_block_info *gpe_block, 395 395 void *context) 396 396 { 397 397 u32 i;
+258 -31
drivers/acpi/acpica/hwregs.c
··· 51 51 52 52 #if (!ACPI_REDUCED_HARDWARE) 53 53 /* Local Prototypes */ 54 + static u8 55 + acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, 56 + u8 max_bit_width); 57 + 54 58 static acpi_status 55 59 acpi_hw_read_multiple(u32 *value, 56 60 struct acpi_generic_address *register_a, ··· 66 62 struct acpi_generic_address *register_b); 67 63 68 64 #endif /* !ACPI_REDUCED_HARDWARE */ 65 + 66 + /****************************************************************************** 67 + * 68 + * FUNCTION: acpi_hw_get_access_bit_width 69 + * 70 + * PARAMETERS: reg - GAS register structure 71 + * max_bit_width - Max bit_width supported (32 or 64) 72 + * 73 + * RETURN: Status 74 + * 75 + * DESCRIPTION: Obtain optimal access bit width 76 + * 77 + ******************************************************************************/ 78 + 79 + static u8 80 + acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, u8 max_bit_width) 81 + { 82 + u64 address; 83 + 84 + if (!reg->access_width) { 85 + /* 86 + * Detect old register descriptors where only the bit_width field 87 + * makes senses. The target address is copied to handle possible 88 + * alignment issues. 89 + */ 90 + ACPI_MOVE_64_TO_64(&address, &reg->address); 91 + if (!reg->bit_offset && reg->bit_width && 92 + ACPI_IS_POWER_OF_TWO(reg->bit_width) && 93 + ACPI_IS_ALIGNED(reg->bit_width, 8) && 94 + ACPI_IS_ALIGNED(address, reg->bit_width)) { 95 + return (reg->bit_width); 96 + } else { 97 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { 98 + return (32); 99 + } else { 100 + return (max_bit_width); 101 + } 102 + } 103 + } else { 104 + return (1 << (reg->access_width + 2)); 105 + } 106 + } 69 107 70 108 /****************************************************************************** 71 109 * ··· 129 83 acpi_hw_validate_register(struct acpi_generic_address *reg, 130 84 u8 max_bit_width, u64 *address) 131 85 { 86 + u8 bit_width; 87 + u8 access_width; 132 88 133 89 /* Must have a valid pointer to a GAS structure */ 134 90 ··· 157 109 return (AE_SUPPORT); 158 110 } 159 111 160 - /* Validate the bit_width */ 112 + /* Validate the access_width */ 161 113 162 - if ((reg->bit_width != 8) && 163 - (reg->bit_width != 16) && 164 - (reg->bit_width != 32) && (reg->bit_width != max_bit_width)) { 114 + if (reg->access_width > 4) { 165 115 ACPI_ERROR((AE_INFO, 166 - "Unsupported register bit width: 0x%X", 167 - reg->bit_width)); 116 + "Unsupported register access width: 0x%X", 117 + reg->access_width)); 168 118 return (AE_SUPPORT); 169 119 } 170 120 171 - /* Validate the bit_offset. Just a warning for now. */ 121 + /* Validate the bit_width, convert access_width into number of bits */ 172 122 173 - if (reg->bit_offset != 0) { 123 + access_width = acpi_hw_get_access_bit_width(reg, max_bit_width); 124 + bit_width = 125 + ACPI_ROUND_UP(reg->bit_offset + reg->bit_width, access_width); 126 + if (max_bit_width < bit_width) { 174 127 ACPI_WARNING((AE_INFO, 175 - "Unsupported register bit offset: 0x%X", 176 - reg->bit_offset)); 128 + "Requested bit width 0x%X is smaller than register bit width 0x%X", 129 + max_bit_width, bit_width)); 130 + return (AE_SUPPORT); 177 131 } 178 132 179 133 return (AE_OK); ··· 195 145 * 64-bit values is not needed. 196 146 * 197 147 * LIMITATIONS: <These limitations also apply to acpi_hw_write> 198 - * bit_width must be exactly 8, 16, or 32. 199 148 * space_ID must be system_memory or system_IO. 200 - * bit_offset and access_width are currently ignored, as there has 201 - * not been a need to implement these. 202 149 * 203 150 ******************************************************************************/ 204 151 205 152 acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) 206 153 { 207 154 u64 address; 155 + u8 access_width; 156 + u32 bit_width; 157 + u8 bit_offset; 208 158 u64 value64; 159 + u32 value32; 160 + u8 index; 209 161 acpi_status status; 210 162 211 163 ACPI_FUNCTION_NAME(hw_read); ··· 219 167 return (status); 220 168 } 221 169 222 - /* Initialize entire 32-bit return value to zero */ 223 - 170 + /* 171 + * Initialize entire 32-bit return value to zero, convert access_width 172 + * into number of bits based 173 + */ 224 174 *value = 0; 175 + access_width = acpi_hw_get_access_bit_width(reg, 32); 176 + bit_width = reg->bit_offset + reg->bit_width; 177 + bit_offset = reg->bit_offset; 225 178 226 179 /* 227 180 * Two address spaces supported: Memory or IO. PCI_Config is 228 181 * not supported here because the GAS structure is insufficient 229 182 */ 230 - if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 231 - status = acpi_os_read_memory((acpi_physical_address) 232 - address, &value64, reg->bit_width); 183 + index = 0; 184 + while (bit_width) { 185 + if (bit_offset >= access_width) { 186 + value32 = 0; 187 + bit_offset -= access_width; 188 + } else { 189 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 190 + status = 191 + acpi_os_read_memory((acpi_physical_address) 192 + address + 193 + index * 194 + ACPI_DIV_8 195 + (access_width), 196 + &value64, access_width); 197 + value32 = (u32)value64; 198 + } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 233 199 234 - *value = (u32)value64; 235 - } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 200 + status = acpi_hw_read_port((acpi_io_address) 201 + address + 202 + index * 203 + ACPI_DIV_8 204 + (access_width), 205 + &value32, 206 + access_width); 207 + } 236 208 237 - status = acpi_hw_read_port((acpi_io_address) 238 - address, value, reg->bit_width); 209 + /* 210 + * Use offset style bit masks because: 211 + * bit_offset < access_width/bit_width < access_width, and 212 + * access_width is ensured to be less than 32-bits by 213 + * acpi_hw_validate_register(). 214 + */ 215 + if (bit_offset) { 216 + value32 &= ACPI_MASK_BITS_BELOW(bit_offset); 217 + bit_offset = 0; 218 + } 219 + if (bit_width < access_width) { 220 + value32 &= ACPI_MASK_BITS_ABOVE(bit_width); 221 + } 222 + } 223 + 224 + /* 225 + * Use offset style bit writes because "Index * AccessWidth" is 226 + * ensured to be less than 32-bits by acpi_hw_validate_register(). 227 + */ 228 + ACPI_SET_BITS(value, index * access_width, 229 + ACPI_MASK_BITS_ABOVE_32(access_width), value32); 230 + 231 + bit_width -= 232 + bit_width > access_width ? access_width : bit_width; 233 + index++; 239 234 } 240 235 241 236 ACPI_DEBUG_PRINT((ACPI_DB_IO, 242 237 "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", 243 - *value, reg->bit_width, ACPI_FORMAT_UINT64(address), 238 + *value, access_width, ACPI_FORMAT_UINT64(address), 244 239 acpi_ut_get_region_name(reg->space_id))); 245 240 246 241 return (status); ··· 311 212 acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg) 312 213 { 313 214 u64 address; 215 + u8 access_width; 216 + u32 bit_width; 217 + u8 bit_offset; 218 + u64 value64; 219 + u32 new_value32, old_value32; 220 + u8 index; 314 221 acpi_status status; 315 222 316 223 ACPI_FUNCTION_NAME(hw_write); ··· 328 223 return (status); 329 224 } 330 225 226 + /* Convert access_width into number of bits based */ 227 + 228 + access_width = acpi_hw_get_access_bit_width(reg, 32); 229 + bit_width = reg->bit_offset + reg->bit_width; 230 + bit_offset = reg->bit_offset; 231 + 331 232 /* 332 233 * Two address spaces supported: Memory or IO. PCI_Config is 333 234 * not supported here because the GAS structure is insufficient 334 235 */ 335 - if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 336 - status = acpi_os_write_memory((acpi_physical_address) 337 - address, (u64)value, 338 - reg->bit_width); 339 - } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 236 + index = 0; 237 + while (bit_width) { 238 + /* 239 + * Use offset style bit reads because "Index * AccessWidth" is 240 + * ensured to be less than 32-bits by acpi_hw_validate_register(). 241 + */ 242 + new_value32 = ACPI_GET_BITS(&value, index * access_width, 243 + ACPI_MASK_BITS_ABOVE_32 244 + (access_width)); 340 245 341 - status = acpi_hw_write_port((acpi_io_address) 342 - address, value, reg->bit_width); 246 + if (bit_offset >= access_width) { 247 + bit_offset -= access_width; 248 + } else { 249 + /* 250 + * Use offset style bit masks because access_width is ensured 251 + * to be less than 32-bits by acpi_hw_validate_register() and 252 + * bit_offset/bit_width is less than access_width here. 253 + */ 254 + if (bit_offset) { 255 + new_value32 &= ACPI_MASK_BITS_BELOW(bit_offset); 256 + } 257 + if (bit_width < access_width) { 258 + new_value32 &= ACPI_MASK_BITS_ABOVE(bit_width); 259 + } 260 + 261 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 262 + if (bit_offset || bit_width < access_width) { 263 + /* 264 + * Read old values in order not to modify the bits that 265 + * are beyond the register bit_width/bit_offset setting. 266 + */ 267 + status = 268 + acpi_os_read_memory((acpi_physical_address) 269 + address + 270 + index * 271 + ACPI_DIV_8 272 + (access_width), 273 + &value64, 274 + access_width); 275 + old_value32 = (u32)value64; 276 + 277 + /* 278 + * Use offset style bit masks because access_width is 279 + * ensured to be less than 32-bits by 280 + * acpi_hw_validate_register() and bit_offset/bit_width is 281 + * less than access_width here. 282 + */ 283 + if (bit_offset) { 284 + old_value32 &= 285 + ACPI_MASK_BITS_ABOVE 286 + (bit_offset); 287 + bit_offset = 0; 288 + } 289 + if (bit_width < access_width) { 290 + old_value32 &= 291 + ACPI_MASK_BITS_BELOW 292 + (bit_width); 293 + } 294 + 295 + new_value32 |= old_value32; 296 + } 297 + 298 + value64 = (u64)new_value32; 299 + status = 300 + acpi_os_write_memory((acpi_physical_address) 301 + address + 302 + index * 303 + ACPI_DIV_8 304 + (access_width), 305 + value64, access_width); 306 + } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 307 + 308 + if (bit_offset || bit_width < access_width) { 309 + /* 310 + * Read old values in order not to modify the bits that 311 + * are beyond the register bit_width/bit_offset setting. 312 + */ 313 + status = 314 + acpi_hw_read_port((acpi_io_address) 315 + address + 316 + index * 317 + ACPI_DIV_8 318 + (access_width), 319 + &old_value32, 320 + access_width); 321 + 322 + /* 323 + * Use offset style bit masks because access_width is 324 + * ensured to be less than 32-bits by 325 + * acpi_hw_validate_register() and bit_offset/bit_width is 326 + * less than access_width here. 327 + */ 328 + if (bit_offset) { 329 + old_value32 &= 330 + ACPI_MASK_BITS_ABOVE 331 + (bit_offset); 332 + bit_offset = 0; 333 + } 334 + if (bit_width < access_width) { 335 + old_value32 &= 336 + ACPI_MASK_BITS_BELOW 337 + (bit_width); 338 + } 339 + 340 + new_value32 |= old_value32; 341 + } 342 + 343 + status = acpi_hw_write_port((acpi_io_address) 344 + address + 345 + index * 346 + ACPI_DIV_8 347 + (access_width), 348 + new_value32, 349 + access_width); 350 + } 351 + } 352 + 353 + /* 354 + * Index * access_width is ensured to be less than 32-bits by 355 + * acpi_hw_validate_register(). 356 + */ 357 + bit_width -= 358 + bit_width > access_width ? access_width : bit_width; 359 + index++; 343 360 } 344 361 345 362 ACPI_DEBUG_PRINT((ACPI_DB_IO, 346 363 "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", 347 - value, reg->bit_width, ACPI_FORMAT_UINT64(address), 364 + value, access_width, ACPI_FORMAT_UINT64(address), 348 365 acpi_ut_get_region_name(reg->space_id))); 349 366 350 367 return (status);
+4 -7
drivers/acpi/acpica/hwxface.c
··· 91 91 * compatibility with other ACPI implementations that have allowed 92 92 * BIOS code with bad register width values to go unnoticed. 93 93 */ 94 - status = 95 - acpi_os_write_port((acpi_io_address) reset_reg->address, 96 - acpi_gbl_FADT.reset_value, 97 - ACPI_RESET_REGISTER_WIDTH); 94 + status = acpi_os_write_port((acpi_io_address)reset_reg->address, 95 + acpi_gbl_FADT.reset_value, 96 + ACPI_RESET_REGISTER_WIDTH); 98 97 } else { 99 98 /* Write the reset value to the reset register */ 100 99 ··· 503 504 * Evaluate the \_Sx namespace object containing the register values 504 505 * for this state 505 506 */ 506 - info->relative_pathname = ACPI_CAST_PTR(char, 507 - acpi_gbl_sleep_state_names 508 - [sleep_state]); 507 + info->relative_pathname = acpi_gbl_sleep_state_names[sleep_state]; 509 508 510 509 status = acpi_ns_evaluate(info); 511 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",
+5 -4
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 } ··· 318 317 ******************************************************************************/ 319 318 320 319 acpi_status 321 - acpi_ns_convert_to_unicode(struct acpi_namespace_node * scope, 320 + acpi_ns_convert_to_unicode(struct acpi_namespace_node *scope, 322 321 union acpi_operand_object *original_object, 323 322 union acpi_operand_object **return_object) 324 323 { ··· 385 384 ******************************************************************************/ 386 385 387 386 acpi_status 388 - acpi_ns_convert_to_resource(struct acpi_namespace_node * scope, 387 + acpi_ns_convert_to_resource(struct acpi_namespace_node *scope, 389 388 union acpi_operand_object *original_object, 390 389 union acpi_operand_object **return_object) 391 390 { ··· 464 463 ******************************************************************************/ 465 464 466 465 acpi_status 467 - acpi_ns_convert_to_reference(struct acpi_namespace_node * scope, 466 + acpi_ns_convert_to_reference(struct acpi_namespace_node *scope, 468 467 union acpi_operand_object *original_object, 469 468 union acpi_operand_object **return_object) 470 469 {
+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
+1 -1
drivers/acpi/acpica/nsnames.c
··· 113 113 114 114 acpi_status 115 115 acpi_ns_handle_to_pathname(acpi_handle target_handle, 116 - struct acpi_buffer * buffer, u8 no_trailing) 116 + struct acpi_buffer *buffer, u8 no_trailing) 117 117 { 118 118 acpi_status status; 119 119 struct acpi_namespace_node *node;
+2 -2
drivers/acpi/acpica/nsobject.c
··· 399 399 ******************************************************************************/ 400 400 401 401 acpi_status 402 - acpi_ns_detach_data(struct acpi_namespace_node * node, 402 + acpi_ns_detach_data(struct acpi_namespace_node *node, 403 403 acpi_object_handler handler) 404 404 { 405 405 union acpi_operand_object *obj_desc; ··· 444 444 ******************************************************************************/ 445 445 446 446 acpi_status 447 - acpi_ns_get_attached_data(struct acpi_namespace_node * node, 447 + acpi_ns_get_attached_data(struct acpi_namespace_node *node, 448 448 acpi_object_handler handler, void **data) 449 449 { 450 450 union acpi_operand_object *obj_desc;
+92
drivers/acpi/acpica/nsprepkg.c
··· 62 62 u32 count1, 63 63 u8 type2, u32 count2, u32 start_index); 64 64 65 + static acpi_status 66 + acpi_ns_custom_package(struct acpi_evaluate_info *info, 67 + union acpi_operand_object **elements, u32 count); 68 + 65 69 /******************************************************************************* 66 70 * 67 71 * FUNCTION: acpi_ns_check_package ··· 139 135 * PTYPE2 packages contain subpackages 140 136 */ 141 137 switch (package->ret_info.type) { 138 + case ACPI_PTYPE_CUSTOM: 139 + 140 + status = acpi_ns_custom_package(info, elements, count); 141 + break; 142 + 142 143 case ACPI_PTYPE1_FIXED: 143 144 /* 144 145 * The package count is fixed and there are no subpackages ··· 188 179 if (ACPI_FAILURE(status)) { 189 180 return (status); 190 181 } 182 + 191 183 elements++; 192 184 } 193 185 break; ··· 235 225 return (status); 236 226 } 237 227 } 228 + 238 229 elements++; 239 230 } 240 231 break; ··· 580 569 if (sub_package->package.count < expected_count) { 581 570 goto package_too_small; 582 571 } 572 + 583 573 if (sub_package->package.count < 584 574 package->ret_info.count1) { 585 575 expected_count = package->ret_info.count1; 586 576 goto package_too_small; 587 577 } 578 + 588 579 if (expected_count == 0) { 589 580 /* 590 581 * Either the num_entries element was originally zero or it was ··· 635 622 636 623 /******************************************************************************* 637 624 * 625 + * FUNCTION: acpi_ns_custom_package 626 + * 627 + * PARAMETERS: info - Method execution information block 628 + * elements - Pointer to the package elements array 629 + * count - Element count for the package 630 + * 631 + * RETURN: Status 632 + * 633 + * DESCRIPTION: Check a returned package object for the correct count and 634 + * correct type of all sub-objects. 635 + * 636 + * NOTE: Currently used for the _BIX method only. When needed for two or more 637 + * methods, probably a detect/dispatch mechanism will be required. 638 + * 639 + ******************************************************************************/ 640 + 641 + static acpi_status 642 + acpi_ns_custom_package(struct acpi_evaluate_info *info, 643 + union acpi_operand_object **elements, u32 count) 644 + { 645 + u32 expected_count; 646 + u32 version; 647 + acpi_status status = AE_OK; 648 + 649 + ACPI_FUNCTION_NAME(ns_custom_package); 650 + 651 + /* Get version number, must be Integer */ 652 + 653 + if ((*elements)->common.type != ACPI_TYPE_INTEGER) { 654 + ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 655 + info->node_flags, 656 + "Return Package has invalid object type for version number")); 657 + return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 658 + } 659 + 660 + version = (u32)(*elements)->integer.value; 661 + expected_count = 21; /* Version 1 */ 662 + 663 + if (version == 0) { 664 + expected_count = 20; /* Version 0 */ 665 + } 666 + 667 + if (count < expected_count) { 668 + ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 669 + info->node_flags, 670 + "Return Package is too small - found %u elements, expected %u", 671 + count, expected_count)); 672 + return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 673 + } else if (count > expected_count) { 674 + ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 675 + "%s: Return Package is larger than needed - " 676 + "found %u, expected %u\n", 677 + info->full_pathname, count, expected_count)); 678 + } 679 + 680 + /* Validate all elements of the returned package */ 681 + 682 + status = acpi_ns_check_package_elements(info, elements, 683 + ACPI_RTYPE_INTEGER, 16, 684 + ACPI_RTYPE_STRING, 4, 0); 685 + if (ACPI_FAILURE(status)) { 686 + return_ACPI_STATUS(status); 687 + } 688 + 689 + /* Version 1 has a single trailing integer */ 690 + 691 + if (version > 0) { 692 + status = acpi_ns_check_package_elements(info, elements + 20, 693 + ACPI_RTYPE_INTEGER, 1, 694 + 0, 0, 20); 695 + } 696 + 697 + return_ACPI_STATUS(status); 698 + } 699 + 700 + /******************************************************************************* 701 + * 638 702 * FUNCTION: acpi_ns_check_package_elements 639 703 * 640 704 * PARAMETERS: info - Method execution information block ··· 751 661 if (ACPI_FAILURE(status)) { 752 662 return (status); 753 663 } 664 + 754 665 this_element++; 755 666 } 756 667 ··· 762 671 if (ACPI_FAILURE(status)) { 763 672 return (status); 764 673 } 674 + 765 675 this_element++; 766 676 } 767 677
+1 -1
drivers/acpi/acpica/nsrepair.c
··· 399 399 ******************************************************************************/ 400 400 401 401 acpi_status 402 - acpi_ns_repair_null_element(struct acpi_evaluate_info * info, 402 + acpi_ns_repair_null_element(struct acpi_evaluate_info *info, 403 403 u32 expected_btypes, 404 404 u32 package_index, 405 405 union acpi_operand_object **return_object_ptr)
+3 -3
drivers/acpi/acpica/nsrepair2.c
··· 54 54 * be repaired on a per-name basis. 55 55 */ 56 56 typedef 57 - acpi_status(*acpi_repair_function) (struct acpi_evaluate_info * info, 58 - union acpi_operand_object 59 - **return_object_ptr); 57 + acpi_status (*acpi_repair_function) (struct acpi_evaluate_info * info, 58 + union acpi_operand_object ** 59 + return_object_ptr); 60 60 61 61 typedef struct acpi_repair_info { 62 62 char name[ACPI_NAME_SIZE];
+4 -4
drivers/acpi/acpica/nsutils.c
··· 272 272 result = &internal_name[i]; 273 273 } else if (num_segments == 2) { 274 274 internal_name[i] = AML_DUAL_NAME_PREFIX; 275 - result = &internal_name[(acpi_size) i + 1]; 275 + result = &internal_name[(acpi_size)i + 1]; 276 276 } else { 277 277 internal_name[i] = AML_MULTI_NAME_PREFIX_OP; 278 - internal_name[(acpi_size) i + 1] = (char)num_segments; 279 - result = &internal_name[(acpi_size) i + 2]; 278 + internal_name[(acpi_size)i + 1] = (char)num_segments; 279 + result = &internal_name[(acpi_size)i + 2]; 280 280 } 281 281 } 282 282 ··· 456 456 457 457 names_index = prefix_length + 2; 458 458 num_segments = (u8) 459 - internal_name[(acpi_size) prefix_length + 1]; 459 + internal_name[(acpi_size)prefix_length + 1]; 460 460 break; 461 461 462 462 case AML_DUAL_NAME_PREFIX:
+59 -60
drivers/acpi/acpica/nsxfeval.c
··· 256 256 * Allocate a new parameter block for the internal objects 257 257 * Add 1 to count to allow for null terminated internal list 258 258 */ 259 - info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size) info-> 259 + info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size)info-> 260 260 param_count + 261 261 1) * sizeof(void *)); 262 262 if (!info->parameters) { ··· 280 280 info->parameters[info->param_count] = NULL; 281 281 } 282 282 283 - #if 0 283 + #ifdef _FUTURE_FEATURE 284 284 285 285 /* 286 286 * Begin incoming argument count analysis. Check for too few args 287 287 * and too many args. 288 288 */ 289 - 290 289 switch (acpi_ns_get_type(info->node)) { 291 290 case ACPI_TYPE_METHOD: 292 291 ··· 369 370 * If we are expecting a return value, and all went well above, 370 371 * copy the return value to an external object. 371 372 */ 372 - if (return_buffer) { 373 - if (!info->return_object) { 374 - return_buffer->length = 0; 373 + if (!return_buffer) { 374 + goto cleanup_return_object; 375 + } 376 + 377 + if (!info->return_object) { 378 + return_buffer->length = 0; 379 + goto cleanup; 380 + } 381 + 382 + if (ACPI_GET_DESCRIPTOR_TYPE(info->return_object) == 383 + ACPI_DESC_TYPE_NAMED) { 384 + /* 385 + * If we received a NS Node as a return object, this means that 386 + * the object we are evaluating has nothing interesting to 387 + * return (such as a mutex, etc.) We return an error because 388 + * these types are essentially unsupported by this interface. 389 + * We don't check up front because this makes it easier to add 390 + * support for various types at a later date if necessary. 391 + */ 392 + status = AE_TYPE; 393 + info->return_object = NULL; /* No need to delete a NS Node */ 394 + return_buffer->length = 0; 395 + } 396 + 397 + if (ACPI_FAILURE(status)) { 398 + goto cleanup_return_object; 399 + } 400 + 401 + /* Dereference Index and ref_of references */ 402 + 403 + acpi_ns_resolve_references(info); 404 + 405 + /* Get the size of the returned object */ 406 + 407 + status = acpi_ut_get_object_size(info->return_object, 408 + &buffer_space_needed); 409 + if (ACPI_SUCCESS(status)) { 410 + 411 + /* Validate/Allocate/Clear caller buffer */ 412 + 413 + status = acpi_ut_initialize_buffer(return_buffer, 414 + buffer_space_needed); 415 + if (ACPI_FAILURE(status)) { 416 + /* 417 + * Caller's buffer is too small or a new one can't 418 + * be allocated 419 + */ 420 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, 421 + "Needed buffer size %X, %s\n", 422 + (u32)buffer_space_needed, 423 + acpi_format_exception(status))); 375 424 } else { 376 - if (ACPI_GET_DESCRIPTOR_TYPE(info->return_object) == 377 - ACPI_DESC_TYPE_NAMED) { 378 - /* 379 - * If we received a NS Node as a return object, this means that 380 - * the object we are evaluating has nothing interesting to 381 - * return (such as a mutex, etc.) We return an error because 382 - * these types are essentially unsupported by this interface. 383 - * We don't check up front because this makes it easier to add 384 - * support for various types at a later date if necessary. 385 - */ 386 - status = AE_TYPE; 387 - info->return_object = NULL; /* No need to delete a NS Node */ 388 - return_buffer->length = 0; 389 - } 425 + /* We have enough space for the object, build it */ 390 426 391 - if (ACPI_SUCCESS(status)) { 392 - 393 - /* Dereference Index and ref_of references */ 394 - 395 - acpi_ns_resolve_references(info); 396 - 397 - /* Get the size of the returned object */ 398 - 399 - status = 400 - acpi_ut_get_object_size(info->return_object, 401 - &buffer_space_needed); 402 - if (ACPI_SUCCESS(status)) { 403 - 404 - /* Validate/Allocate/Clear caller buffer */ 405 - 406 - status = 407 - acpi_ut_initialize_buffer 408 - (return_buffer, 409 - buffer_space_needed); 410 - if (ACPI_FAILURE(status)) { 411 - /* 412 - * Caller's buffer is too small or a new one can't 413 - * be allocated 414 - */ 415 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 416 - "Needed buffer size %X, %s\n", 417 - (u32) 418 - buffer_space_needed, 419 - acpi_format_exception 420 - (status))); 421 - } else { 422 - /* We have enough space for the object, build it */ 423 - 424 - status = 425 - acpi_ut_copy_iobject_to_eobject 426 - (info->return_object, 427 - return_buffer); 428 - } 429 - } 430 - } 427 + status = 428 + acpi_ut_copy_iobject_to_eobject(info->return_object, 429 + return_buffer); 431 430 } 432 431 } 432 + 433 + cleanup_return_object: 433 434 434 435 if (info->return_object) { 435 436 /*
+3 -3
drivers/acpi/acpica/nsxfname.c
··· 78 78 79 79 acpi_status 80 80 acpi_get_handle(acpi_handle parent, 81 - acpi_string pathname, acpi_handle * ret_handle) 81 + acpi_string pathname, acpi_handle *ret_handle) 82 82 { 83 83 acpi_status status; 84 84 struct acpi_namespace_node *node = NULL; ··· 155 155 * 156 156 ******************************************************************************/ 157 157 acpi_status 158 - acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer) 158 + acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer *buffer) 159 159 { 160 160 acpi_status status; 161 161 struct acpi_namespace_node *node; ··· 448 448 /* Point past the CID PNP_DEVICE_ID array */ 449 449 450 450 next_id_string += 451 - ((acpi_size) cid_list->count * 451 + ((acpi_size)cid_list->count * 452 452 sizeof(struct acpi_pnp_device_id)); 453 453 } 454 454
+3 -3
drivers/acpi/acpica/nsxfobj.c
··· 63 63 * DESCRIPTION: This routine returns the type associatd with a particular handle 64 64 * 65 65 ******************************************************************************/ 66 - acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type) 66 + acpi_status acpi_get_type(acpi_handle handle, acpi_object_type *ret_type) 67 67 { 68 68 struct acpi_namespace_node *node; 69 69 acpi_status status; ··· 115 115 * Handle. 116 116 * 117 117 ******************************************************************************/ 118 - acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle) 118 + acpi_status acpi_get_parent(acpi_handle handle, acpi_handle *ret_handle) 119 119 { 120 120 struct acpi_namespace_node *node; 121 121 struct acpi_namespace_node *parent_node; ··· 183 183 acpi_status 184 184 acpi_get_next_object(acpi_object_type type, 185 185 acpi_handle parent, 186 - acpi_handle child, acpi_handle * ret_handle) 186 + acpi_handle child, acpi_handle *ret_handle) 187 187 { 188 188 acpi_status status; 189 189 struct acpi_namespace_node *node;
+1 -1
drivers/acpi/acpica/psargs.c
··· 87 87 * used to encode the package length, either 0,1,2, or 3 88 88 */ 89 89 byte_count = (aml[0] >> 6); 90 - parser_state->aml += ((acpi_size) byte_count + 1); 90 + parser_state->aml += ((acpi_size)byte_count + 1); 91 91 92 92 /* Get bytes 3, 2, 1 as needed */ 93 93
+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
+2 -2
drivers/acpi/acpica/psparse.c
··· 130 130 ******************************************************************************/ 131 131 132 132 acpi_status 133 - acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, 134 - union acpi_parse_object * op) 133 + acpi_ps_complete_this_op(struct acpi_walk_state *walk_state, 134 + union acpi_parse_object *op) 135 135 { 136 136 union acpi_parse_object *prev; 137 137 union acpi_parse_object *next;
+1 -1
drivers/acpi/acpica/psutils.c
··· 128 128 if (op_info->flags & AML_DEFER) { 129 129 flags = ACPI_PARSEOP_DEFERRED; 130 130 } else if (op_info->flags & AML_NAMED) { 131 - flags = ACPI_PARSEOP_NAMED; 131 + flags = ACPI_PARSEOP_NAMED_OBJECT; 132 132 } else if (opcode == AML_INT_BYTELIST_OP) { 133 133 flags = ACPI_PARSEOP_BYTELIST; 134 134 }
+1 -1
drivers/acpi/acpica/psxface.c
··· 115 115 * 116 116 ******************************************************************************/ 117 117 118 - acpi_status acpi_ps_execute_method(struct acpi_evaluate_info * info) 118 + acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) 119 119 { 120 120 acpi_status status; 121 121 union acpi_parse_object *op;
+45 -45
drivers/acpi/acpica/rscalc.c
··· 112 112 * resource_source_index (1). 113 113 */ 114 114 if (resource_source->string_ptr) { 115 - return ((acpi_rs_length) (resource_source->string_length + 1)); 115 + return ((acpi_rs_length)(resource_source->string_length + 1)); 116 116 } 117 117 118 118 return (0); ··· 188 188 189 189 acpi_status 190 190 acpi_rs_get_aml_length(struct acpi_resource *resource, 191 - acpi_size resource_list_size, acpi_size * size_needed) 191 + acpi_size resource_list_size, acpi_size *size_needed) 192 192 { 193 193 acpi_size aml_size_needed = 0; 194 194 struct acpi_resource *resource_end; ··· 278 278 * 16-Bit Address Resource: 279 279 * Add the size of the optional resource_source info 280 280 */ 281 - total_size = (acpi_rs_length) (total_size + 282 - acpi_rs_struct_option_length 283 - (&resource->data. 284 - address16. 285 - resource_source)); 281 + total_size = (acpi_rs_length)(total_size + 282 + acpi_rs_struct_option_length 283 + (&resource->data. 284 + address16. 285 + resource_source)); 286 286 break; 287 287 288 288 case ACPI_RESOURCE_TYPE_ADDRESS32: ··· 290 290 * 32-Bit Address Resource: 291 291 * Add the size of the optional resource_source info 292 292 */ 293 - total_size = (acpi_rs_length) (total_size + 294 - acpi_rs_struct_option_length 295 - (&resource->data. 296 - address32. 297 - resource_source)); 293 + total_size = (acpi_rs_length)(total_size + 294 + acpi_rs_struct_option_length 295 + (&resource->data. 296 + address32. 297 + resource_source)); 298 298 break; 299 299 300 300 case ACPI_RESOURCE_TYPE_ADDRESS64: ··· 302 302 * 64-Bit Address Resource: 303 303 * Add the size of the optional resource_source info 304 304 */ 305 - total_size = (acpi_rs_length) (total_size + 306 - acpi_rs_struct_option_length 307 - (&resource->data. 308 - address64. 309 - resource_source)); 305 + total_size = (acpi_rs_length)(total_size + 306 + acpi_rs_struct_option_length 307 + (&resource->data. 308 + address64. 309 + resource_source)); 310 310 break; 311 311 312 312 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: ··· 315 315 * Add the size of each additional optional interrupt beyond the 316 316 * required 1 (4 bytes for each u32 interrupt number) 317 317 */ 318 - total_size = (acpi_rs_length) (total_size + 319 - ((resource->data. 320 - extended_irq. 321 - interrupt_count - 322 - 1) * 4) + 323 - /* Add the size of the optional resource_source info */ 324 - acpi_rs_struct_option_length 325 - (&resource->data. 318 + total_size = (acpi_rs_length)(total_size + 319 + ((resource->data. 326 320 extended_irq. 327 - resource_source)); 321 + interrupt_count - 322 + 1) * 4) + 323 + /* Add the size of the optional resource_source info */ 324 + acpi_rs_struct_option_length 325 + (&resource->data. 326 + extended_irq. 327 + resource_source)); 328 328 break; 329 329 330 330 case ACPI_RESOURCE_TYPE_GPIO: 331 331 332 - total_size = (acpi_rs_length) (total_size + 333 - (resource->data.gpio. 334 - pin_table_length * 2) + 335 - resource->data.gpio. 336 - resource_source. 337 - string_length + 338 - resource->data.gpio. 339 - vendor_length); 332 + total_size = (acpi_rs_length)(total_size + 333 + (resource->data.gpio. 334 + pin_table_length * 2) + 335 + resource->data.gpio. 336 + resource_source. 337 + string_length + 338 + resource->data.gpio. 339 + vendor_length); 340 340 341 341 break; 342 342 ··· 348 348 common_serial_bus. 349 349 type]; 350 350 351 - total_size = (acpi_rs_length) (total_size + 352 - resource->data. 353 - i2c_serial_bus. 354 - resource_source. 355 - string_length + 356 - resource->data. 357 - i2c_serial_bus. 358 - vendor_length); 351 + total_size = (acpi_rs_length)(total_size + 352 + resource->data. 353 + i2c_serial_bus. 354 + resource_source. 355 + string_length + 356 + resource->data. 357 + i2c_serial_bus. 358 + vendor_length); 359 359 360 360 break; 361 361 ··· 397 397 ******************************************************************************/ 398 398 399 399 acpi_status 400 - acpi_rs_get_list_length(u8 * aml_buffer, 401 - u32 aml_buffer_length, acpi_size * size_needed) 400 + acpi_rs_get_list_length(u8 *aml_buffer, 401 + u32 aml_buffer_length, acpi_size *size_needed) 402 402 { 403 403 acpi_status status; 404 404 u8 *end_aml; ··· 610 610 611 611 acpi_status 612 612 acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, 613 - acpi_size * buffer_size_needed) 613 + acpi_size *buffer_size_needed) 614 614 { 615 615 u32 number_of_elements; 616 616 acpi_size temp_size_needed = 0;
+1 -1
drivers/acpi/acpica/rscreate.c
··· 347 347 (u8 *) output_buffer->pointer); 348 348 path_buffer.pointer = user_prt->source; 349 349 350 - status = acpi_ns_handle_to_pathname((acpi_handle) node, &path_buffer, FALSE); 350 + status = acpi_ns_handle_to_pathname((acpi_handle)node, &path_buffer, FALSE); 351 351 352 352 /* +1 to include null terminator */ 353 353
+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);
+5 -4
drivers/acpi/acpica/rsdumpinfo.c
··· 330 330 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.type), "Type", acpi_gbl_sbt_decode}, \ 331 331 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.producer_consumer), "ProducerConsumer", acpi_gbl_consume_decode}, \ 332 332 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.slave_mode), "SlaveMode", acpi_gbl_sm_decode}, \ 333 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.connection_sharing),"ConnectionSharing", acpi_gbl_shr_decode}, \ 333 334 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.type_revision_id), "TypeRevisionId", NULL}, \ 334 335 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (common_serial_bus.type_data_length), "TypeDataLength", NULL}, \ 335 336 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (common_serial_bus.resource_source), "ResourceSource", NULL}, \ 336 337 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (common_serial_bus.vendor_length), "VendorLength", NULL}, \ 337 338 {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (common_serial_bus.vendor_data), "VendorData", NULL}, 338 339 339 - struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[10] = { 340 + struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[11] = { 340 341 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_common_serial_bus), 341 342 "Common Serial Bus", NULL}, 342 343 ACPI_RS_DUMP_COMMON_SERIAL_BUS 343 344 }; 344 345 345 - struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[13] = { 346 + struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[14] = { 346 347 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus), 347 348 "I2C Serial Bus", NULL}, 348 349 ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG, ··· 356 355 "SlaveAddress", NULL}, 357 356 }; 358 357 359 - struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[17] = { 358 + struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[18] = { 360 359 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_spi_serial_bus), 361 360 "Spi Serial Bus", NULL}, 362 361 ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG, ··· 377 376 "ConnectionSpeed", NULL}, 378 377 }; 379 378 380 - struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[19] = { 379 + struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[20] = { 381 380 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_uart_serial_bus), 382 381 "Uart Serial Bus", NULL}, 383 382 ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_2BITFLAG,
+1 -1
drivers/acpi/acpica/rsmisc.c
··· 87 87 return_ACPI_STATUS(AE_BAD_PARAMETER); 88 88 } 89 89 90 - if (((acpi_size) resource) & 0x3) { 90 + if (((acpi_size)resource) & 0x3) { 91 91 92 92 /* Each internal resource struct is expected to be 32-bit aligned */ 93 93
+18 -3
drivers/acpi/acpica/rsserial.c
··· 151 151 * 152 152 ******************************************************************************/ 153 153 154 - struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[16] = { 154 + struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[17] = { 155 155 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 156 156 ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus), 157 157 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_i2c_serial_bus)}, ··· 176 176 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer), 177 177 AML_OFFSET(common_serial_bus.flags), 178 178 1}, 179 + 180 + {ACPI_RSC_1BITFLAG, 181 + ACPI_RS_OFFSET(data.common_serial_bus.connection_sharing), 182 + AML_OFFSET(common_serial_bus.flags), 183 + 2}, 179 184 180 185 {ACPI_RSC_MOVE8, 181 186 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id), ··· 242 237 * 243 238 ******************************************************************************/ 244 239 245 - struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[20] = { 240 + struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[21] = { 246 241 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 247 242 ACPI_RS_SIZE(struct acpi_resource_spi_serialbus), 248 243 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_spi_serial_bus)}, ··· 267 262 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer), 268 263 AML_OFFSET(common_serial_bus.flags), 269 264 1}, 265 + 266 + {ACPI_RSC_1BITFLAG, 267 + ACPI_RS_OFFSET(data.common_serial_bus.connection_sharing), 268 + AML_OFFSET(common_serial_bus.flags), 269 + 2}, 270 270 271 271 {ACPI_RSC_MOVE8, 272 272 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id), ··· 349 339 * 350 340 ******************************************************************************/ 351 341 352 - struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[22] = { 342 + struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[23] = { 353 343 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 354 344 ACPI_RS_SIZE(struct acpi_resource_uart_serialbus), 355 345 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_uart_serial_bus)}, ··· 374 364 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer), 375 365 AML_OFFSET(common_serial_bus.flags), 376 366 1}, 367 + 368 + {ACPI_RSC_1BITFLAG, 369 + ACPI_RS_OFFSET(data.common_serial_bus.connection_sharing), 370 + AML_OFFSET(common_serial_bus.flags), 371 + 2}, 377 372 378 373 {ACPI_RSC_MOVE8, 379 374 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
+7 -7
drivers/acpi/acpica/rsutils.c
··· 338 338 * Note: Some resource descriptors will have an additional null, so 339 339 * we add 1 to the minimum length. 340 340 */ 341 - if (total_length > (acpi_rsdesc_size) (minimum_length + 1)) { 341 + if (total_length > (acpi_rsdesc_size)(minimum_length + 1)) { 342 342 343 343 /* Get the resource_source_index */ 344 344 ··· 377 377 ACPI_CAST_PTR(char, 378 378 &aml_resource_source[1])); 379 379 380 - return ((acpi_rs_length) total_length); 380 + return ((acpi_rs_length)total_length); 381 381 } 382 382 383 383 /* resource_source is not present */ ··· 406 406 ******************************************************************************/ 407 407 408 408 acpi_rsdesc_size 409 - acpi_rs_set_resource_source(union aml_resource * aml, 409 + acpi_rs_set_resource_source(union aml_resource *aml, 410 410 acpi_rs_length minimum_length, 411 - struct acpi_resource_source * resource_source) 411 + struct acpi_resource_source *resource_source) 412 412 { 413 413 u8 *aml_resource_source; 414 414 acpi_rsdesc_size descriptor_length; ··· 466 466 ******************************************************************************/ 467 467 468 468 acpi_status 469 - acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, 470 - struct acpi_buffer * ret_buffer) 469 + acpi_rs_get_prt_method_data(struct acpi_namespace_node *node, 470 + struct acpi_buffer *ret_buffer) 471 471 { 472 472 union acpi_operand_object *obj_desc; 473 473 acpi_status status; ··· 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;
+3 -3
drivers/acpi/acpica/rsxface.c
··· 433 433 acpi_status 434 434 acpi_get_vendor_resource(acpi_handle device_handle, 435 435 char *name, 436 - struct acpi_vendor_uuid * uuid, 437 - struct acpi_buffer * ret_buffer) 436 + struct acpi_vendor_uuid *uuid, 437 + struct acpi_buffer *ret_buffer) 438 438 { 439 439 struct acpi_vendor_walk_info info; 440 440 acpi_status status; ··· 539 539 ******************************************************************************/ 540 540 541 541 acpi_status 542 - acpi_walk_resource_buffer(struct acpi_buffer * buffer, 542 + acpi_walk_resource_buffer(struct acpi_buffer *buffer, 543 543 acpi_walk_resource_callback user_function, 544 544 void *context) 545 545 {
+7 -8
drivers/acpi/acpica/tbdata.c
··· 368 368 *****************************************************************************/ 369 369 370 370 acpi_status 371 - acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature) 371 + acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature) 372 372 { 373 373 acpi_status status = AE_OK; 374 374 ··· 401 401 ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, 402 402 "%4.4s 0x%8.8X%8.8X" 403 403 " Attempted table install failed", 404 - acpi_ut_valid_acpi_name(table_desc-> 405 - signature. 406 - ascii) ? 404 + acpi_ut_valid_nameseg(table_desc-> 405 + signature. 406 + ascii) ? 407 407 table_desc->signature.ascii : "????", 408 408 ACPI_FORMAT_UINT64(table_desc-> 409 409 address))); ··· 454 454 table_count = acpi_gbl_root_table_list.current_table_count; 455 455 } 456 456 457 - tables = ACPI_ALLOCATE_ZEROED(((acpi_size) table_count + 457 + tables = ACPI_ALLOCATE_ZEROED(((acpi_size)table_count + 458 458 ACPI_ROOT_TABLE_SIZE_INCREMENT) * 459 459 sizeof(struct acpi_table_desc)); 460 460 if (!tables) { ··· 467 467 468 468 if (acpi_gbl_root_table_list.tables) { 469 469 memcpy(tables, acpi_gbl_root_table_list.tables, 470 - (acpi_size) table_count * 471 - sizeof(struct acpi_table_desc)); 470 + (acpi_size)table_count * sizeof(struct acpi_table_desc)); 472 471 473 472 if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { 474 473 ACPI_FREE(acpi_gbl_root_table_list.tables); ··· 700 701 * 701 702 ******************************************************************************/ 702 703 703 - acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id * owner_id) 704 + acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id) 704 705 { 705 706 acpi_status status = AE_BAD_PARAMETER; 706 707
+16 -12
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 ··· 344 344 345 345 /* Obtain the DSDT and FACS tables via their addresses within the FADT */ 346 346 347 - acpi_tb_install_fixed_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt, 347 + acpi_tb_install_fixed_table((acpi_physical_address)acpi_gbl_FADT.Xdsdt, 348 348 ACPI_SIG_DSDT, &acpi_gbl_dsdt_index); 349 349 350 350 /* If Hardware Reduced flag is set, there is no FACS */ ··· 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/tbfind.c
··· 76 76 77 77 /* Validate the input table signature */ 78 78 79 - if (!acpi_is_valid_signature(signature)) { 79 + if (!acpi_ut_valid_nameseg(signature)) { 80 80 return_ACPI_STATUS(AE_BAD_SIGNATURE); 81 81 } 82 82
+3 -3
drivers/acpi/acpica/tbinstal.c
··· 299 299 ACPI_BIOS_ERROR((AE_INFO, 300 300 "Table has invalid signature [%4.4s] (0x%8.8X), " 301 301 "must be SSDT or OEMx", 302 - acpi_ut_valid_acpi_name(new_table_desc. 303 - signature. 304 - ascii) ? 302 + acpi_ut_valid_nameseg(new_table_desc. 303 + signature. 304 + ascii) ? 305 305 new_table_desc.signature. 306 306 ascii : "????", 307 307 new_table_desc.signature.integer));
+3 -30
drivers/acpi/acpica/tbutils.c
··· 231 231 ACPI_FORMAT_UINT64(address64))); 232 232 } 233 233 #endif 234 - return ((acpi_physical_address) (address64)); 234 + return ((acpi_physical_address)(address64)); 235 235 } 236 236 } 237 237 ··· 287 287 * the XSDT if the revision is > 1 and the XSDT pointer is present, 288 288 * as per the ACPI specification. 289 289 */ 290 - address = (acpi_physical_address) rsdp->xsdt_physical_address; 290 + address = (acpi_physical_address)rsdp->xsdt_physical_address; 291 291 table_entry_size = ACPI_XSDT_ENTRY_SIZE; 292 292 } else { 293 293 /* Root table is an RSDT (32-bit physical addresses) */ 294 294 295 - address = (acpi_physical_address) rsdp->rsdt_physical_address; 295 + address = (acpi_physical_address)rsdp->rsdt_physical_address; 296 296 table_entry_size = ACPI_RSDT_ENTRY_SIZE; 297 297 } 298 298 ··· 379 379 380 380 acpi_os_unmap_memory(table, length); 381 381 return_ACPI_STATUS(AE_OK); 382 - } 383 - 384 - /******************************************************************************* 385 - * 386 - * FUNCTION: acpi_is_valid_signature 387 - * 388 - * PARAMETERS: signature - Sig string to be validated 389 - * 390 - * RETURN: TRUE if signature is has 4 valid ACPI characters 391 - * 392 - * DESCRIPTION: Validate an ACPI table signature. 393 - * 394 - ******************************************************************************/ 395 - 396 - u8 acpi_is_valid_signature(char *signature) 397 - { 398 - u32 i; 399 - 400 - /* Validate each character in the signature */ 401 - 402 - for (i = 0; i < ACPI_NAME_SIZE; i++) { 403 - if (!acpi_ut_valid_acpi_char(signature[i], i)) { 404 - return (FALSE); 405 - } 406 - } 407 - 408 - return (TRUE); 409 382 }
+3 -3
drivers/acpi/acpica/tbxface.c
··· 99 99 ******************************************************************************/ 100 100 101 101 acpi_status __init 102 - acpi_initialize_tables(struct acpi_table_desc * initial_table_array, 102 + acpi_initialize_tables(struct acpi_table_desc *initial_table_array, 103 103 u32 initial_table_count, u8 allow_resize) 104 104 { 105 105 acpi_physical_address rsdp_address; ··· 120 120 /* Root Table Array has been statically allocated by the host */ 121 121 122 122 memset(initial_table_array, 0, 123 - (acpi_size) initial_table_count * 123 + (acpi_size)initial_table_count * 124 124 sizeof(struct acpi_table_desc)); 125 125 126 126 acpi_gbl_root_table_list.tables = initial_table_array; ··· 352 352 * 353 353 ******************************************************************************/ 354 354 acpi_status 355 - acpi_get_table_by_index(u32 table_index, struct acpi_table_header ** table) 355 + acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) 356 356 { 357 357 acpi_status status; 358 358
+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);
+4 -4
drivers/acpi/acpica/tbxfroot.c
··· 90 90 * 91 91 ******************************************************************************/ 92 92 93 - acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp * rsdp) 93 + acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) 94 94 { 95 95 96 96 /* ··· 142 142 * 143 143 ******************************************************************************/ 144 144 145 - acpi_status __init acpi_find_root_pointer(acpi_physical_address * table_address) 145 + acpi_status __init acpi_find_root_pointer(acpi_physical_address *table_address) 146 146 { 147 147 u8 *table_ptr; 148 148 u8 *mem_rover; ··· 201 201 (u32) ACPI_PTR_DIFF(mem_rover, table_ptr); 202 202 203 203 *table_address = 204 - (acpi_physical_address) physical_address; 204 + (acpi_physical_address)physical_address; 205 205 return_ACPI_STATUS(AE_OK); 206 206 } 207 207 } ··· 234 234 (ACPI_HI_RSDP_WINDOW_BASE + 235 235 ACPI_PTR_DIFF(mem_rover, table_ptr)); 236 236 237 - *table_address = (acpi_physical_address) physical_address; 237 + *table_address = (acpi_physical_address)physical_address; 238 238 return_ACPI_STATUS(AE_OK); 239 239 } 240 240
+2 -3
drivers/acpi/acpica/utalloc.c
··· 231 231 * 232 232 ******************************************************************************/ 233 233 234 - acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) 234 + acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer) 235 235 { 236 236 237 237 /* Obviously, the structure pointer must be valid */ ··· 272 272 ******************************************************************************/ 273 273 274 274 acpi_status 275 - acpi_ut_initialize_buffer(struct acpi_buffer * buffer, 276 - acpi_size required_length) 275 + acpi_ut_initialize_buffer(struct acpi_buffer *buffer, acpi_size required_length) 277 276 { 278 277 acpi_size input_buffer_length; 279 278
+140
drivers/acpi/acpica/utascii.c
··· 1 + /****************************************************************************** 2 + * 3 + * Module Name: utascii - Utility ascii functions 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 + 47 + /******************************************************************************* 48 + * 49 + * FUNCTION: acpi_ut_valid_nameseg 50 + * 51 + * PARAMETERS: name - The name or table signature to be examined. 52 + * Four characters, does not have to be a 53 + * NULL terminated string. 54 + * 55 + * RETURN: TRUE if signature is has 4 valid ACPI characters 56 + * 57 + * DESCRIPTION: Validate an ACPI table signature. 58 + * 59 + ******************************************************************************/ 60 + 61 + u8 acpi_ut_valid_nameseg(char *name) 62 + { 63 + u32 i; 64 + 65 + /* Validate each character in the signature */ 66 + 67 + for (i = 0; i < ACPI_NAME_SIZE; i++) { 68 + if (!acpi_ut_valid_name_char(name[i], i)) { 69 + return (FALSE); 70 + } 71 + } 72 + 73 + return (TRUE); 74 + } 75 + 76 + /******************************************************************************* 77 + * 78 + * FUNCTION: acpi_ut_valid_name_char 79 + * 80 + * PARAMETERS: char - The character to be examined 81 + * position - Byte position (0-3) 82 + * 83 + * RETURN: TRUE if the character is valid, FALSE otherwise 84 + * 85 + * DESCRIPTION: Check for a valid ACPI character. Must be one of: 86 + * 1) Upper case alpha 87 + * 2) numeric 88 + * 3) underscore 89 + * 90 + * We allow a '!' as the last character because of the ASF! table 91 + * 92 + ******************************************************************************/ 93 + 94 + u8 acpi_ut_valid_name_char(char character, u32 position) 95 + { 96 + 97 + if (!((character >= 'A' && character <= 'Z') || 98 + (character >= '0' && character <= '9') || (character == '_'))) { 99 + 100 + /* Allow a '!' in the last position */ 101 + 102 + if (character == '!' && position == 3) { 103 + return (TRUE); 104 + } 105 + 106 + return (FALSE); 107 + } 108 + 109 + return (TRUE); 110 + } 111 + 112 + /******************************************************************************* 113 + * 114 + * FUNCTION: acpi_ut_check_and_repair_ascii 115 + * 116 + * PARAMETERS: name - Ascii string 117 + * count - Number of characters to check 118 + * 119 + * RETURN: None 120 + * 121 + * DESCRIPTION: Ensure that the requested number of characters are printable 122 + * Ascii characters. Sets non-printable and null chars to <space>. 123 + * 124 + ******************************************************************************/ 125 + 126 + void acpi_ut_check_and_repair_ascii(u8 *name, char *repaired_name, u32 count) 127 + { 128 + u32 i; 129 + 130 + for (i = 0; i < count; i++) { 131 + repaired_name[i] = (char)name[i]; 132 + 133 + if (!name[i]) { 134 + return; 135 + } 136 + if (!isprint(name[i])) { 137 + repaired_name[i] = ' '; 138 + } 139 + } 140 + }
+12 -12
drivers/acpi/acpica/utbuffer.c
··· 106 106 default: /* Default is BYTE display */ 107 107 108 108 acpi_os_printf("%02X ", 109 - buffer[(acpi_size) i + j]); 109 + buffer[(acpi_size)i + j]); 110 110 break; 111 111 112 112 case DB_WORD_DISPLAY: 113 113 114 114 ACPI_MOVE_16_TO_32(&temp32, 115 - &buffer[(acpi_size) i + j]); 115 + &buffer[(acpi_size)i + j]); 116 116 acpi_os_printf("%04X ", temp32); 117 117 break; 118 118 119 119 case DB_DWORD_DISPLAY: 120 120 121 121 ACPI_MOVE_32_TO_32(&temp32, 122 - &buffer[(acpi_size) i + j]); 122 + &buffer[(acpi_size)i + j]); 123 123 acpi_os_printf("%08X ", temp32); 124 124 break; 125 125 126 126 case DB_QWORD_DISPLAY: 127 127 128 128 ACPI_MOVE_32_TO_32(&temp32, 129 - &buffer[(acpi_size) i + j]); 129 + &buffer[(acpi_size)i + j]); 130 130 acpi_os_printf("%08X", temp32); 131 131 132 132 ACPI_MOVE_32_TO_32(&temp32, 133 - &buffer[(acpi_size) i + j + 133 + &buffer[(acpi_size)i + j + 134 134 4]); 135 135 acpi_os_printf("%08X ", temp32); 136 136 break; ··· 158 158 acpi_os_printf("// "); 159 159 } 160 160 161 - buf_char = buffer[(acpi_size) i + j]; 161 + buf_char = buffer[(acpi_size)i + j]; 162 162 if (isprint(buf_char)) { 163 163 acpi_os_printf("%c", buf_char); 164 164 } else { ··· 274 274 default: /* Default is BYTE display */ 275 275 276 276 acpi_ut_file_printf(file, "%02X ", 277 - buffer[(acpi_size) i + j]); 277 + buffer[(acpi_size)i + j]); 278 278 break; 279 279 280 280 case DB_WORD_DISPLAY: 281 281 282 282 ACPI_MOVE_16_TO_32(&temp32, 283 - &buffer[(acpi_size) i + j]); 283 + &buffer[(acpi_size)i + j]); 284 284 acpi_ut_file_printf(file, "%04X ", temp32); 285 285 break; 286 286 287 287 case DB_DWORD_DISPLAY: 288 288 289 289 ACPI_MOVE_32_TO_32(&temp32, 290 - &buffer[(acpi_size) i + j]); 290 + &buffer[(acpi_size)i + j]); 291 291 acpi_ut_file_printf(file, "%08X ", temp32); 292 292 break; 293 293 294 294 case DB_QWORD_DISPLAY: 295 295 296 296 ACPI_MOVE_32_TO_32(&temp32, 297 - &buffer[(acpi_size) i + j]); 297 + &buffer[(acpi_size)i + j]); 298 298 acpi_ut_file_printf(file, "%08X", temp32); 299 299 300 300 ACPI_MOVE_32_TO_32(&temp32, 301 - &buffer[(acpi_size) i + j + 301 + &buffer[(acpi_size)i + j + 302 302 4]); 303 303 acpi_ut_file_printf(file, "%08X ", temp32); 304 304 break; ··· 318 318 return; 319 319 } 320 320 321 - buf_char = buffer[(acpi_size) i + j]; 321 + buf_char = buffer[(acpi_size)i + j]; 322 322 if (isprint(buf_char)) { 323 323 acpi_ut_file_printf(file, "%c", buf_char); 324 324 } else {
+3 -4
drivers/acpi/acpica/utcache.c
··· 105 105 * 106 106 ******************************************************************************/ 107 107 108 - acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) 108 + acpi_status acpi_os_purge_cache(struct acpi_memory_list *cache) 109 109 { 110 110 void *next; 111 111 acpi_status status; ··· 151 151 * 152 152 ******************************************************************************/ 153 153 154 - acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache) 154 + acpi_status acpi_os_delete_cache(struct acpi_memory_list *cache) 155 155 { 156 156 acpi_status status; 157 157 ··· 184 184 * 185 185 ******************************************************************************/ 186 186 187 - acpi_status 188 - acpi_os_release_object(struct acpi_memory_list * cache, void *object) 187 + acpi_status acpi_os_release_object(struct acpi_memory_list *cache, void *object) 189 188 { 190 189 acpi_status status; 191 190
+8 -8
drivers/acpi/acpica/utcopy.c
··· 53 53 static acpi_status 54 54 acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, 55 55 union acpi_object *external_object, 56 - u8 * data_space, acpi_size * buffer_space_used); 56 + u8 *data_space, acpi_size *buffer_space_used); 57 57 58 58 static acpi_status 59 59 acpi_ut_copy_ielement_to_ielement(u8 object_type, ··· 63 63 64 64 static acpi_status 65 65 acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, 66 - u8 * buffer, acpi_size * space_used); 66 + u8 *buffer, acpi_size *space_used); 67 67 68 68 static acpi_status 69 69 acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj, ··· 111 111 static acpi_status 112 112 acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, 113 113 union acpi_object *external_object, 114 - u8 * data_space, acpi_size * buffer_space_used) 114 + u8 *data_space, acpi_size *buffer_space_used) 115 115 { 116 116 acpi_status status = AE_OK; 117 117 ··· 151 151 152 152 memcpy((void *)data_space, 153 153 (void *)internal_object->string.pointer, 154 - (acpi_size) internal_object->string.length + 1); 154 + (acpi_size)internal_object->string.length + 1); 155 155 break; 156 156 157 157 case ACPI_TYPE_BUFFER: ··· 331 331 332 332 static acpi_status 333 333 acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, 334 - u8 * buffer, acpi_size * space_used) 334 + u8 *buffer, acpi_size *space_used) 335 335 { 336 336 union acpi_object *external_object; 337 337 acpi_status status; ··· 362 362 * Leave room for an array of ACPI_OBJECTS in the buffer 363 363 * and move the free space past it 364 364 */ 365 - info.length += (acpi_size) external_object->package.count * 365 + info.length += (acpi_size)external_object->package.count * 366 366 ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); 367 367 info.free_space += external_object->package.count * 368 368 ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); ··· 738 738 */ 739 739 if (source_desc->string.pointer) { 740 740 dest_desc->string.pointer = 741 - ACPI_ALLOCATE((acpi_size) source_desc->string. 741 + ACPI_ALLOCATE((acpi_size)source_desc->string. 742 742 length + 1); 743 743 if (!dest_desc->string.pointer) { 744 744 return (AE_NO_MEMORY); ··· 748 748 749 749 memcpy(dest_desc->string.pointer, 750 750 source_desc->string.pointer, 751 - (acpi_size) source_desc->string.length + 1); 751 + (acpi_size)source_desc->string.length + 1); 752 752 } 753 753 break; 754 754
+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
+4 -4
drivers/acpi/acpica/utids.c
··· 95 95 96 96 hid = 97 97 ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + 98 - (acpi_size) length); 98 + (acpi_size)length); 99 99 if (!hid) { 100 100 status = AE_NO_MEMORY; 101 101 goto cleanup; ··· 173 173 174 174 uid = 175 175 ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + 176 - (acpi_size) length); 176 + (acpi_size)length); 177 177 if (!uid) { 178 178 status = AE_NO_MEMORY; 179 179 goto cleanup; ··· 309 309 /* Area for CID strings starts after the CID PNP_DEVICE_ID array */ 310 310 311 311 next_id_string = ACPI_CAST_PTR(char, cid_list->ids) + 312 - ((acpi_size) count * sizeof(struct acpi_pnp_device_id)); 312 + ((acpi_size)count * sizeof(struct acpi_pnp_device_id)); 313 313 314 314 /* Copy/convert the CIDs to the return buffer */ 315 315 ··· 413 413 414 414 cls = 415 415 ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + 416 - (acpi_size) length); 416 + (acpi_size)length); 417 417 if (!cls) { 418 418 status = AE_NO_MEMORY; 419 419 goto cleanup;
+2 -2
drivers/acpi/acpica/utmath.c
··· 236 236 } 237 237 238 238 remainder.full = remainder.full - dividend.full; 239 - remainder.part.hi = (u32) - ((s32) remainder.part.hi); 240 - remainder.part.lo = (u32) - ((s32) remainder.part.lo); 239 + remainder.part.hi = (u32)-((s32)remainder.part.hi); 240 + remainder.part.lo = (u32)-((s32)remainder.part.lo); 241 241 242 242 if (remainder.part.lo) { 243 243 remainder.part.hi--;
+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 *
+9 -9
drivers/acpi/acpica/utobject.c
··· 51 51 /* Local prototypes */ 52 52 static acpi_status 53 53 acpi_ut_get_simple_object_size(union acpi_operand_object *obj, 54 - acpi_size * obj_length); 54 + acpi_size *obj_length); 55 55 56 56 static acpi_status 57 57 acpi_ut_get_package_object_size(union acpi_operand_object *obj, 58 - acpi_size * obj_length); 58 + acpi_size *obj_length); 59 59 60 60 static acpi_status 61 61 acpi_ut_get_element_length(u8 object_type, ··· 177 177 * Create the element array. Count+1 allows the array to be null 178 178 * terminated. 179 179 */ 180 - package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count + 180 + package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size)count + 181 181 1) * sizeof(void *)); 182 182 if (!package_elements) { 183 183 ACPI_FREE(package_desc); ··· 454 454 455 455 static acpi_status 456 456 acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, 457 - acpi_size * obj_length) 457 + acpi_size *obj_length) 458 458 { 459 459 acpi_size length; 460 460 acpi_size size; ··· 495 495 switch (internal_object->common.type) { 496 496 case ACPI_TYPE_STRING: 497 497 498 - length += (acpi_size) internal_object->string.length + 1; 498 + length += (acpi_size)internal_object->string.length + 1; 499 499 break; 500 500 501 501 case ACPI_TYPE_BUFFER: 502 502 503 - length += (acpi_size) internal_object->buffer.length; 503 + length += (acpi_size)internal_object->buffer.length; 504 504 break; 505 505 506 506 case ACPI_TYPE_INTEGER: ··· 640 640 641 641 static acpi_status 642 642 acpi_ut_get_package_object_size(union acpi_operand_object *internal_object, 643 - acpi_size * obj_length) 643 + acpi_size *obj_length) 644 644 { 645 645 acpi_status status; 646 646 struct acpi_pkg_info info; ··· 665 665 */ 666 666 info.length += 667 667 ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) * 668 - (acpi_size) info.num_packages; 668 + (acpi_size)info.num_packages; 669 669 670 670 /* Return the total package length */ 671 671 ··· 689 689 690 690 acpi_status 691 691 acpi_ut_get_object_size(union acpi_operand_object *internal_object, 692 - acpi_size * obj_length) 692 + acpi_size *obj_length) 693 693 { 694 694 acpi_status status; 695 695
+2 -2
drivers/acpi/acpica/utosi.c
··· 150 150 i < (ACPI_ARRAY_LENGTH(acpi_default_supported_interfaces) - 1); 151 151 i++) { 152 152 acpi_default_supported_interfaces[i].next = 153 - &acpi_default_supported_interfaces[(acpi_size) i + 1]; 153 + &acpi_default_supported_interfaces[(acpi_size)i + 1]; 154 154 } 155 155 156 156 acpi_os_release_mutex(acpi_gbl_osi_mutex); ··· 397 397 * 398 398 ******************************************************************************/ 399 399 400 - acpi_status acpi_ut_osi_implementation(struct acpi_walk_state * walk_state) 400 + acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) 401 401 { 402 402 union acpi_operand_object *string_desc; 403 403 union acpi_operand_object *return_desc;
+3 -3
drivers/acpi/acpica/utownerid.c
··· 61 61 * when the method exits or the table is unloaded. 62 62 * 63 63 ******************************************************************************/ 64 - acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) 64 + acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id) 65 65 { 66 66 u32 i; 67 67 u32 j; ··· 122 122 * permanently allocated (prevents +1 overflow) 123 123 */ 124 124 *owner_id = 125 - (acpi_owner_id) ((k + 1) + ACPI_MUL_32(j)); 125 + (acpi_owner_id)((k + 1) + ACPI_MUL_32(j)); 126 126 127 127 ACPI_DEBUG_PRINT((ACPI_DB_VALUES, 128 128 "Allocated OwnerId: %2.2X\n", ··· 167 167 * 168 168 ******************************************************************************/ 169 169 170 - void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) 170 + void acpi_ut_release_owner_id(acpi_owner_id *owner_id_ptr) 171 171 { 172 172 acpi_owner_id owner_id = *owner_id_ptr; 173 173 acpi_status status;
+7 -12
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 ··· 264 269 265 270 sign = '\0'; 266 271 if (type & ACPI_FORMAT_SIGN) { 267 - if ((s64) number < 0) { 272 + if ((s64)number < 0) { 268 273 sign = '-'; 269 - number = -(s64) number; 274 + number = -(s64)number; 270 275 width--; 271 276 } else if (type & ACPI_FORMAT_SIGN_PLUS) { 272 277 sign = '+'; ··· 404 409 width = -1; 405 410 if (isdigit((int)*format)) { 406 411 format = acpi_ut_scan_number(format, &number); 407 - width = (s32) number; 412 + width = (s32)number; 408 413 } else if (*format == '*') { 409 414 ++format; 410 415 width = va_arg(args, int); ··· 421 426 ++format; 422 427 if (isdigit((int)*format)) { 423 428 format = acpi_ut_scan_number(format, &number); 424 - precision = (s32) number; 429 + precision = (s32)number; 425 430 } else if (*format == '*') { 426 431 ++format; 427 432 precision = va_arg(args, int); ··· 550 555 if (qualifier == 'L') { 551 556 number = va_arg(args, u64); 552 557 if (type & ACPI_FORMAT_SIGN) { 553 - number = (s64) number; 558 + number = (s64)number; 554 559 } 555 560 } else if (qualifier == 'l') { 556 561 number = va_arg(args, unsigned long); 557 562 if (type & ACPI_FORMAT_SIGN) { 558 - number = (s32) number; 563 + number = (s32)number; 559 564 } 560 565 } else if (qualifier == 'h') { 561 566 number = (u16)va_arg(args, int); 562 567 if (type & ACPI_FORMAT_SIGN) { 563 - number = (s16) number; 568 + number = (s16)number; 564 569 } 565 570 } else { 566 571 number = va_arg(args, unsigned int);
+2 -69
drivers/acpi/acpica/utstring.c
··· 130 130 } else { 131 131 /* All others will be Hex escapes */ 132 132 133 - acpi_os_printf("\\x%2.2X", (s32) string[i]); 133 + acpi_os_printf("\\x%2.2X", (s32)string[i]); 134 134 } 135 135 break; 136 136 } ··· 141 141 if (i == max_length && string[i]) { 142 142 acpi_os_printf("..."); 143 143 } 144 - } 145 - 146 - /******************************************************************************* 147 - * 148 - * FUNCTION: acpi_ut_valid_acpi_char 149 - * 150 - * PARAMETERS: char - The character to be examined 151 - * position - Byte position (0-3) 152 - * 153 - * RETURN: TRUE if the character is valid, FALSE otherwise 154 - * 155 - * DESCRIPTION: Check for a valid ACPI character. Must be one of: 156 - * 1) Upper case alpha 157 - * 2) numeric 158 - * 3) underscore 159 - * 160 - * We allow a '!' as the last character because of the ASF! table 161 - * 162 - ******************************************************************************/ 163 - 164 - u8 acpi_ut_valid_acpi_char(char character, u32 position) 165 - { 166 - 167 - if (!((character >= 'A' && character <= 'Z') || 168 - (character >= '0' && character <= '9') || (character == '_'))) { 169 - 170 - /* Allow a '!' in the last position */ 171 - 172 - if (character == '!' && position == 3) { 173 - return (TRUE); 174 - } 175 - 176 - return (FALSE); 177 - } 178 - 179 - return (TRUE); 180 - } 181 - 182 - /******************************************************************************* 183 - * 184 - * FUNCTION: acpi_ut_valid_acpi_name 185 - * 186 - * PARAMETERS: name - The name to be examined. Does not have to 187 - * be NULL terminated string. 188 - * 189 - * RETURN: TRUE if the name is valid, FALSE otherwise 190 - * 191 - * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: 192 - * 1) Upper case alpha 193 - * 2) numeric 194 - * 3) underscore 195 - * 196 - ******************************************************************************/ 197 - 198 - u8 acpi_ut_valid_acpi_name(char *name) 199 - { 200 - u32 i; 201 - 202 - ACPI_FUNCTION_ENTRY(); 203 - 204 - for (i = 0; i < ACPI_NAME_SIZE; i++) { 205 - if (!acpi_ut_valid_acpi_char(name[i], i)) { 206 - return (FALSE); 207 - } 208 - } 209 - 210 - return (TRUE); 211 144 } 212 145 213 146 /******************************************************************************* ··· 186 253 /* Check each character in the name */ 187 254 188 255 for (i = 0; i < ACPI_NAME_SIZE; i++) { 189 - if (acpi_ut_valid_acpi_char(name[i], i)) { 256 + if (acpi_ut_valid_name_char(name[i], i)) { 190 257 continue; 191 258 } 192 259
+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;
+2 -2
drivers/acpi/acpica/utxface.c
··· 127 127 * and the value of out_buffer is undefined. 128 128 * 129 129 ******************************************************************************/ 130 - acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer) 130 + acpi_status acpi_get_system_info(struct acpi_buffer *out_buffer) 131 131 { 132 132 struct acpi_system_info *info_ptr; 133 133 acpi_status status; ··· 483 483 ******************************************************************************/ 484 484 acpi_status 485 485 acpi_decode_pld_buffer(u8 *in_buffer, 486 - acpi_size length, struct acpi_pld_info ** return_buffer) 486 + acpi_size length, struct acpi_pld_info **return_buffer) 487 487 { 488 488 struct acpi_pld_info *pld_info; 489 489 u32 *buffer = ACPI_CAST_PTR(u32, in_buffer);
+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;
+5 -5
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 ··· 108 108 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override 109 109 acpi_status 110 110 acpi_os_physical_table_override(struct acpi_table_header *existing_table, 111 - acpi_physical_address * new_address, 111 + acpi_physical_address *new_address, 112 112 u32 *new_table_length); 113 113 #endif 114 114 ··· 203 203 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address 204 204 acpi_status 205 205 acpi_os_get_physical_address(void *logical_address, 206 - acpi_physical_address * physical_address); 206 + acpi_physical_address *physical_address); 207 207 #endif 208 208 209 209 /* ··· 379 379 acpi_os_get_table_by_name(char *signature, 380 380 u32 instance, 381 381 struct acpi_table_header **table, 382 - acpi_physical_address * address); 382 + acpi_physical_address *address); 383 383 #endif 384 384 385 385 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index 386 386 acpi_status 387 387 acpi_os_get_table_by_index(u32 index, 388 388 struct acpi_table_header **table, 389 - u32 *instance, acpi_physical_address * address); 389 + u32 *instance, acpi_physical_address *address); 390 390 #endif 391 391 392 392 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
+12 -11
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 0x20160422 50 50 51 51 #include <acpi/acconfig.h> 52 52 #include <acpi/actypes.h> ··· 484 484 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void)) 485 485 486 486 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init 487 - acpi_find_root_pointer(acpi_physical_address * 488 - rsdp_address)) 487 + acpi_find_root_pointer(acpi_physical_address 488 + *rsdp_address)) 489 489 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 490 490 acpi_get_table_header(acpi_string signature, 491 491 u32 instance, ··· 530 530 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 531 531 acpi_get_handle(acpi_handle parent, 532 532 acpi_string pathname, 533 - acpi_handle * ret_handle)) 533 + acpi_handle *ret_handle)) 534 534 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 535 535 acpi_attach_data(acpi_handle object, 536 536 acpi_object_handler handler, ··· 575 575 acpi_get_next_object(acpi_object_type type, 576 576 acpi_handle parent, 577 577 acpi_handle child, 578 - acpi_handle * out_handle)) 578 + acpi_handle *out_handle)) 579 579 580 580 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 581 581 acpi_get_type(acpi_handle object, 582 - acpi_object_type * out_type)) 582 + acpi_object_type *out_type)) 583 583 584 584 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 585 585 acpi_get_parent(acpi_handle object, 586 - acpi_handle * out_handle)) 586 + acpi_handle *out_handle)) 587 587 588 588 /* 589 589 * Handler interfaces ··· 755 755 756 756 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 757 757 acpi_get_gpe_device(u32 gpe_index, 758 - acpi_handle * gpe_device)) 758 + acpi_handle *gpe_device)) 759 759 760 760 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 761 761 acpi_install_gpe_block(acpi_handle gpe_device, ··· 771 771 * Resource interfaces 772 772 */ 773 773 typedef 774 - acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, 775 - void *context); 774 + acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource, 775 + void *context); 776 776 777 777 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 778 778 acpi_get_vendor_resource(acpi_handle device, ··· 938 938 ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) 939 939 void ACPI_INTERNAL_VAR_XFACE 940 940 acpi_log_error(const char *format, ...)) 941 - acpi_status acpi_initialize_debugger(void); 941 + 942 + acpi_status acpi_initialize_debugger(void); 942 943 943 944 void acpi_terminate_debugger(void); 944 945
+1
include/acpi/acrestyp.h
··· 417 417 u8 type; \ 418 418 u8 producer_consumer; /* For values, see Producer/Consumer above */\ 419 419 u8 slave_mode; \ 420 + u8 connection_sharing; \ 420 421 u8 type_revision_id; \ 421 422 u16 type_data_length; \ 422 423 u16 vendor_length; \
+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 *
+74 -48
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 /******************************************************************************* ··· 481 476 enum acpi_pcct_type { 482 477 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 483 478 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, 484 - ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ 479 + ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ 480 + ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ 485 481 }; 486 482 487 483 /* ··· 519 513 u32 latency; 520 514 u32 max_access_rate; 521 515 u16 min_turnaround_time; 516 + }; 517 + 518 + /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */ 519 + 520 + struct acpi_pcct_hw_reduced_type2 { 521 + struct acpi_subtable_header header; 522 + u32 doorbell_interrupt; 523 + u8 flags; 524 + u8 reserved; 525 + u64 base_address; 526 + u64 length; 527 + struct acpi_generic_address doorbell_register; 528 + u64 preserve_mask; 529 + u64 write_mask; 530 + u32 latency; 531 + u32 max_access_rate; 532 + u16 min_turnaround_time; 533 + struct acpi_generic_address doorbell_ack_register; 534 + u64 ack_preserve_mask; 535 + u64 ack_write_mask; 522 536 }; 523 537 524 538 /* Values for doorbell flags above */
+25 -23
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 ··· 893 892 894 893 /* Sleep function dispatch */ 895 894 896 - typedef acpi_status(*acpi_sleep_function) (u8 sleep_state); 895 + typedef acpi_status (*acpi_sleep_function) (u8 sleep_state); 897 896 898 897 struct acpi_sleep_functions { 899 898 acpi_sleep_function legacy_function; ··· 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 }; ··· 1072 1071 typedef 1073 1072 void (*acpi_object_handler) (acpi_handle object, void *data); 1074 1073 1075 - typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); 1074 + typedef 1075 + acpi_status (*acpi_init_handler) (acpi_handle object, u32 function); 1076 1076 1077 1077 #define ACPI_INIT_DEVICE_INI 1 1078 1078 1079 1079 typedef 1080 - acpi_status(*acpi_exception_handler) (acpi_status aml_status, 1081 - acpi_name name, 1082 - u16 opcode, 1083 - u32 aml_offset, void *context); 1080 + acpi_status (*acpi_exception_handler) (acpi_status aml_status, 1081 + acpi_name name, 1082 + u16 opcode, 1083 + u32 aml_offset, void *context); 1084 1084 1085 1085 /* Table Event handler (Load, load_table, etc.) and types */ 1086 1086 1087 1087 typedef 1088 - acpi_status(*acpi_table_handler) (u32 event, void *table, void *context); 1088 + acpi_status (*acpi_table_handler) (u32 event, void *table, void *context); 1089 1089 1090 1090 #define ACPI_TABLE_LOAD 0x0 1091 1091 #define ACPI_TABLE_UNLOAD 0x1 ··· 1095 1093 /* Address Spaces (For Operation Regions) */ 1096 1094 1097 1095 typedef 1098 - acpi_status(*acpi_adr_space_handler) (u32 function, 1099 - acpi_physical_address address, 1100 - u32 bit_width, 1101 - u64 *value, 1102 - void *handler_context, 1103 - void *region_context); 1096 + acpi_status (*acpi_adr_space_handler) (u32 function, 1097 + acpi_physical_address address, 1098 + u32 bit_width, 1099 + u64 *value, 1100 + void *handler_context, 1101 + void *region_context); 1104 1102 1105 1103 #define ACPI_DEFAULT_HANDLER NULL 1106 1104 ··· 1113 1111 }; 1114 1112 1115 1113 typedef 1116 - acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, 1117 - u32 function, 1118 - void *handler_context, 1119 - void **region_context); 1114 + acpi_status (*acpi_adr_space_setup) (acpi_handle region_handle, 1115 + u32 function, 1116 + void *handler_context, 1117 + void **region_context); 1120 1118 1121 1119 #define ACPI_REGION_ACTIVATE 0 1122 1120 #define ACPI_REGION_DEACTIVATE 1 1123 1121 1124 1122 typedef 1125 - acpi_status(*acpi_walk_callback) (acpi_handle object, 1126 - u32 nesting_level, 1127 - void *context, void **return_value); 1123 + acpi_status (*acpi_walk_callback) (acpi_handle object, 1124 + u32 nesting_level, 1125 + void *context, void **return_value); 1128 1126 1129 1127 typedef 1130 1128 u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported); ··· 1229 1227 * struct acpi_memory_list is used only if the ACPICA local cache is enabled 1230 1228 */ 1231 1229 struct acpi_memory_list { 1232 - char *list_name; 1230 + const char *list_name; 1233 1231 void *list_head; 1234 1232 u16 object_size; 1235 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__ */
+23 -24
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
··· 91 91 char *signature, 92 92 u32 instance, 93 93 struct acpi_table_header **table, 94 - acpi_physical_address * address); 94 + acpi_physical_address *address); 95 95 96 96 static acpi_status osl_list_bios_tables(void); 97 97 ··· 99 99 osl_get_bios_table(char *signature, 100 100 u32 instance, 101 101 struct acpi_table_header **table, 102 - acpi_physical_address * address); 102 + acpi_physical_address *address); 103 103 104 104 static acpi_status osl_get_last_status(acpi_status default_status); 105 105 ··· 187 187 188 188 acpi_status 189 189 acpi_os_get_table_by_address(acpi_physical_address address, 190 - struct acpi_table_header ** table) 190 + struct acpi_table_header **table) 191 191 { 192 192 u32 table_length; 193 193 struct acpi_table_header *mapped_table; ··· 252 252 acpi_status 253 253 acpi_os_get_table_by_name(char *signature, 254 254 u32 instance, 255 - struct acpi_table_header ** table, 256 - acpi_physical_address * address) 255 + struct acpi_table_header **table, 256 + acpi_physical_address *address) 257 257 { 258 258 acpi_status status; 259 259 ··· 380 380 381 381 acpi_status 382 382 acpi_os_get_table_by_index(u32 index, 383 - struct acpi_table_header ** table, 384 - u32 *instance, acpi_physical_address * address) 383 + struct acpi_table_header **table, 384 + u32 *instance, acpi_physical_address *address) 385 385 { 386 386 struct osl_table_info *info; 387 387 acpi_status status; ··· 447 447 } 448 448 } 449 449 450 - return ((acpi_physical_address) (address)); 450 + return ((acpi_physical_address)(address)); 451 451 } 452 452 453 453 /****************************************************************************** ··· 751 751 for (i = 0; i < number_of_tables; ++i, table_data += item_size) { 752 752 if (osl_can_use_xsdt()) { 753 753 table_address = 754 - (acpi_physical_address) (*ACPI_CAST64(table_data)); 754 + (acpi_physical_address)(*ACPI_CAST64(table_data)); 755 755 } else { 756 756 table_address = 757 - (acpi_physical_address) (*ACPI_CAST32(table_data)); 757 + (acpi_physical_address)(*ACPI_CAST32(table_data)); 758 758 } 759 759 760 760 /* Skip NULL entries in RSDT/XSDT */ ··· 800 800 osl_get_bios_table(char *signature, 801 801 u32 instance, 802 802 struct acpi_table_header **table, 803 - acpi_physical_address * address) 803 + acpi_physical_address *address) 804 804 { 805 805 struct acpi_table_header *local_table = NULL; 806 806 struct acpi_table_header *mapped_table = NULL; ··· 833 833 if ((gbl_fadt->header.length >= MIN_FADT_FOR_XDSDT) && 834 834 gbl_fadt->Xdsdt) { 835 835 table_address = 836 - (acpi_physical_address) gbl_fadt->Xdsdt; 836 + (acpi_physical_address)gbl_fadt->Xdsdt; 837 837 } else 838 838 if ((gbl_fadt->header.length >= MIN_FADT_FOR_DSDT) 839 839 && gbl_fadt->dsdt) { 840 840 table_address = 841 - (acpi_physical_address) gbl_fadt->dsdt; 841 + (acpi_physical_address)gbl_fadt->dsdt; 842 842 } 843 843 } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { 844 844 if ((gbl_fadt->header.length >= MIN_FADT_FOR_XFACS) && 845 845 gbl_fadt->Xfacs) { 846 846 table_address = 847 - (acpi_physical_address) gbl_fadt->Xfacs; 847 + (acpi_physical_address)gbl_fadt->Xfacs; 848 848 } else 849 849 if ((gbl_fadt->header.length >= MIN_FADT_FOR_FACS) 850 850 && gbl_fadt->facs) { 851 851 table_address = 852 - (acpi_physical_address) gbl_fadt->facs; 852 + (acpi_physical_address)gbl_fadt->facs; 853 853 } 854 854 } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { 855 855 if (!gbl_revision) { 856 856 return (AE_BAD_SIGNATURE); 857 857 } 858 858 table_address = 859 - (acpi_physical_address) gbl_rsdp. 859 + (acpi_physical_address)gbl_rsdp. 860 860 xsdt_physical_address; 861 861 } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) { 862 862 table_address = 863 - (acpi_physical_address) gbl_rsdp. 863 + (acpi_physical_address)gbl_rsdp. 864 864 rsdt_physical_address; 865 865 } else { 866 - table_address = 867 - (acpi_physical_address) gbl_rsdp_address; 866 + table_address = (acpi_physical_address)gbl_rsdp_address; 868 867 signature = ACPI_SIG_RSDP; 869 868 } 870 869 ··· 903 904 for (i = 0; i < number_of_tables; ++i, table_data += item_size) { 904 905 if (osl_can_use_xsdt()) { 905 906 table_address = 906 - (acpi_physical_address) (*ACPI_CAST64 907 - (table_data)); 907 + (acpi_physical_address)(*ACPI_CAST64 908 + (table_data)); 908 909 } else { 909 910 table_address = 910 - (acpi_physical_address) (*ACPI_CAST32 911 - (table_data)); 911 + (acpi_physical_address)(*ACPI_CAST32 912 + (table_data)); 912 913 } 913 914 914 915 /* Skip NULL entries in RSDT/XSDT */ ··· 1300 1301 char *signature, 1301 1302 u32 instance, 1302 1303 struct acpi_table_header **table, 1303 - acpi_physical_address * address) 1304 + acpi_physical_address *address) 1304 1305 { 1305 1306 void *table_dir; 1306 1307 u32 current_instance = 0;
+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
+12 -12
tools/power/acpi/os_specific/service_layers/osunixxf.c
··· 246 246 *****************************************************************************/ 247 247 248 248 acpi_status 249 - acpi_os_predefined_override(const struct acpi_predefined_names * init_val, 250 - acpi_string * new_val) 249 + acpi_os_predefined_override(const struct acpi_predefined_names *init_val, 250 + acpi_string *new_val) 251 251 { 252 252 253 253 if (!init_val || !new_val) { ··· 274 274 *****************************************************************************/ 275 275 276 276 acpi_status 277 - acpi_os_table_override(struct acpi_table_header * existing_table, 278 - struct acpi_table_header ** new_table) 277 + acpi_os_table_override(struct acpi_table_header *existing_table, 278 + struct acpi_table_header **new_table) 279 279 { 280 280 281 281 if (!existing_table || !new_table) { ··· 311 311 *****************************************************************************/ 312 312 313 313 acpi_status 314 - acpi_os_physical_table_override(struct acpi_table_header * existing_table, 315 - acpi_physical_address * new_address, 314 + acpi_os_physical_table_override(struct acpi_table_header *existing_table, 315 + acpi_physical_address *new_address, 316 316 u32 *new_table_length) 317 317 { 318 318 ··· 506 506 void *acpi_os_map_memory(acpi_physical_address where, acpi_size length) 507 507 { 508 508 509 - return (ACPI_TO_POINTER((acpi_size) where)); 509 + return (ACPI_TO_POINTER((acpi_size)where)); 510 510 } 511 511 512 512 /****************************************************************************** ··· 603 603 604 604 acpi_status 605 605 acpi_os_create_semaphore(u32 max_units, 606 - u32 initial_units, acpi_handle * out_handle) 606 + u32 initial_units, acpi_handle *out_handle) 607 607 { 608 - *out_handle = (acpi_handle) 1; 608 + *out_handle = (acpi_handle)1; 609 609 return (AE_OK); 610 610 } 611 611 ··· 640 640 641 641 acpi_status 642 642 acpi_os_create_semaphore(u32 max_units, 643 - u32 initial_units, acpi_handle * out_handle) 643 + u32 initial_units, acpi_handle *out_handle) 644 644 { 645 645 sem_t *sem; 646 646 ··· 672 672 } 673 673 #endif 674 674 675 - *out_handle = (acpi_handle) sem; 675 + *out_handle = (acpi_handle)sem; 676 676 return (AE_OK); 677 677 } 678 678 ··· 1035 1035 *****************************************************************************/ 1036 1036 1037 1037 acpi_status 1038 - acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, 1038 + acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, 1039 1039 u32 pci_register, u64 value, u32 width) 1040 1040 { 1041 1041
+1
tools/power/acpi/tools/acpidump/Makefile
··· 31 31 osunixxf.o\ 32 32 tbprint.o\ 33 33 tbxfroot.o\ 34 + utascii.o\ 34 35 utbuffer.o\ 35 36 utdebug.o\ 36 37 utexcep.o\
+10 -3
tools/power/acpi/tools/acpidump/apdump.c
··· 68 68 69 69 /* Make sure signature is all ASCII and a valid ACPI name */ 70 70 71 - if (!acpi_ut_valid_acpi_name(table->signature)) { 71 + if (!acpi_ut_valid_nameseg(table->signature)) { 72 72 acpi_log_error("Table signature (0x%8.8X) is invalid\n", 73 73 *(u32 *)table->signature); 74 74 return (FALSE); ··· 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); 293 294 return (-1); 294 295 } 295 296 296 - address = (acpi_physical_address) long_address; 297 + address = (acpi_physical_address)long_address; 297 298 status = acpi_os_get_table_by_address(address, &table); 298 299 if (ACPI_FAILURE(status)) { 299 300 acpi_log_error("Could not get table at 0x%8.8X%8.8X, %s\n", ··· 405 404 table = ap_get_table_from_file(pathname, &file_size); 406 405 if (!table) { 407 406 return (-1); 407 + } 408 + 409 + if (!acpi_ut_valid_nameseg(table->signature)) { 410 + acpi_log_error 411 + ("No valid ACPI signature was found in input file %s\n", 412 + pathname); 408 413 } 409 414 410 415 /* File must be at least as long as the table length */
+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