ACPICA 20171215
Subsystems (2)
cover ACPICA 20171215
The following are the linuxized patches for ACPICA version 20171215
Bob Moore (8):
ACPICA: Debug output, no functional change
ACPICA: Update for a few debug output statements
ACPICA: Fix a regression in the acpi_evaluate_object_type interface
ACPICA: Cleanup the global variables and update comments. No
functional change
ACPICA: Create and deploy safe version of strncpy. No functional
change
ACPICA: Rename a global variable, no functional change
ACPICA: Fix a couple memory leaks during package object resolution
ACPICA: Update version to 20171215
Erik Schmauss (3):
ACPICA: Debugger: fix slight indentation issue
ACPICA: DT compiler: prevent error if optional field at the end of
table is not present
ACPICA: trivial style fix, no functional change
Mario Limonciello (1):
ACPICA: Recognize the Windows 10 version 1607 and 1703 OSI strings
drivers/acpi/acpica/acglobal.h | 82 ++++++++++++++--------------------------- drivers/acpi/acpica/acutils.h | 2 + drivers/acpi/acpica/dbfileio.c | 4 +- drivers/acpi/acpica/dspkginit.c | 21 +++++++---- drivers/acpi/acpica/exdump.c | 11 +++--- drivers/acpi/acpica/hwvalid.c | 14 +++---- drivers/acpi/acpica/nsxfeval.c | 9 +++-- drivers/acpi/acpica/psutils.c | 10 +++-- drivers/acpi/acpica/utdebug.c | 18 ++++++++- drivers/acpi/acpica/utnonansi.c | 9 +++++ drivers/acpi/acpica/utosi.c | 2 + drivers/acpi/acpica/uttrack.c | 4 +- include/acpi/acexcep.h | 6 ++- include/acpi/acpixf.h | 2 +- include/acpi/actypes.h | 2 + 15 files changed, 104 insertions(+), 92 deletions(-)
Signature · 1 line
2.14.3
PATCH 1/12 ACPICA: Debug output, no functional change
From: Bob Moore <[email protected]>
ACPICA commit 04fffc50a131662f57a41ca517c75d32d2479a1c
Fix use of return macros and other debug output changes.
--- drivers/acpi/acpica/hwvalid.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/acpi/acpica/hwvalid.c +7 -7
@@ -128,14 +128,14 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)acpi_io_address last_address;const struct acpi_port_info *port_info; -ACPI_FUNCTION_NAME (hw_validate_io_request); +ACPI_FUNCTION_TRACE (hw_validate_io_request);/* Supported widths are 8/16/32 */ if ((bit_width !=8 ) && (bit_width !=16 ) && (bit_width !=32 )) {ACPI_ERROR ((AE_INFO ,"Bad BitWidth parameter: %8.8X" , bit_width)); -return (AE_BAD_PARAMETER ); +return_ACPI_STATUS (AE_BAD_PARAMETER ); } port_info = acpi_protected_ports;
@@ -153,13 +153,13 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)ACPI_ERROR ((AE_INFO ,"Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X" ,ACPI_FORMAT_UINT64 (address), byte_width)); -return (AE_LIMIT ); +return_ACPI_STATUS (AE_LIMIT ); }/* Exit if requested address is not within the protected port table */ if (address > acpi_protected_ports[ACPI_PORT_INFO_ENTRIES -1 ].end) { -return (AE_OK ); +return_ACPI_STATUS (AE_OK ); }/* Check request against the list of protected I/O ports */
@@ -180,8 +180,8 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)/* Port illegality may depend on the _OSI calls made by the BIOS */ if (acpi_gbl_osi_data >= port_info->osi_dependency) { - ACPI_DEBUG_PRINT((ACPI_DB_IO, - "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)", + ACPI_DEBUG_PRINT((ACPI_DB_VALUES, + "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)\n", ACPI_FORMAT_UINT64(address), byte_width, port_info->name, port_info->start,
@@ -198,7 +198,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) } } -return (AE_OK ); +return_ACPI_STATUS (AE_OK ); }/******************************************************************************
Signature · 1 line
2.14.3
PATCH 2/12 ACPICA: Update for a few debug output statements
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 900e96a9c6c6d67c2e18e8c2576dc4742221fc71
Implement a very small indent for trace output.
--- drivers/acpi/acpica/exdump.c | 4 ++-- drivers/acpi/acpica/utdebug.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-)
drivers/acpi/acpica/exdump.c +2 -2
@@ -904,7 +904,7 @@ void acpi_ex_dump_operands(union acpi_operand_object **operands, const char *opcode_name, u32 num_operands) { -ACPI_FUNCTION_NAME (ex_dump_operands); +ACPI_FUNCTION_TRACE (ex_dump_operands);if (!opcode_name) { opcode_name ="UNKNOWN" ;
@@ -928,7 +928,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,ACPI_DEBUG_PRINT ((ACPI_DB_EXEC ,"**** End operand dump for [%s]\n" , opcode_name)); -return ; + return_VOID; }/*******************************************************************************
drivers/acpi/acpica/utdebug.c +14 -2
@@ -163,6 +163,7 @@ acpi_debug_print(u32 requested_debug_level, {acpi_thread_id thread_id;va_list args; +int fill_count;/* Check if debug output enabled */
@@ -202,10 +203,21 @@ acpi_debug_print(u32 requested_debug_level, acpi_os_printf("[%u] ", (u32)thread_id); } -acpi_os_printf ("[%02ld] " , acpi_gbl_nesting_level); -#endif + fill_count =48 - acpi_gbl_nesting_level - +strlen (acpi_ut_trim_function_name (function_name)); +if (fill_count <0 ) { + fill_count =0 ; + } +acpi_os_printf ("[%02ld] %*s" , + acpi_gbl_nesting_level, acpi_gbl_nesting_level," " ); +acpi_os_printf ("%s%*s: " , +acpi_ut_trim_function_name (function_name), fill_count, +" " ); + +#else acpi_os_printf ("%-22.22s: " ,acpi_ut_trim_function_name (function_name)); +#endif va_start (args, format);acpi_os_vprintf (format, args);
Signature · 1 line
2.14.3
PATCH 3/12 ACPICA: Fix a regression in the acpi_evaluate_object_type interface
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 9ab548ef154b992208524d61770caca90a9762be
The optional Pathname parameter inadvertently became required. Introduced in April 2017.
--- drivers/acpi/acpica/nsxfeval.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/acpi/acpica/nsxfeval.c +5 -4
@@ -61,10 +61,10 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info);* * PARAMETERS: handle - Object handle (optional) * pathname - Object pathname (optional) -* external_params - List of parameters to pass to method, +* external_params - List of parameters to pass to a method, * terminated by NULL. May be NULL * if no parameters are being passed. -* return_buffer - Where to put method's return value (if +* return_buffer - Where to put the object's return value (if * any). If NULL, no value is returned. * return_type - Expected type of return object *
@@ -100,13 +100,14 @@ acpi_evaluate_object_typed(acpi_handle handle, free_buffer_on_error = TRUE; } +/* Get a handle here, in order to build an error message if needed */ + + target_handle = handle;if (pathname) { status =acpi_get_handle (handle, pathname, &target_handle);if (ACPI_FAILURE (status)) {return_ACPI_STATUS (status); } - }else { - target_handle = handle; } full_pathname =acpi_ns_get_external_pathname (target_handle);
Signature · 1 line
2.14.3
PATCH 4/12 ACPICA: Debugger: fix slight indentation issue
In reply to Erik SchmaussACPICA commit c75af007d35c0afe8791ac39b7749c7442f49912
The %*s format specifier prints a string with a width indicated by an integer In the case of acpi_os_printf ("%*s", acpi_gbl_nesting_level, " "), a single space is printed to the console when acpi_gbl_nesting_level is 0 or 1. This change increments acpi_gbl_nesting_level so that there is one space printed when acpi_gbl_nesting_level is 0 and two spaces printed when acpi_gbl_nesting_level is 1.
--- drivers/acpi/acpica/utdebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/utdebug.c +1 -1
@@ -210,7 +210,7 @@ acpi_debug_print(u32 requested_debug_level, }acpi_os_printf ("[%02ld] %*s" , - acpi_gbl_nesting_level, acpi_gbl_nesting_level," " ); + acpi_gbl_nesting_level, acpi_gbl_nesting_level +1 ," " );acpi_os_printf ("%s%*s: " ,acpi_ut_trim_function_name (function_name), fill_count," " );
Signature · 1 line
2.14.3
PATCH 5/12 ACPICA: Cleanup the global variables and update comments. No functional change
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 8519ba376636565350c3fa0db5621c61d34c34b2
Mostly cleanup/reformatting. Some restructuring.
--- drivers/acpi/acpica/acglobal.h | 82 ++++++++++++++---------------------------- drivers/acpi/acpica/utdebug.c | 2 ++ 2 files changed, 29 insertions(+), 55 deletions(-)
drivers/acpi/acpica/acglobal.h +27 -55
@@ -46,7 +46,7 @@/***************************************************************************** * -* Globals related to the ACPI tables +* Globals related to the incoming ACPI tables * ****************************************************************************/
@@ -87,7 +87,7 @@ ACPI_GLOBAL(u8, acpi_gbl_integer_nybble_width);/***************************************************************************** * -* Mutual exclusion within ACPICA subsystem +* Mutual exclusion within the ACPICA subsystem * ****************************************************************************/
@@ -167,7 +167,7 @@ ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);ACPI_INIT_GLOBAL (u8, acpi_gbl_namespace_initialized, FALSE); -/* Misc */ +/* Miscellaneous */ ACPI_GLOBAL (u32, acpi_gbl_original_mode);ACPI_GLOBAL (u32, acpi_gbl_ns_lookup_count);
@@ -191,10 +191,9 @@ extern const char acpi_gbl_lower_hex_digits[];extern const char acpi_gbl_upper_hex_digits[];extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES ]; -#ifdef ACPI_DBG_TRACK_ALLOCATIONS -/* Lists for tracking memory allocations (debug only) */ +#ifdef ACPI_DBG_TRACK_ALLOCATIONS ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_global_list); ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list);ACPI_GLOBAL (u8, acpi_gbl_display_final_mem_stats);
@@ -203,7 +202,7 @@ ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);/***************************************************************************** * -* Namespace globals +* ACPI Namespace * ****************************************************************************/
@@ -234,15 +233,20 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_nesting_level, 0);/***************************************************************************** * -* Interpreter globals +* Interpreter/Parser globals * ****************************************************************************/ -ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list); -/* Control method single step flag */ ACPI_GLOBAL (u8, acpi_gbl_cm_single_step); +ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list); +ACPI_INIT_GLOBAL(union acpi_parse_object, *acpi_gbl_current_scope, NULL); + +/* ASL/ASL+ converter */ + +ACPI_INIT_GLOBAL (u8, gbl_capture_comments, FALSE); +ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_last_list_head, NULL);/***************************************************************************** *
@@ -252,7 +256,6 @@ ACPI_GLOBAL(u8, acpi_gbl_cm_single_step);extern struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG ]; -ACPI_GLOBAL (u8, acpi_gbl_sleep_type_a);ACPI_GLOBAL (u8, acpi_gbl_sleep_type_b);
@@ -263,7 +266,6 @@ ACPI_GLOBAL(u8, acpi_gbl_sleep_type_b);****************************************************************************/ #if (!ACPI_REDUCED_HARDWARE ) -ACPI_GLOBAL (u8, acpi_gbl_all_gpes_initialized); ACPI_GLOBAL(struct acpi_gpe_xrupt_info *, acpi_gbl_gpe_xrupt_list_head); ACPI_GLOBAL(struct acpi_gpe_block_info *,
@@ -272,10 +274,8 @@ ACPI_GLOBAL(acpi_gbl_event_handler, acpi_gbl_global_event_handler); ACPI_GLOBAL(void *, acpi_gbl_global_event_handler_context); ACPI_GLOBAL(struct acpi_fixed_event_handler, acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS ]); -extern struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS ]; -#endif /* !ACPI_REDUCED_HARDWARE */ /*****************************************************************************
@@ -291,14 +291,14 @@ ACPI_GLOBAL(u32, acpi_gpe_count);ACPI_GLOBAL (u32, acpi_sci_count);ACPI_GLOBAL (u32, acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS ]); -/* Support for dynamic control method tracing mechanism */ +/* Dynamic control method tracing mechanism */ ACPI_GLOBAL (u32, acpi_gbl_original_dbg_level);ACPI_GLOBAL (u32, acpi_gbl_original_dbg_layer);/***************************************************************************** * -* Debugger and Disassembler globals +* Debugger and Disassembler * ****************************************************************************/
@@ -326,7 +326,6 @@ ACPI_GLOBAL(struct acpi_external_file *, acpi_gbl_external_file_list);#endif #ifdef ACPI_DEBUGGER -ACPI_INIT_GLOBAL (u8, acpi_gbl_abort_method, FALSE);ACPI_INIT_GLOBAL (acpi_thread_id, acpi_gbl_db_thread_id,ACPI_INVALID_THREAD_ID );
@@ -340,7 +339,6 @@ ACPI_GLOBAL(u32, acpi_gbl_db_console_debug_level); ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_db_scope_node);ACPI_GLOBAL (u8, acpi_gbl_db_terminate_loop);ACPI_GLOBAL (u8, acpi_gbl_db_threads_terminated); - ACPI_GLOBAL(char *, acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]);ACPI_GLOBAL (acpi_object_type, acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS ]);
@@ -350,32 +348,33 @@ ACPI_GLOBAL(char, acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE]);ACPI_GLOBAL (char, acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE ]);ACPI_GLOBAL (char, acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE ]); -/* -* Statistic globals -*/ +/* Statistics globals */ +ACPI_GLOBAL (u16, acpi_gbl_obj_type_count[ACPI_TOTAL_TYPES ]);ACPI_GLOBAL (u16, acpi_gbl_node_type_count[ACPI_TOTAL_TYPES ]);ACPI_GLOBAL (u16, acpi_gbl_obj_type_count_misc);ACPI_GLOBAL (u16, acpi_gbl_node_type_count_misc);ACPI_GLOBAL (u32, acpi_gbl_num_nodes);ACPI_GLOBAL (u32, acpi_gbl_num_objects); -#endif /* ACPI_DEBUGGER */ #if defined (ACPI_DISASSEMBLER ) || defined (ACPI_ASL_COMPILER ) - ACPI_GLOBAL(const char, *acpi_gbl_pld_panel_list[]); ACPI_GLOBAL(const char, *acpi_gbl_pld_vertical_position_list[]); ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]); ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]); -ACPI_INIT_GLOBAL (u8, acpi_gbl_disasm_flag, FALSE); -#endif -/* -* Meant for the -ca option. -*/ +/***************************************************************************** +* +* ACPICA application-specific globals +* +****************************************************************************/ + +/* ASL-to-ASL+ conversion utility (implemented within the iASL compiler) */ + +#ifdef ACPI_ASL_COMPILER ACPI_INIT_GLOBAL(char *, acpi_gbl_current_inline_comment, NULL); ACPI_INIT_GLOBAL(char *, acpi_gbl_current_end_node_comment, NULL); ACPI_INIT_GLOBAL(char *, acpi_gbl_current_open_brace_comment, NULL);
@@ -386,23 +385,18 @@ ACPI_INIT_GLOBAL(char *, acpi_gbl_current_filename, NULL); ACPI_INIT_GLOBAL(char *, acpi_gbl_current_parent_filename, NULL); ACPI_INIT_GLOBAL(char *, acpi_gbl_current_include_filename, NULL); -ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_last_list_head, NULL); - ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_def_blk_comment_list_head, NULL); ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_def_blk_comment_list_tail, NULL); - ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_reg_comment_list_head, NULL); ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_reg_comment_list_tail, NULL); - ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_inc_comment_list_head, NULL); ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_inc_comment_list_tail, NULL); - ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_head, NULL); ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_tail,
@@ -410,30 +404,18 @@ ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_tail, ACPI_INIT_GLOBAL(struct acpi_comment_addr_node, *acpi_gbl_comment_addr_list_head, NULL); - -ACPI_INIT_GLOBAL(union acpi_parse_object, *acpi_gbl_current_scope, NULL); - ACPI_INIT_GLOBAL(struct acpi_file_node, *acpi_gbl_file_tree_root, NULL); ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_reg_comment_cache); ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_comment_addr_cache); ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_file_cache); -ACPI_INIT_GLOBAL (u8, gbl_capture_comments, FALSE); -ACPI_INIT_GLOBAL (u8, acpi_gbl_debug_asl_conversion, FALSE);ACPI_INIT_GLOBAL (ACPI_FILE , acpi_gbl_conv_debug_file,NULL ); -ACPI_GLOBAL (char, acpi_gbl_table_sig[4 ]); - -/***************************************************************************** -* -* Application globals -* -****************************************************************************/ +#endif #ifdef ACPI_APPLICATION -ACPI_INIT_GLOBAL (ACPI_FILE , acpi_gbl_debug_file,NULL );ACPI_INIT_GLOBAL (ACPI_FILE , acpi_gbl_output_file,NULL );ACPI_INIT_GLOBAL (u8, acpi_gbl_debug_timeout, FALSE);
@@ -442,16 +424,6 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_debug_timeout, FALSE);ACPI_GLOBAL (acpi_spinlock, acpi_gbl_print_lock);/* For print buffer */ ACPI_GLOBAL (char, acpi_gbl_print_buffer[1024 ]); -#endif /* ACPI_APPLICATION */ -/***************************************************************************** -* -* Info/help support -* -****************************************************************************/ - -extern const struct ah_predefined_name asl_predefined_info[]; -extern const struct ah_device_id asl_device_ids[]; -#endif /* __ACGLOBAL_H__ */
drivers/acpi/acpica/utdebug.c +2 -0
@@ -163,7 +163,9 @@ acpi_debug_print(u32 requested_debug_level, {acpi_thread_id thread_id;va_list args; +#ifdef ACPI_APPLICATION int fill_count; +#endif /* Check if debug output enabled */
Signature · 1 line
2.14.3
PATCH 6/12 ACPICA: Create and deploy safe version of strncpy. No functional change
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 64ad9c69a1bd534a466e060a33c0bbf5fc9e189c
acpi_ut_safe_strncpy - copy and terminate string. Strncpy is not guaranteed to terminate the copied string if the input is longer than the length of the target.
--- drivers/acpi/acpica/acutils.h | 2 ++ drivers/acpi/acpica/dbfileio.c | 4 ++-- drivers/acpi/acpica/psutils.c | 8 +++++--- drivers/acpi/acpica/utnonansi.c | 9 +++++++++ drivers/acpi/acpica/uttrack.c | 4 ++-- 5 files changed, 20 insertions(+), 7 deletions(-)
drivers/acpi/acpica/acutils.h +2 -0
@@ -641,6 +641,8 @@ void acpi_ut_repair_name(char *name);#if defined (ACPI_DEBUGGER ) || defined (ACPI_APPLICATION )u8 acpi_ut_safe_strcpy (char *dest,acpi_size dest_size,char *source); +void acpi_ut_safe_strncpy (char *dest,char *source,acpi_size dest_size); +u8 acpi_ut_safe_strcat (char *dest,acpi_size dest_size,char *source); u8
drivers/acpi/acpica/dbfileio.c +2 -2
@@ -99,8 +99,8 @@ void acpi_db_open_debug_file(char *name) }acpi_os_printf ("Debug output file %s opened\n" , name); -strncpy (acpi_gbl_db_debug_filename, name, -sizeof (acpi_gbl_db_debug_filename)); +acpi_ut_safe_strncpy (acpi_gbl_db_debug_filename, name, +sizeof (acpi_gbl_db_debug_filename)); acpi_gbl_db_output_to_file = TRUE; }#endif
drivers/acpi/acpica/psutils.c +5 -3
@@ -94,9 +94,11 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode) op->common.descriptor_type =ACPI_DESC_TYPE_PARSER ; op->common.aml_opcode = opcode; -ACPI_DISASM_ONLY_MEMBERS (strncpy (op->common.aml_op_name, - (acpi_ps_get_opcode_info (opcode))-> - name,sizeof (op->common.aml_op_name))); +ACPI_DISASM_ONLY_MEMBERS (acpi_ut_safe_strncpy (op->common.aml_op_name, + (acpi_ps_get_opcode_info + (opcode))->name, +sizeof (op->common. + aml_op_name))); }/*******************************************************************************
drivers/acpi/acpica/utnonansi.c +9 -0
@@ -199,4 +199,13 @@ acpi_ut_safe_strncat(char *dest,strncat (dest, source, max_transfer_length); return (FALSE); } + +void acpi_ut_safe_strncpy (char *dest,char *source,acpi_size dest_size) +{ +/* Always terminate destination string */ + +strncpy (dest, source, dest_size); + dest[dest_size -1 ] =0 ; +} +#endif
drivers/acpi/acpica/uttrack.c +2 -2
@@ -402,8 +402,8 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation, allocation->component = component; allocation->line = line; -strncpy (allocation->module, module,ACPI_MAX_MODULE_NAME ); - allocation->module[ACPI_MAX_MODULE_NAME -1 ] =0 ; +acpi_ut_safe_strncpy (allocation->module, (char *)module, +ACPI_MAX_MODULE_NAME );if (!element) {
Signature · 1 line
2.14.3
PATCH 7/12 ACPICA: Rename a global variable, no functional change
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit ab9c83985e8b2b25dc1c173b753280a8d04922b5
Rename to add the standard prefix for globals.
--- drivers/acpi/acpica/acglobal.h | 2 +- drivers/acpi/acpica/psutils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -1
@@ -245,7 +245,7 @@ ACPI_INIT_GLOBAL(union acpi_parse_object, *acpi_gbl_current_scope, NULL);/* ASL/ASL+ converter */ -ACPI_INIT_GLOBAL (u8, gbl_capture_comments, FALSE); +ACPI_INIT_GLOBAL (u8, acpi_gbl_capture_comments, FALSE); ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_last_list_head, NULL);/*****************************************************************************
drivers/acpi/acpica/psutils.c +1 -1
@@ -161,7 +161,7 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode, u8 *aml) acpi_gbl_current_scope = op; } -if (gbl_capture_comments) { +if (acpi_gbl_capture_comments) {ASL_CV_TRANSFER_COMMENTS (op); } }
Signature · 1 line
2.14.3
PATCH 8/12 ACPICA: DT compiler: prevent error if optional field at the end of table is not present
In reply to Erik SchmaussACPICA commit a7f73af9003bf4e730db5a133300c01ba7992a01
The data table compiler throws under the following conditions:
1.) there is a table with a last field that is optional 2.) if the optional field is not present
3.) the optional field is the last line of the data table
A change was made to dt_compile_table to return an AE_EOF under these conditions. This AE_EOF means that we are at the end of the file. The caller to dt_compile_table is responsible for handling this case. For DBG2 table, we will complete the compilation of this subtable. For other tables, this could be different.
--- include/acpi/acexcep.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
include/acpi/acexcep.h +4 -2
@@ -130,8 +130,9 @@ struct acpi_exception_info {#define AE_HEX_OVERFLOW EXCEP_ENV (0x0020)#define AE_DECIMAL_OVERFLOW EXCEP_ENV (0x0021)#define AE_OCTAL_OVERFLOW EXCEP_ENV (0x0022) +#define AE_END_OF_TABLE EXCEP_ENV (0x0023) -#define AE_CODE_ENV_MAX 0x0022 +#define AE_CODE_ENV_MAX 0x0023/* * Programmer exceptions
@@ -275,7 +276,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {EXCEP_TXT ("AE_DECIMAL_OVERFLOW" ,"Overflow during ASCII decimal-to-binary conversion" ),EXCEP_TXT ("AE_OCTAL_OVERFLOW" , -"Overflow during ASCII octal-to-binary conversion" ) +"Overflow during ASCII octal-to-binary conversion" ), +EXCEP_TXT ("AE_END_OF_TABLE" ,"Reached the end of table" ) }; static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
Signature · 1 line
2.14.3
PATCH 9/12 ACPICA: Recognize the Windows 10 version 1607 and 1703 OSI strings
In reply to Erik SchmaussFrom: Mario Limonciello <[email protected]>
ACPICA commit 35a4a3ea723b3066f575e63e5f0116f7ce65e713
The public Microsoft document listing recognized OSI strings [1] shows that these two strings were introduced.
version 1607 / Anniversary Update / "Redstone 1" version 1703 / Creators Update / "Redstone 2"
[1] http://download.microsoft.com/download/7/e/7/7e7662cf-cbea-470b-a97e-ce7ce0d98dc2/winacpi_osi.docx
--- drivers/acpi/acpica/utosi.c | 2 ++ include/acpi/actypes.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/acpi/acpica/utosi.c +2 -0
@@ -101,6 +101,8 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = { {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */ {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */ {"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */ + {"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */ + {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */ /* Feature Group Strings */
include/acpi/actypes.h +2 -0
@@ -1301,6 +1301,8 @@ typedef enum {#define ACPI_OSI_WIN_7 0x0B#define ACPI_OSI_WIN_8 0x0C#define ACPI_OSI_WIN_10 0x0D +#define ACPI_OSI_WIN_10_RS1 0x0E +#define ACPI_OSI_WIN_10_RS2 0x0F/* Definitions of getopt */
Signature · 1 line
2.14.3
PATCH 10/12 ACPICA: Fix a couple memory leaks during package object resolution
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 69d4415360446b4a1826dab76ba0cd6d24710ddd
A couple memory leaks during resolution of individual package elements.
--- drivers/acpi/acpica/dspkginit.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/acpi/acpica/dspkginit.c +13 -8
@@ -297,8 +297,10 @@ acpi_ds_init_package_element(u8 object_type, {union acpi_operand_object **element_ptr; +ACPI_FUNCTION_TRACE (ds_init_package_element); +if (!source_object) { -return (AE_OK ); +return_ACPI_STATUS (AE_OK ); }/*
@@ -329,7 +331,7 @@ acpi_ds_init_package_element(u8 object_type, source_object->package.flags |=AOPOBJ_DATA_VALID ; } -return (AE_OK ); +return_ACPI_STATUS (AE_OK ); }/*******************************************************************************
@@ -352,6 +354,7 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)union acpi_generic_state scope_info;union acpi_operand_object *element = *element_ptr;struct acpi_namespace_node *resolved_node; +struct acpi_namespace_node *original_node;char *external_path =NULL ;acpi_object_type type;
@@ -441,6 +444,7 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)* will remain as named references. This behavior is not described * in the ACPI spec, but it appears to be an oversight. */ + original_node = resolved_node; status =acpi_ex_resolve_node_to_value (&resolved_node,NULL );if (ACPI_FAILURE (status)) { return_VOID;
@@ -468,26 +472,27 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)*/ case ACPI_TYPE_DEVICE :case ACPI_TYPE_THERMAL : - -/* TBD: This may not be necesssary */ - -acpi_ut_add_reference (resolved_node->object); +case ACPI_TYPE_METHOD :break ;case ACPI_TYPE_MUTEX : -case ACPI_TYPE_METHOD :case ACPI_TYPE_POWER :case ACPI_TYPE_PROCESSOR :case ACPI_TYPE_EVENT :case ACPI_TYPE_REGION : +/* acpi_ex_resolve_node_to_value gave these an extra reference */ + +acpi_ut_remove_reference (original_node->object);break ;default :/* * For all other types - the node was resolved to an actual -* operand object with a value, return the object +* operand object with a value, return the object. Remove +* a reference on the existing object. */ +acpi_ut_remove_reference (element); *element_ptr = (union acpi_operand_object *)resolved_node;break ; }
Signature · 1 line
2.14.3
PATCH 11/12 ACPICA: trivial style fix, no functional change
In reply to Erik SchmaussACPICA commit 83f3375d6dcb3af812c91aaf47abcac9fc330527
This adds a semi-colon at the end of a macro call so that it can be processed correctly with source code formatting tools.
--- drivers/acpi/acpica/exdump.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/acpi/acpica/exdump.c +4 -3
@@ -617,10 +617,11 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)u32 length;u32 index; -ACPI_FUNCTION_NAME (ex_dump_operand) +ACPI_FUNCTION_NAME (ex_dump_operand); -/* Check if debug output enabled */ - if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_EXEC, _COMPONENT)) { +/* Check if debug output enabled */ + +if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC , _COMPONENT)) {return ; }
Signature · 1 line
2.14.3
PATCH 12/12 ACPICA: Update version to 20171215
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 8b38d88e4a7151a7fc9451ac2e51c945c60b913b
Version 20171215.
--- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
@@ -46,7 +46,7 @@/* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20171110 +#define ACPI_CA_VERSION 0x20171215#include <acpi/acconfig.h> #include <acpi/actypes.h>
Signature · 1 line
2.14.3
Quoted 23 lines · CET Erik Schmauss
The following are the linuxized patches for ACPICA version 20171215
Bob Moore (8):
ACPICA: Debug output, no functional change
ACPICA: Update for a few debug output statements
ACPICA: Fix a regression in theacpi_evaluate_object_typeinterface
ACPICA: Cleanup the global variables and update comments. No
functional change
ACPICA: Create and deploy safe version of strncpy. No functional
change
ACPICA: Rename a global variable, no functional change
ACPICA: Fix a couple memory leaks during package object resolution
ACPICA: Update version to 20171215Erik Schmauss (3):
ACPICA: Debugger: fix slight indentation issue
ACPICA: DT compiler: prevent error if optional field at the end of
table is not present
ACPICA: trivial style fix, no functional changeMario Limonciello (1):
ACPICA: Recognize the Windows 10 version 1607 and 1703 OSI strings
Quoted 16 lines
drivers/acpi/acpica/acglobal.h | 82 ++++++++++++++--------------------------- drivers/acpi/acpica/acutils.h | 2 + drivers/acpi/acpica/dbfileio.c | 4 +- drivers/acpi/acpica/dspkginit.c | 21 +++++++---- drivers/acpi/acpica/exdump.c | 11 +++--- drivers/acpi/acpica/hwvalid.c | 14 +++---- drivers/acpi/acpica/nsxfeval.c | 9 +++-- drivers/acpi/acpica/psutils.c | 10 +++-- drivers/acpi/acpica/utdebug.c | 18 ++++++++- drivers/acpi/acpica/utnonansi.c | 9 +++++ drivers/acpi/acpica/utosi.c | 2 + drivers/acpi/acpica/uttrack.c | 4 +- include/acpi/acexcep.h | 6 ++- include/acpi/acpixf.h | 2 +- include/acpi/actypes.h | 2 + 15 files changed, 104 insertions(+), 92 deletions(-)
Series applied with the (fixed) v2 of [06/12].
Thanks,
Rafael