ACPICA release 20190329 and 20190405
Subsystems (4)
cover ACPICA release 20190329 and 20190405
Since ACPICA had a release within one week of each other, this patch-set contains both releases. Notable items include a patch to remove a namespace node from the global address list correctly. Other than that, there are several renamings for clarity.
This patch-set is also available at the link below:
https://github.com/SchmErik/linux/commits/acpica201904
Bob Moore (5):
ACPICA: Rename nameseg copy macro for clarity
ACPICA: Rename nameseg compare macro for clarity
ACPICA: Rename nameseg length macro/define for clarity
ACPICA: Update version to 20190329
ACPICA: Update version to 20190405
Erik Schmauss (3):
ACPICA: Namespace: remove address node from global list after method
termination
ACPICA: utilities: fix spelling of PCC to platform_comm_channel
ACPICA: Namespace: add check to avoid null pointer dereference
arch/x86/boot/compressed/acpi.c | 2 +- drivers/acpi/acpica/aclocal.h | 4 +- drivers/acpi/acpica/dbexec.c | 2 +- drivers/acpi/acpica/dbnames.c | 2 +- drivers/acpi/acpica/dsinit.c | 2 +- drivers/acpi/acpica/evgpeinit.c | 4 +- drivers/acpi/acpica/exnames.c | 6 +-- drivers/acpi/acpica/nsaccess.c | 2 +- drivers/acpi/acpica/nsalloc.c | 4 ++ drivers/acpi/acpica/nsdump.c | 2 +- drivers/acpi/acpica/nsinit.c | 4 +- drivers/acpi/acpica/nsnames.c | 8 ++-- drivers/acpi/acpica/nsobject.c | 4 ++ drivers/acpi/acpica/nsparse.c | 2 +- drivers/acpi/acpica/nsrepair.c | 2 +- drivers/acpi/acpica/nsrepair2.c | 4 +- drivers/acpi/acpica/nsutils.c | 14 +++--- drivers/acpi/acpica/nsxfname.c | 4 +- drivers/acpi/acpica/psargs.c | 8 ++-- drivers/acpi/acpica/rsxface.c | 8 ++-- drivers/acpi/acpica/tbdata.c | 3 +- drivers/acpi/acpica/tbfind.c | 20 ++++---- drivers/acpi/acpica/tbinstal.c | 2 +- drivers/acpi/acpica/tbprint.c | 10 ++-- drivers/acpi/acpica/tbutils.c | 6 +-- drivers/acpi/acpica/tbxface.c | 4 +- drivers/acpi/acpica/tbxfload.c | 15 +++--- drivers/acpi/acpica/utascii.c | 2 +- drivers/acpi/acpica/utdecode.c | 4 +- drivers/acpi/acpica/utmisc.c | 8 ++-- drivers/acpi/acpica/utpredef.c | 4 +- drivers/acpi/acpica/utstring.c | 6 +-- drivers/acpi/scan.c | 2 +- drivers/acpi/sysfs.c | 14 +++--- drivers/acpi/tables.c | 4 +- include/acpi/acpixf.h | 2 +- include/acpi/actbl.h | 4 +- include/acpi/actypes.h | 12 ++--- .../os_specific/service_layers/oslinuxtbl.c | 48 +++++++++---------- tools/power/acpi/tools/acpidump/apdump.c | 8 ++-- tools/power/acpi/tools/acpidump/apfiles.c | 8 ++-- 41 files changed, 142 insertions(+), 132 deletions(-)
Signature · 1 line
2.17.2
PATCH 1/8 ACPICA: Rename nameseg copy macro for clarity
From: Bob Moore <[email protected]>
ACPICA commit 19c18d3157945d1b8b64a826f0a8e848b7dbb127
ACPI_MOVE_NAME changed to ACPI_COPY_NAMESEG This clarifies (1) this is a copy operation, and
(2) it operates on ACPI name_segs. Improves understanding of the code.
--- drivers/acpi/acpica/nsnames.c | 2 +- drivers/acpi/acpica/nsutils.c | 4 ++-- drivers/acpi/acpica/tbfind.c | 2 +- drivers/acpi/acpica/utstring.c | 2 +- include/acpi/actypes.h | 4 ++-- tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 4 ++-- tools/power/acpi/tools/acpidump/apfiles.c | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-)
drivers/acpi/acpica/nsnames.c +1 -1
@@ -108,7 +108,7 @@ acpi_ns_handle_to_name(acpi_handle target_handle, struct acpi_buffer *buffer)/* Just copy the ACPI name from the Node and zero terminate it */ node_name =acpi_ut_get_node_name (node); -ACPI_MOVE_NAME (buffer->pointer, node_name); +ACPI_COPY_NAMESEG (buffer->pointer, node_name); ((char *)buffer->pointer)[ACPI_NAME_SIZE ] =0 ;ACPI_DEBUG_PRINT ((ACPI_DB_EXEC ,"%4.4s\n" , (char *)buffer->pointer));
drivers/acpi/acpica/nsutils.c +2 -2
@@ -489,8 +489,8 @@ acpi_ns_externalize_name(u32 internal_name_length,/* Copy and validate the 4-char name segment */ -ACPI_MOVE_NAME (&(*converted_name)[j], - &internal_name[names_index]); +ACPI_COPY_NAMESEG (&(*converted_name)[j], + &internal_name[names_index]);acpi_ut_repair_name (&(*converted_name)[j]); j +=ACPI_NAME_SIZE ;
drivers/acpi/acpica/tbfind.c +1 -1
@@ -56,7 +56,7 @@ acpi_tb_find_table(char *signature,/* Normalize the input strings */ memset (&header,0 ,sizeof (struct acpi_table_header )); -ACPI_MOVE_NAME (header.signature, signature); +ACPI_COPY_NAMESEG (header.signature, signature);strncpy (header.oem_id, oem_id,ACPI_OEM_ID_SIZE );strncpy (header.oem_table_id, oem_table_id,ACPI_OEM_TABLE_ID_SIZE );
drivers/acpi/acpica/utstring.c +1 -1
@@ -145,7 +145,7 @@ void acpi_ut_repair_name(char *name)return ; } -ACPI_MOVE_NAME (&original_name, name); +ACPI_COPY_NAMESEG (&original_name, name);/* Check each character in the name */
include/acpi/actypes.h +2 -2
@@ -516,10 +516,10 @@ typedef u64 acpi_integer;#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #define ACPI_COMPARE_NAME (a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) -#define ACPI_MOVE_NAME (dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) +#define ACPI_COPY_NAMESEG (dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src)))#else #define ACPI_COMPARE_NAME (a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) -#define ACPI_MOVE_NAME (dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) +#define ACPI_COPY_NAMESEG (dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))#endif /* Support for the special RSDP signature (8 characters) */
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +2 -2
@@ -286,7 +286,7 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance)return (AE_NO_MEMORY ); } -ACPI_MOVE_NAME (new_info->signature, signature); +ACPI_COPY_NAMESEG (new_info->signature, signature);if (!gbl_table_list_head) { gbl_table_list_head = new_info;
@@ -1174,7 +1174,7 @@ osl_table_name_from_file(char *filename, char *signature, u32 *instance)/* Extract signature */ -ACPI_MOVE_NAME (signature, filename); +ACPI_COPY_NAMESEG (signature, filename);return (AE_OK ); }
tools/power/acpi/tools/acpidump/apfiles.c +2 -2
@@ -110,9 +110,9 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)/* Construct lower-case filename from the table local signature */ if (ACPI_VALIDATE_RSDP_SIG (table->signature)) { -ACPI_MOVE_NAME (filename,ACPI_RSDP_NAME ); +ACPI_COPY_NAMESEG (filename,ACPI_RSDP_NAME ); }else { -ACPI_MOVE_NAME (filename, table->signature); +ACPI_COPY_NAMESEG (filename, table->signature); } filename[0 ] = (char )tolower ((int )filename[0 ]);
Signature · 1 line
2.17.2
PATCH 2/8 ACPICA: Rename nameseg compare macro for clarity
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 92ec0935f27e217dff0b176fca02c2ec3d782bb5
ACPI_COMPARE_NAME changed to ACPI_COMPARE_NAMESEG This clarifies (1) this is a compare on 4-byte namesegs, not a generic compare. Improves understanding of the code.
--- arch/x86/boot/compressed/acpi.c | 2 +- drivers/acpi/acpica/dbexec.c | 2 +- drivers/acpi/acpica/dsinit.c | 2 +- drivers/acpi/acpica/nsinit.c | 4 +-- drivers/acpi/acpica/nsparse.c | 2 +- drivers/acpi/acpica/nsrepair.c | 2 +- drivers/acpi/acpica/nsrepair2.c | 2 +- drivers/acpi/acpica/nsxfname.c | 4 +-- drivers/acpi/acpica/rsxface.c | 8 ++--- drivers/acpi/acpica/tbdata.c | 3 +- drivers/acpi/acpica/tbinstal.c | 2 +- drivers/acpi/acpica/tbprint.c | 6 ++-- drivers/acpi/acpica/tbutils.c | 6 ++-- drivers/acpi/acpica/tbxface.c | 4 +-- drivers/acpi/acpica/tbxfload.c | 15 +++++----- drivers/acpi/acpica/utmisc.c | 8 ++--- drivers/acpi/acpica/utpredef.c | 4 +-- drivers/acpi/acpica/utstring.c | 2 +- drivers/acpi/scan.c | 2 +- drivers/acpi/sysfs.c | 8 ++--- drivers/acpi/tables.c | 4 +-- include/acpi/actypes.h | 4 +-- .../os_specific/service_layers/oslinuxtbl.c | 30 +++++++++---------- tools/power/acpi/tools/acpidump/apdump.c | 4 +-- 24 files changed, 66 insertions(+), 64 deletions(-)
arch/x86/boot/compressed/acpi.c +1 -1
@@ -276,7 +276,7 @@ static unsigned long get_acpi_srat_table(void)if (acpi_table) { header = (struct acpi_table_header *)acpi_table; -if (ACPI_COMPARE_NAME (header->signature,ACPI_SIG_SRAT )) +if (ACPI_COMPARE_NAMESEG (header->signature,ACPI_SIG_SRAT ))return acpi_table; } entry += size;
drivers/acpi/acpica/dbexec.c +1 -1
@@ -453,7 +453,7 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags)/* Dump a _PLD buffer if present */ - if (ACPI_COMPARE_NAME + if (ACPI_COMPARE_NAMESEG ((ACPI_CAST_PTR (struct acpi_namespace_node, acpi_gbl_db_method_info.method)->name.ascii),
drivers/acpi/acpica/dsinit.c +1 -1
@@ -200,7 +200,7 @@ acpi_ds_initialize_objects(u32 table_index,/* DSDT is always the first AML table */ -if (ACPI_COMPARE_NAME (table->signature,ACPI_SIG_DSDT )) { +if (ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_DSDT )) {ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT ,"\nInitializing Namespace objects:\n" )); }
drivers/acpi/acpica/nsinit.c +2 -2
@@ -478,7 +478,7 @@ acpi_ns_find_ini_methods(acpi_handle obj_handle,/* We are only looking for methods named _INI */ -if (!ACPI_COMPARE_NAME (node->name.ascii,METHOD_NAME__INI )) { +if (!ACPI_COMPARE_NAMESEG (node->name.ascii,METHOD_NAME__INI )) {return (AE_OK ); }
@@ -641,7 +641,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,* Note: We know there is an _INI within this subtree, but it may not be * under this particular device, it may be lower in the branch. */ -if (!ACPI_COMPARE_NAME (device_node->name.ascii,"_SB_" ) || +if (!ACPI_COMPARE_NAMESEG (device_node->name.ascii,"_SB_" ) || device_node->parent != acpi_gbl_root_node) { ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_METHOD, device_node,
drivers/acpi/acpica/nsparse.c +1 -1
@@ -203,7 +203,7 @@ acpi_ns_one_complete_parse(u32 pass_number,/* Found OSDT table, enable the namespace override feature */ -if (ACPI_COMPARE_NAME (table->signature,ACPI_SIG_OSDT ) && +if (ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_OSDT ) && pass_number ==ACPI_IMODE_LOAD_PASS1 ) { walk_state->namespace_override = TRUE; }
drivers/acpi/acpica/nsrepair.c +1 -1
@@ -316,7 +316,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct this_name = acpi_object_repair_info;while (this_name->object_converter) { -if (ACPI_COMPARE_NAME (node->name.ascii, this_name->name)) { +if (ACPI_COMPARE_NAMESEG (node->name.ascii, this_name->name)) {/* Check if we can actually repair this name/type combination */
drivers/acpi/acpica/nsrepair2.c +1 -1
@@ -188,7 +188,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct this_name = acpi_ns_repairable_names;while (this_name->repair_function) { -if (ACPI_COMPARE_NAME (node->name.ascii, this_name->name)) { +if (ACPI_COMPARE_NAMESEG (node->name.ascii, this_name->name)) {return (this_name); }
drivers/acpi/acpica/nsxfname.c +2 -2
@@ -495,8 +495,8 @@ acpi_status acpi_install_method(u8 *buffer)/* Table must be a DSDT or SSDT */ -if (!ACPI_COMPARE_NAME (table->signature,ACPI_SIG_DSDT ) && - !ACPI_COMPARE_NAME (table->signature,ACPI_SIG_SSDT )) { +if (!ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_DSDT ) && + !ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_SSDT )) {return (AE_BAD_HEADER ); }
drivers/acpi/acpica/rsxface.c +4 -4
@@ -603,10 +603,10 @@ acpi_walk_resources(acpi_handle device_handle,/* Parameter validation */ if (!device_handle || !user_function || !name || - (!ACPI_COMPARE_NAME (name,METHOD_NAME__CRS ) && - !ACPI_COMPARE_NAME (name,METHOD_NAME__PRS ) && - !ACPI_COMPARE_NAME (name,METHOD_NAME__AEI ) && - !ACPI_COMPARE_NAME (name,METHOD_NAME__DMA ))) { + (!ACPI_COMPARE_NAMESEG (name,METHOD_NAME__CRS ) && + !ACPI_COMPARE_NAMESEG (name,METHOD_NAME__PRS ) && + !ACPI_COMPARE_NAMESEG (name,METHOD_NAME__AEI ) && + !ACPI_COMPARE_NAMESEG (name,METHOD_NAME__DMA ))) {return_ACPI_STATUS (AE_BAD_PARAMETER ); }
drivers/acpi/acpica/tbdata.c +2 -1
@@ -480,7 +480,8 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc,/* If a particular signature is expected (DSDT/FACS), it must match */ -if (signature && !ACPI_COMPARE_NAME (&table_desc->signature, signature)) { +if (signature && + !ACPI_COMPARE_NAMESEG (&table_desc->signature, signature)) {ACPI_BIOS_ERROR ((AE_INFO ,"Invalid signature 0x%X for ACPI table, expected [%s]" , table_desc->signature.integer, signature));
drivers/acpi/acpica/tbinstal.c +1 -1
@@ -120,7 +120,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,*/ if (!reload && acpi_gbl_disable_ssdt_table_install && -ACPI_COMPARE_NAME (&new_table_desc.signature,ACPI_SIG_SSDT )) { +ACPI_COMPARE_NAMESEG (&new_table_desc.signature,ACPI_SIG_SSDT )) {ACPI_INFO (("Ignoring installation of %4.4s at %8.8X%8.8X" , new_table_desc.signature.ascii,ACPI_FORMAT_UINT64 (address)));
drivers/acpi/acpica/tbprint.c +3 -3
@@ -94,7 +94,7 @@ acpi_tb_print_table_header(acpi_physical_address address, {struct acpi_table_header local_header; -if (ACPI_COMPARE_NAME (header->signature,ACPI_SIG_FACS )) { +if (ACPI_COMPARE_NAMESEG (header->signature,ACPI_SIG_FACS )) {/* FACS only has signature and length fields */
@@ -158,8 +158,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)* They are the odd tables, have no standard ACPI header and no checksum */ -if (ACPI_COMPARE_NAME (table->signature,ACPI_SIG_S3PT ) || -ACPI_COMPARE_NAME (table->signature,ACPI_SIG_FACS )) { +if (ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_S3PT ) || +ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_FACS )) {return (AE_OK ); }
drivers/acpi/acpica/tbutils.c +3 -3
@@ -332,9 +332,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) &table_index);if (ACPI_SUCCESS (status) && -ACPI_COMPARE_NAME (&acpi_gbl_root_table_list. - tables[table_index].signature, -ACPI_SIG_FADT )) { +ACPI_COMPARE_NAMESEG (&acpi_gbl_root_table_list. + tables[table_index].signature, +ACPI_SIG_FADT )) { acpi_gbl_fadt_index = table_index;acpi_tb_parse_fadt (); }
drivers/acpi/acpica/tbxface.c +2 -2
@@ -230,7 +230,7 @@ acpi_get_table_header(char *signature,for (i =0 , j =0 ; i < acpi_gbl_root_table_list.current_table_count; i++) { -if (!ACPI_COMPARE_NAME +if (!ACPI_COMPARE_NAMESEG (&(acpi_gbl_root_table_list.tables[i].signature), signature)) {continue ;
@@ -323,7 +323,7 @@ acpi_get_table(char *signature, i++) { table_desc = &acpi_gbl_root_table_list.tables[i]; -if (!ACPI_COMPARE_NAME (&table_desc->signature, signature)) { +if (!ACPI_COMPARE_NAMESEG (&table_desc->signature, signature)) {continue ; }
drivers/acpi/acpica/tbxfload.c +8 -7
@@ -118,7 +118,7 @@ acpi_status acpi_tb_load_namespace(void) table = &acpi_gbl_root_table_list.tables[acpi_gbl_dsdt_index];if (!acpi_gbl_root_table_list.current_table_count || - !ACPI_COMPARE_NAME (table->signature.ascii,ACPI_SIG_DSDT ) || + !ACPI_COMPARE_NAMESEG (table->signature.ascii,ACPI_SIG_DSDT ) ||ACPI_FAILURE (acpi_tb_validate_table (table))) { status =AE_NO_ACPI_TABLES ; goto unlock_and_exit;
@@ -170,11 +170,12 @@ acpi_status acpi_tb_load_namespace(void) table = &acpi_gbl_root_table_list.tables[i];if (!table->address || - (!ACPI_COMPARE_NAME (table->signature.ascii,ACPI_SIG_SSDT ) - && !ACPI_COMPARE_NAME (table->signature.ascii, -ACPI_SIG_PSDT ) - && !ACPI_COMPARE_NAME (table->signature.ascii, -ACPI_SIG_OSDT )) + (!ACPI_COMPARE_NAMESEG + (table->signature.ascii,ACPI_SIG_SSDT ) + && !ACPI_COMPARE_NAMESEG (table->signature.ascii, +ACPI_SIG_PSDT ) + && !ACPI_COMPARE_NAMESEG (table->signature.ascii, +ACPI_SIG_OSDT )) ||ACPI_FAILURE (acpi_tb_validate_table (table))) {continue ; }
@@ -364,7 +365,7 @@ acpi_status acpi_unload_parent_table(acpi_handle object)* only these types can contain AML and thus are the only types * that can create namespace objects. */ -if (ACPI_COMPARE_NAME +if (ACPI_COMPARE_NAMESEG (acpi_gbl_root_table_list.tables[i].signature.ascii,ACPI_SIG_DSDT )) { status =AE_TYPE ;
drivers/acpi/acpica/utmisc.c +4 -4
@@ -59,10 +59,10 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table)/* These are the only tables that contain executable AML */ -if (ACPI_COMPARE_NAME (table->signature,ACPI_SIG_DSDT ) || -ACPI_COMPARE_NAME (table->signature,ACPI_SIG_PSDT ) || -ACPI_COMPARE_NAME (table->signature,ACPI_SIG_SSDT ) || -ACPI_COMPARE_NAME (table->signature,ACPI_SIG_OSDT ) || +if (ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_DSDT ) || +ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_PSDT ) || +ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_SSDT ) || +ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_OSDT ) ||ACPI_IS_OEM_SIG (table->signature)) {return (TRUE); }
drivers/acpi/acpica/utpredef.c +2 -2
@@ -84,7 +84,7 @@ const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name) this_name = acpi_gbl_predefined_methods;while (this_name->info.name[0 ]) { -if (ACPI_COMPARE_NAME (name, this_name->info.name)) { +if (ACPI_COMPARE_NAMESEG (name, this_name->info.name)) {return (this_name); }
@@ -201,7 +201,7 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name) this_name = acpi_gbl_resource_names;while (this_name->info.name[0 ]) { -if (ACPI_COMPARE_NAME (name, this_name->info.name)) { +if (ACPI_COMPARE_NAMESEG (name, this_name->info.name)) {return (this_name); }
drivers/acpi/acpica/utstring.c +1 -1
@@ -141,7 +141,7 @@ void acpi_ut_repair_name(char *name)* Special case for the root node. This can happen if we get an * error during the execution of module-level code. */ -if (ACPI_COMPARE_NAME (name,ACPI_ROOT_PATHNAME )) { +if (ACPI_COMPARE_NAMESEG (name,ACPI_ROOT_PATHNAME )) {return ; }
drivers/acpi/scan.c +1 -1
@@ -2257,7 +2257,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr)mutex_lock (&acpi_probe_mutex);for (ape = ap_head; nr; ape++, nr--) { -if (ACPI_COMPARE_NAME (ACPI_SIG_MADT , ape->id)) { +if (ACPI_COMPARE_NAMESEG (ACPI_SIG_MADT , ape->id)) { acpi_probe_count =0 ;acpi_table_parse_madt (ape->type, acpi_match_madt,0 ); count += acpi_probe_count;
drivers/acpi/sysfs.c +4 -4
@@ -368,10 +368,10 @@ static int acpi_table_attr_init(struct kobject *tables_obj,char instance_str[ACPI_INST_SIZE ];sysfs_attr_init (&table_attr->attr.attr); -ACPI_MOVE_NAME (table_attr->name, table_header->signature); +ACPI_COPY_NAMESEG (table_attr->name, table_header->signature);list_for_each_entry (attr, &acpi_table_attr_list, node) { -if (ACPI_COMPARE_NAME (table_attr->name, attr->name)) +if (ACPI_COMPARE_NAMESEG (table_attr->name, attr->name))if (table_attr->instance < attr->instance) table_attr->instance = attr->instance; }
@@ -382,7 +382,7 @@ static int acpi_table_attr_init(struct kobject *tables_obj,return -ERANGE ; } -ACPI_MOVE_NAME (table_attr->filename, table_header->signature); +ACPI_COPY_NAMESEG (table_attr->filename, table_header->signature); table_attr->filename[ACPI_NAME_SIZE ] ='\0' ; if (table_attr->instance > 1 || (table_attr->instance == 1 && !acpi_get_table
@@ -484,7 +484,7 @@ static int acpi_table_data_init(struct acpi_table_header *th)int i;for (i =0 ; i <NUM_ACPI_DATA_OBJS ; i++) { -if (ACPI_COMPARE_NAME (th->signature, acpi_data_objs[i].name)) { +if (ACPI_COMPARE_NAMESEG (th->signature, acpi_data_objs[i].name)) { data_attr =kzalloc (sizeof (*data_attr),GFP_KERNEL );if (!data_attr)return -ENOMEM ;
drivers/acpi/tables.c +2 -2
@@ -666,8 +666,8 @@ static void __init acpi_table_initrd_scan(void) table_length = table->length;/* Skip RSDT/XSDT which should only be used for override */ -if (ACPI_COMPARE_NAME (table->signature,ACPI_SIG_RSDT ) || -ACPI_COMPARE_NAME (table->signature,ACPI_SIG_XSDT )) { +if (ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_RSDT ) || +ACPI_COMPARE_NAMESEG (table->signature,ACPI_SIG_XSDT )) {acpi_os_unmap_memory (table,ACPI_HEADER_SIZE ); goto next_table; }
include/acpi/actypes.h +2 -2
@@ -515,10 +515,10 @@ typedef u64 acpi_integer;/* Optimizations for 4-character (32-bit) acpi_name manipulation */ #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED -#define ACPI_COMPARE_NAME (a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) +#define ACPI_COMPARE_NAMESEG (a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))#define ACPI_COPY_NAMESEG (dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src)))#else -#define ACPI_COMPARE_NAME (a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) +#define ACPI_COMPARE_NAMESEG (a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))#define ACPI_COPY_NAMESEG (dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))#endif
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +15 -15
@@ -293,7 +293,7 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance) }else { next = gbl_table_list_head;while (1 ) { -if (ACPI_COMPARE_NAME (next->signature, signature)) { +if (ACPI_COMPARE_NAMESEG (next->signature, signature)) {if (next->instance == instance) { found = TRUE; }
@@ -782,11 +782,11 @@ osl_get_bios_table(char *signature,/* Handle special tables whose addresses are not in RSDT/XSDT */ -if (ACPI_COMPARE_NAME (signature,ACPI_RSDP_NAME ) || -ACPI_COMPARE_NAME (signature,ACPI_SIG_RSDT ) || -ACPI_COMPARE_NAME (signature,ACPI_SIG_XSDT ) || -ACPI_COMPARE_NAME (signature,ACPI_SIG_DSDT ) || -ACPI_COMPARE_NAME (signature,ACPI_SIG_FACS )) { +if (ACPI_COMPARE_NAMESEG (signature,ACPI_RSDP_NAME ) || +ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_RSDT ) || +ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_XSDT ) || +ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_DSDT ) || +ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_FACS )) { find_next_instance:
@@ -797,7 +797,7 @@ osl_get_bios_table(char *signature,* careful about the FADT length and validate table addresses. * Note: The 64-bit addresses have priority. */ -if (ACPI_COMPARE_NAME (signature,ACPI_SIG_DSDT )) { +if (ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_DSDT )) {if (current_instance <2 ) {if ((gbl_fadt->header.length >= MIN_FADT_FOR_XDSDT) && gbl_fadt->Xdsdt
@@ -815,7 +815,7 @@ osl_get_bios_table(char *signature, dsdt; } } - }else if (ACPI_COMPARE_NAME (signature,ACPI_SIG_FACS )) { + }else if (ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_FACS )) {if (current_instance <2 ) {if ((gbl_fadt->header.length >= MIN_FADT_FOR_XFACS) && gbl_fadt->Xfacs
@@ -833,7 +833,7 @@ osl_get_bios_table(char *signature, facs; } } - }else if (ACPI_COMPARE_NAME (signature,ACPI_SIG_XSDT )) { + }else if (ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_XSDT )) {if (!gbl_revision) {return (AE_BAD_SIGNATURE ); }
@@ -842,7 +842,7 @@ osl_get_bios_table(char *signature, (acpi_physical_address )gbl_rsdp. xsdt_physical_address; } - }else if (ACPI_COMPARE_NAME (signature,ACPI_SIG_RSDT )) { + }else if (ACPI_COMPARE_NAMESEG (signature,ACPI_SIG_RSDT )) {if (current_instance ==0 ) { table_address = (acpi_physical_address)gbl_rsdp.
@@ -931,7 +931,7 @@ osl_get_bios_table(char *signature,/* Does this table match the requested signature? */ -if (!ACPI_COMPARE_NAME +if (!ACPI_COMPARE_NAMESEG (mapped_table->signature, signature)) {osl_unmap_table (mapped_table); mapped_table =NULL ;
@@ -1086,8 +1086,8 @@ osl_map_table(acpi_size address,return (AE_BAD_SIGNATURE ); } }else -if (!ACPI_COMPARE_NAME (signature, mapped_table->signature)) - { +if (!ACPI_COMPARE_NAMESEG + (signature, mapped_table->signature)) {acpi_os_unmap_memory (mapped_table,sizeof (struct acpi_table_header ));return (AE_BAD_SIGNATURE );
@@ -1236,7 +1236,7 @@ osl_read_table_from_file(char *filename, status =AE_BAD_SIGNATURE ; goto exit; } - }else if (!ACPI_COMPARE_NAME (signature, header.signature)) { + }else if (!ACPI_COMPARE_NAMESEG (signature, header.signature)) {fprintf (stderr,"Incorrect signature: Expecting %4.4s, found %4.4s\n" , signature, header.signature);
@@ -1329,7 +1329,7 @@ osl_get_customized_table(char *pathname,/* Ignore meaningless files */ -if (!ACPI_COMPARE_NAME (filename, signature)) { +if (!ACPI_COMPARE_NAMESEG (filename, signature)) {continue ; }
tools/power/acpi/tools/acpidump/apdump.c +2 -2
@@ -310,9 +310,9 @@ int ap_dump_table_by_name(char *signature)/* To be friendly, handle tables whose signatures do not match the name */ -if (ACPI_COMPARE_NAME (local_signature,"FADT" )) { +if (ACPI_COMPARE_NAMESEG (local_signature,"FADT" )) {strcpy (local_signature,ACPI_SIG_FADT ); - }else if (ACPI_COMPARE_NAME (local_signature,"MADT" )) { + }else if (ACPI_COMPARE_NAMESEG (local_signature,"MADT" )) {strcpy (local_signature,ACPI_SIG_MADT ); }
Signature · 1 line
2.17.2
PATCH 3/8 ACPICA: Rename nameseg length macro/define for clarity
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 24870bd9e73d71e2a1ff0a1e94519f8f8409e57d
ACPI_NAME_SIZE changed to ACPI_NAMESEG_SIZE
This clarifies that this is the length of an individual nameseg, not the length of a generic namestring/namepath. Improves understanding of the code.
--- drivers/acpi/acpica/aclocal.h | 4 ++-- drivers/acpi/acpica/dbnames.c | 2 +- drivers/acpi/acpica/evgpeinit.c | 4 ++-- drivers/acpi/acpica/exnames.c | 6 +++--- drivers/acpi/acpica/nsaccess.c | 2 +- drivers/acpi/acpica/nsdump.c | 2 +- drivers/acpi/acpica/nsnames.c | 6 +++--- drivers/acpi/acpica/nsrepair2.c | 2 +- drivers/acpi/acpica/nsutils.c | 10 +++++----- drivers/acpi/acpica/psargs.c | 8 ++++---- drivers/acpi/acpica/tbfind.c | 18 +++++++++--------- drivers/acpi/acpica/tbprint.c | 4 ++-- drivers/acpi/acpica/utascii.c | 2 +- drivers/acpi/acpica/utdecode.c | 2 +- drivers/acpi/acpica/utstring.c | 2 +- drivers/acpi/sysfs.c | 6 +++--- include/acpi/actbl.h | 4 ++-- include/acpi/actypes.h | 8 ++++---- .../os_specific/service_layers/oslinuxtbl.c | 14 +++++++------- tools/power/acpi/tools/acpidump/apdump.c | 4 ++-- tools/power/acpi/tools/acpidump/apfiles.c | 4 ++-- 21 files changed, 57 insertions(+), 57 deletions(-)
drivers/acpi/acpica/aclocal.h +2 -2
@@ -293,7 +293,7 @@ acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state);* expected_return_btypes - Allowed type(s) for the return value */ struct acpi_name_info { -char name[ACPI_NAME_SIZE ]; +char name[ACPI_NAMESEG_SIZE ];u16 argument_list;u8 expected_btypes; };
@@ -370,7 +370,7 @@ typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node * converted_object);struct acpi_simple_repair_info { -char name[ACPI_NAME_SIZE ]; +char name[ACPI_NAMESEG_SIZE ];u32 unexpected_btypes;u32 package_index;acpi_object_converter object_converter;
drivers/acpi/acpica/dbnames.c +1 -1
@@ -354,7 +354,7 @@ acpi_status acpi_db_find_name_in_namespace(char *name_arg)char acpi_name[5 ] ="____" ;char *acpi_name_ptr = acpi_name; -if (strlen (name_arg) >ACPI_NAME_SIZE ) { +if (strlen (name_arg) >ACPI_NAMESEG_SIZE ) {acpi_os_printf ("Name must be no longer than 4 characters\n" );return (AE_OK ); }
drivers/acpi/acpica/evgpeinit.c +2 -2
@@ -292,7 +292,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,acpi_status status;u32 gpe_number;u8 temp_gpe_number; -char name[ACPI_NAME_SIZE +1 ]; +char name[ACPI_NAMESEG_SIZE +1 ];u8 type;ACPI_FUNCTION_TRACE (ev_match_gpe_method);
@@ -310,7 +310,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,* 1) Extract the method name and null terminate it */ ACPI_MOVE_32_TO_32 (name, &method_node->name.integer); - name[ACPI_NAME_SIZE ] =0 ; + name[ACPI_NAMESEG_SIZE ] =0 ;/* 2) Name must begin with an underscore */
drivers/acpi/acpica/exnames.c +3 -3
@@ -53,10 +53,10 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)/* Special case for root */ - size_needed =1 + (ACPI_NAME_SIZE * num_name_segs) +2 +1 ; + size_needed =1 + (ACPI_NAMESEG_SIZE * num_name_segs) +2 +1 ; }else { size_needed = - prefix_count + (ACPI_NAME_SIZE * num_name_segs) +2 +1 ; + prefix_count + (ACPI_NAMESEG_SIZE * num_name_segs) +2 +1 ; }/*
@@ -141,7 +141,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string) }for (index =0 ; - (index <ACPI_NAME_SIZE ) + (index <ACPI_NAMESEG_SIZE ) && (acpi_ut_valid_name_char (*aml_address,0 )); index++) { char_buf[index] = *aml_address++; }
drivers/acpi/acpica/nsaccess.c +1 -1
@@ -683,7 +683,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,/* Point to next name segment and make this node current */ - path +=ACPI_NAME_SIZE ; + path +=ACPI_NAMESEG_SIZE ; current_node = this_node; }
drivers/acpi/acpica/nsdump.c +1 -1
@@ -70,7 +70,7 @@ void acpi_ns_print_pathname(u32 num_segments, const char *pathname)acpi_os_printf ("?" ); } - pathname +=ACPI_NAME_SIZE ; + pathname +=ACPI_NAMESEG_SIZE ; num_segments--;if (num_segments) {acpi_os_printf ("." );
drivers/acpi/acpica/nsnames.c +3 -3
@@ -109,7 +109,7 @@ acpi_ns_handle_to_name(acpi_handle target_handle, struct acpi_buffer *buffer) node_name =acpi_ut_get_node_name (node);ACPI_COPY_NAMESEG (buffer->pointer, node_name); - ((char *)buffer->pointer)[ACPI_NAME_SIZE ] =0 ; + ((char *)buffer->pointer)[ACPI_NAMESEG_SIZE ] =0 ;ACPI_DEBUG_PRINT ((ACPI_DB_EXEC ,"%4.4s\n" , (char *)buffer->pointer));return_ACPI_STATUS (AE_OK );
@@ -198,7 +198,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node, char *full_path, u32 path_size, u8 no_trailing) { u32 length = 0, i; -char name[ACPI_NAME_SIZE ]; +char name[ACPI_NAMESEG_SIZE ];u8 do_no_trailing;char c, *left, *right;struct acpi_namespace_node *next_node;
@@ -446,7 +446,7 @@ static void acpi_ns_normalize_pathname(char *original_path)/* Do one nameseg at a time */ -for (i =0 ; (i <ACPI_NAME_SIZE ) && *input_path; i++) { +for (i =0 ; (i <ACPI_NAMESEG_SIZE ) && *input_path; i++) {if ((i ==0 ) || (*input_path !='_' )) {/* First char is allowed to be underscore */ *new_path = *input_path; new_path++;
drivers/acpi/acpica/nsrepair2.c +1 -1
@@ -25,7 +25,7 @@ acpi_status (*acpi_repair_function) (struct acpi_evaluate_info * info, return_object_ptr);typedef struct acpi_repair_info { -char name[ACPI_NAME_SIZE ]; +char name[ACPI_NAMESEG_SIZE ];acpi_repair_function repair_function; }acpi_repair_info ;
drivers/acpi/acpica/nsutils.c +5 -5
@@ -178,7 +178,7 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) } } - info->length = (ACPI_NAME_SIZE * info->num_segments) + + info->length = (ACPI_NAMESEG_SIZE * info->num_segments) +4 + info->num_carats; info->next_external_char = next_external_char;
@@ -249,7 +249,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)/* Build the name (minus path separators) */ for (; num_segments; num_segments--) { -for (i =0 ; i <ACPI_NAME_SIZE ; i++) { +for (i =0 ; i <ACPI_NAMESEG_SIZE ; i++) {if (ACPI_IS_PATH_SEPARATOR (*external_name) || (*external_name ==0 )) {
@@ -274,7 +274,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)/* Move on the next segment */ external_name++; - result +=ACPI_NAME_SIZE ; + result +=ACPI_NAMESEG_SIZE ; }/* Terminate the string */
@@ -493,8 +493,8 @@ acpi_ns_externalize_name(u32 internal_name_length, &internal_name[names_index]);acpi_ut_repair_name (&(*converted_name)[j]); - j +=ACPI_NAME_SIZE ; - names_index +=ACPI_NAME_SIZE ; + j +=ACPI_NAMESEG_SIZE ; + names_index +=ACPI_NAMESEG_SIZE ; } }
drivers/acpi/acpica/psargs.c +4 -4
@@ -150,21 +150,21 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)/* Two name segments */ - end +=1 + (2 *ACPI_NAME_SIZE ); + end +=1 + (2 *ACPI_NAMESEG_SIZE );break ;case AML_MULTI_NAME_PREFIX :/* Multiple name segments, 4 chars each, count in next byte */ - end +=2 + (*(end +1 ) *ACPI_NAME_SIZE ); + end +=2 + (*(end +1 ) *ACPI_NAMESEG_SIZE );break ;default :/* Single name segment */ - end +=ACPI_NAME_SIZE ; + end +=ACPI_NAMESEG_SIZE ;break ; }
@@ -522,7 +522,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_stateACPI_MOVE_32_TO_32 (&name, parser_state->aml);acpi_ps_set_name (field, name); - parser_state->aml +=ACPI_NAME_SIZE ; + parser_state->aml +=ACPI_NAMESEG_SIZE ;ASL_CV_CAPTURE_COMMENTS_ONLY (parser_state);
drivers/acpi/acpica/tbfind.c +9 -9
@@ -65,7 +65,7 @@ acpi_tb_find_table(char *signature, (void )acpi_ut_acquire_mutex (ACPI_MTX_TABLES );for (i =0 ; i < acpi_gbl_root_table_list.current_table_count; ++i) {if (memcmp (&(acpi_gbl_root_table_list.tables[i].signature), - header.signature,ACPI_NAME_SIZE )) { + header.signature,ACPI_NAMESEG_SIZE )) {/* Not the requested table */
@@ -94,14 +94,14 @@ acpi_tb_find_table(char *signature, if (!memcmp (acpi_gbl_root_table_list.tables[i].pointer->signature, - header.signature, ACPI_NAME_SIZE) && (!oem_id[0] - || - !memcmp - (acpi_gbl_root_table_list. - tables[i].pointer-> - oem_id, - header.oem_id, - ACPI_OEM_ID_SIZE)) + header.signature, ACPI_NAMESEG_SIZE) && (!oem_id[0] + || + !memcmp + (acpi_gbl_root_table_list. + tables[i]. + pointer->oem_id, + header.oem_id, + ACPI_OEM_ID_SIZE)) && (!oem_table_id[0] || !memcmp(acpi_gbl_root_table_list.tables[i].pointer-> oem_table_id, header.oem_table_id,
drivers/acpi/acpica/tbprint.c +2 -2
@@ -69,10 +69,10 @@ acpi_tb_cleanup_table_header(struct acpi_table_header *out_header,memcpy (out_header, header,sizeof (struct acpi_table_header )); -acpi_tb_fix_string (out_header->signature,ACPI_NAME_SIZE ); +acpi_tb_fix_string (out_header->signature,ACPI_NAMESEG_SIZE );acpi_tb_fix_string (out_header->oem_id,ACPI_OEM_ID_SIZE );acpi_tb_fix_string (out_header->oem_table_id,ACPI_OEM_TABLE_ID_SIZE ); -acpi_tb_fix_string (out_header->asl_compiler_id,ACPI_NAME_SIZE ); +acpi_tb_fix_string (out_header->asl_compiler_id,ACPI_NAMESEG_SIZE ); }/*******************************************************************************
drivers/acpi/acpica/utascii.c +1 -1
@@ -30,7 +30,7 @@ u8 acpi_ut_valid_nameseg(char *name)/* Validate each character in the signature */ -for (i =0 ; i <ACPI_NAME_SIZE ; i++) { +for (i =0 ; i <ACPI_NAMESEG_SIZE ; i++) {if (!acpi_ut_valid_name_char (name[i], i)) {return (FALSE); }
drivers/acpi/acpica/utdecode.c +1 -1
@@ -239,7 +239,7 @@ const char *acpi_ut_get_node_name(void *object) {struct acpi_namespace_node *node = (struct acpi_namespace_node *)object; -/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */ +/* Must return a string of exactly 4 characters == ACPI_NAMESEG_SIZE */ if (!object) {return ("NULL" );
drivers/acpi/acpica/utstring.c +1 -1
@@ -149,7 +149,7 @@ void acpi_ut_repair_name(char *name)/* Check each character in the name */ -for (i =0 ; i <ACPI_NAME_SIZE ; i++) { +for (i =0 ; i <ACPI_NAMESEG_SIZE ; i++) {if (acpi_ut_valid_name_char (name[i], i)) {continue ; }
drivers/acpi/sysfs.c +3 -3
@@ -327,9 +327,9 @@ static struct kobject *hotplug_kobj;struct acpi_table_attr {struct bin_attribute attr; -char name[ACPI_NAME_SIZE ]; +char name[ACPI_NAMESEG_SIZE ];int instance; -char filename[ACPI_NAME_SIZE +ACPI_INST_SIZE ]; +char filename[ACPI_NAMESEG_SIZE +ACPI_INST_SIZE ];struct list_head node; };
@@ -383,7 +383,7 @@ static int acpi_table_attr_init(struct kobject *tables_obj, }ACPI_COPY_NAMESEG (table_attr->filename, table_header->signature); - table_attr->filename[ACPI_NAME_SIZE ] ='\0' ; + table_attr->filename[ACPI_NAMESEG_SIZE ] ='\0' ;if (table_attr->instance >1 || (table_attr->instance ==1 && !acpi_get_table (table_header->signature,2 , &header))) {
include/acpi/actbl.h +2 -2
@@ -66,14 +66,14 @@******************************************************************************/ struct acpi_table_header { -char signature[ACPI_NAME_SIZE ];/* ASCII table signature */ +char signature[ACPI_NAMESEG_SIZE ];/* ASCII table signature */ u32 length;/* Length of table in bytes, including this header */ u8 revision;/* ACPI Specification minor version number */ u8 checksum;/* To make sum of entire table == 0 */ char oem_id[ACPI_OEM_ID_SIZE ];/* ASCII OEM identification */ char oem_table_id[ACPI_OEM_TABLE_ID_SIZE ];/* ASCII OEM table identification */ u32 oem_revision;/* OEM revision number */ -char asl_compiler_id[ACPI_NAME_SIZE ];/* ASCII ASL compiler vendor ID */ +char asl_compiler_id[ACPI_NAMESEG_SIZE ];/* ASCII ASL compiler vendor ID */ u32 asl_compiler_revision;/* ASL compiler version */ };
include/acpi/actypes.h +4 -4
@@ -375,7 +375,7 @@ typedef u64 acpi_physical_address;/* Names within the namespace are 4 bytes long */ -#define ACPI_NAME_SIZE 4 +#define ACPI_NAMESEG_SIZE 4/* Fixed by ACPI spec */ #define ACPI_PATH_SEGMENT_LENGTH 5/* 4 chars for name + 1 char for separator */ #define ACPI_PATH_SEPARATOR '.'
@@ -518,8 +518,8 @@ typedef u64 acpi_integer;#define ACPI_COMPARE_NAMESEG (a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))#define ACPI_COPY_NAMESEG (dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src)))#else -#define ACPI_COMPARE_NAMESEG (a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) -#define ACPI_COPY_NAMESEG (dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) +#define ACPI_COMPARE_NAMESEG (a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE)) +#define ACPI_COPY_NAMESEG (dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))#endif /* Support for the special RSDP signature (8 characters) */
@@ -529,7 +529,7 @@ typedef u64 acpi_integer;/* Support for OEMx signature (x can be any character) */ #define ACPI_IS_OEM_SIG (a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\ - strnlen (a, ACPI_NAME_SIZE) == ACPI_NAME_SIZE) + strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE)/* * Algorithm to obtain access bit width.
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +7 -7
@@ -19,7 +19,7 @@ ACPI_MODULE_NAME("oslinuxtbl")typedef struct osl_table_info {struct osl_table_info *next;u32 instance; -char signature[ACPI_NAME_SIZE ]; +char signature[ACPI_NAMESEG_SIZE ]; }osl_table_info ;
@@ -995,7 +995,7 @@ static acpi_status osl_list_customized_tables(char *directory) {void *table_dir;u32 instance; -char temp_name[ACPI_NAME_SIZE ]; +char temp_name[ACPI_NAMESEG_SIZE ];char *filename;acpi_status status =AE_OK ;
@@ -1158,15 +1158,15 @@ osl_table_name_from_file(char *filename, char *signature, u32 *instance)/* Ignore meaningless files */ -if (strlen (filename) <ACPI_NAME_SIZE ) { +if (strlen (filename) <ACPI_NAMESEG_SIZE ) {return (AE_BAD_SIGNATURE ); }/* Extract instance number */ -if (isdigit ((int )filename[ACPI_NAME_SIZE ])) { -sscanf (&filename[ACPI_NAME_SIZE ],"%u" , instance); - }else if (strlen (filename) !=ACPI_NAME_SIZE ) { +if (isdigit ((int )filename[ACPI_NAMESEG_SIZE ])) { +sscanf (&filename[ACPI_NAMESEG_SIZE ],"%u" , instance); + }else if (strlen (filename) !=ACPI_NAMESEG_SIZE ) {return (AE_BAD_SIGNATURE ); }else { *instance =0 ;
@@ -1311,7 +1311,7 @@ osl_get_customized_table(char *pathname, {void *table_dir;u32 current_instance =0 ; -char temp_name[ACPI_NAME_SIZE ]; +char temp_name[ACPI_NAMESEG_SIZE ];char table_filename[PATH_MAX ];char *filename;acpi_status status;
tools/power/acpi/tools/acpidump/apdump.c +2 -2
@@ -289,14 +289,14 @@ int ap_dump_table_by_address(char *ascii_address)int ap_dump_table_by_name (char *signature) { -char local_signature[ACPI_NAME_SIZE +1 ]; +char local_signature[ACPI_NAMESEG_SIZE +1 ];u32 instance;struct acpi_table_header *table;acpi_physical_address address;acpi_status status;int table_status; -if (strlen (signature) !=ACPI_NAME_SIZE ) { +if (strlen (signature) !=ACPI_NAMESEG_SIZE ) {fprintf (stderr,"Invalid table signature [%s]: must be exactly 4 characters\n" , signature);
tools/power/acpi/tools/acpidump/apfiles.c +2 -2
@@ -97,7 +97,7 @@ int ap_open_output_file(char *pathname)int ap_write_to_binary_file (struct acpi_table_header *table,u32 instance) { -char filename[ACPI_NAME_SIZE +16 ]; +char filename[ACPI_NAMESEG_SIZE +16 ];char instance_str[16 ];ACPI_FILE file;acpi_size actual;
@@ -119,7 +119,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) filename[1 ] = (char )tolower ((int )filename[1 ]); filename[2 ] = (char )tolower ((int )filename[2 ]); filename[3 ] = (char )tolower ((int )filename[3 ]); - filename[ACPI_NAME_SIZE ] =0 ; + filename[ACPI_NAMESEG_SIZE ] =0 ;/* Handle multiple SSDts - create different filenames for each */
Signature · 1 line
2.17.2
Rafael J. Wysocki
maintainerRe: [PATCH 3/8] ACPICA: Rename nameseg length macro/define for clarity
Quoted 5 lines · Erik Schmauss
From: Bob Moore <[email protected]>
ACPICA commit
24870bd9e73d71e2a1ff0a1e94519f8f8409e57d
Quoted 8 lines
ACPI_NAME_SIZEchanged toACPI_NAMESEG_SIZE
This clarifies that this is the length of an individual nameseg, not the length of a generic namestring/namepath. Improves understanding of the code.Signed-off-by Bob Moore <[email protected]>Signed-off-by Erik Schmauss <[email protected]>
This missed some Linux-specific files referring to ACPI_NAME_SIZE, but I fixed it up.
RE: [PATCH 3/8] ACPICA: Rename nameseg length macro/define for clarity
Quoted 26 lines
-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Rafael J. Wysocki
Sent: Tuesday, April 9, 2019 2:30 AM
To: Schmauss, Erik <[email protected]>
Cc: ACPI Devel Maling List <[email protected]>; Rafael J. Wysocki <[email protected]>; Moore, Robert <[email protected]>
Subject: Re: [PATCH 3/8] ACPICA: Rename nameseg length macro/define for clarityQuoted 6 lines · Erik Schmauss
From: Bob Moore <[email protected]>
ACPICA commit
24870bd9e73d71e2a1ff0a1e94519f8f8409e57d
ACPI_NAME_SIZEchanged toACPI_NAMESEG_SIZEThis clarifies thatthis
Quoted 4 lines
is the length of an individual nameseg, not the length of a generic namestring/namepath.
Improves understanding of the code.
Quoted 6 lines
Quoted 3 lines
Signed-off-by Bob Moore <[email protected]>Signed-off-by Erik Schmauss <[email protected]>This missed some Linux-specific files referring to
ACPI_NAME_SIZE, but I fixed it up.
Thanks for catching it!
PATCH 4/8 ACPICA: Namespace: remove address node from global list after method termination
In reply to Erik SchmaussACPICA commit b233720031a480abd438f2e9c643080929d144c3
ASL operation_regions declare a range of addresses that it uses. In a perfect world, the range of addresses should be used exclusively by the AML interpreter. The OS can use this information to decide which drivers to load so that the AML interpreter and device drivers use different regions of memory.
During table load, the address information is added to a global address range list. Each node in this list contains an address range as well as a namespace node of the operation_region. This list is deleted at ACPI shutdown.
Unfortunately, ASL operation_regions can be declared inside of control methods. Although this is not recommended, modern firmware contains such code. New module level code changes unintentionally removed the functionality of adding and removing nodes to the global address range list.
A few months ago, support for adding addresses has been re- implemented. However, the removal of the address range list was missed and resulted in some systems to crash due to the address list containing bogus namespace nodes from operation_regions declared in control methods. In order to fix the crash, this change removes dynamic operation_regions after control method termination.
--- drivers/acpi/acpica/nsobject.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/acpi/acpica/nsobject.c +4 -0
@@ -186,6 +186,10 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) } } +if (obj_desc->common.type ==ACPI_TYPE_REGION ) { +acpi_ut_remove_address_range (obj_desc->region.space_id, node); + } +/* Clear the Node entry in all cases */ node->object =NULL ;
Signature · 1 line
2.17.2
PATCH 5/8 ACPICA: utilities: fix spelling of PCC to platform_comm_channel
In reply to Erik SchmaussACPICA commit 5e5c349e73982aea5d9f74416c0b2eea1b0767a1
--- drivers/acpi/acpica/utdecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/utdecode.c +1 -1
@@ -78,7 +78,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {"IPMI" ,/* 0x07 */ "GeneralPurposeIo" ,/* 0x08 */ "GenericSerialBus" ,/* 0x09 */ - "PCC" /* 0x0A */ + "PlatformCommChannel" /* 0x0A */ };const char *acpi_ut_get_region_name (u8 space_id)
Signature · 1 line
2.17.2
PATCH 6/8 ACPICA: Update version to 20190329
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 802ec363be67580f52251219ef90613008495392
Version 20190329.
--- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
@@ -12,7 +12,7 @@/* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190215 +#define ACPI_CA_VERSION 0x20190329#include <acpi/acconfig.h> #include <acpi/actypes.h>
Signature · 1 line
2.17.2
PATCH 7/8 ACPICA: Namespace: add check to avoid null pointer dereference
In reply to Erik SchmaussACPICA commit 7586a625f9c34c3169efd88470192bf63119e31a
Some ACPICA userspace tools call acpi_ut_subsystem_shutdown() during cleanup and dereference a null pointer when cleaning up the namespace.
--- drivers/acpi/acpica/nsalloc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/acpi/acpica/nsalloc.c +4 -0
@@ -74,6 +74,10 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)ACPI_FUNCTION_NAME (ns_delete_node); +if (!node) { + return_VOID; + } +/* Detach an object if there is one */ acpi_ns_detach_object (node);
Signature · 1 line
2.17.2
PATCH 8/8 ACPICA: Update version to 20190405
In reply to Erik SchmaussFrom: Bob Moore <[email protected]>
ACPICA commit 0c1495275a35071b957ab59549761c6cd3f413b7
Version 20190405.
--- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
@@ -12,7 +12,7 @@/* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190329 +#define ACPI_CA_VERSION 0x20190405#include <acpi/acconfig.h> #include <acpi/actypes.h>
Signature · 1 line
2.17.2
Sorry for the spam, everyone.
There's no difference between this patch-set and the one before.
However, this cover letter contains a link to a copy of the patch set in case the patches were not sent.
Thanks,
Erik
Quoted 74 lines
-----Original Message-----
From: Schmauss, Erik
Sent: Monday, April 8, 2019 1:42 PM
To: [email protected]; [email protected]
Cc: Schmauss, Erik <[email protected]>
Subject: [PATCH 0/8] ACPICA release 20190329 and 20190405Since ACPICA had a release within one week of each other, this patch- set contains both releases. Notable items include a patch to remove a namespace node from the global address list correctly. Other than that, there are several renamings for clarity.
This patch-set is also available at the link below:
https://github.com/SchmErik/linux/commits/acpica201904Bob Moore (5):
ACPICA: Rename nameseg copy macro for clarity
ACPICA: Rename nameseg compare macro for clarity
ACPICA: Rename nameseg length macro/define for clarity
ACPICA: Update version to 20190329
ACPICA: Update version to 20190405Erik Schmauss (3):
ACPICA: Namespace: remove address node from global list after
method
termination
ACPICA: utilities: fix spelling of PCC toplatform_comm_channel
ACPICA: Namespace: add check to avoid null pointer dereferencearch/x86/boot/compressed/acpi.c | 2 +- drivers/acpi/acpica/aclocal.h | 4 +- drivers/acpi/acpica/dbexec.c | 2 +- drivers/acpi/acpica/dbnames.c | 2 +- drivers/acpi/acpica/dsinit.c | 2 +- drivers/acpi/acpica/evgpeinit.c | 4 +- drivers/acpi/acpica/exnames.c | 6 +-- drivers/acpi/acpica/nsaccess.c | 2 +- drivers/acpi/acpica/nsalloc.c | 4 ++ drivers/acpi/acpica/nsdump.c | 2 +- drivers/acpi/acpica/nsinit.c | 4 +- drivers/acpi/acpica/nsnames.c | 8 ++-- drivers/acpi/acpica/nsobject.c | 4 ++ drivers/acpi/acpica/nsparse.c | 2 +- drivers/acpi/acpica/nsrepair.c | 2 +- drivers/acpi/acpica/nsrepair2.c | 4 +- drivers/acpi/acpica/nsutils.c | 14 +++--- drivers/acpi/acpica/nsxfname.c | 4 +- drivers/acpi/acpica/psargs.c | 8 ++-- drivers/acpi/acpica/rsxface.c | 8 ++-- drivers/acpi/acpica/tbdata.c | 3 +- drivers/acpi/acpica/tbfind.c | 20 ++++---- drivers/acpi/acpica/tbinstal.c | 2 +- drivers/acpi/acpica/tbprint.c | 10 ++-- drivers/acpi/acpica/tbutils.c | 6 +-- drivers/acpi/acpica/tbxface.c | 4 +- drivers/acpi/acpica/tbxfload.c | 15 +++--- drivers/acpi/acpica/utascii.c | 2 +- drivers/acpi/acpica/utdecode.c | 4 +- drivers/acpi/acpica/utmisc.c | 8 ++-- drivers/acpi/acpica/utpredef.c | 4 +- drivers/acpi/acpica/utstring.c | 6 +-- drivers/acpi/scan.c | 2 +- drivers/acpi/sysfs.c | 14 +++--- drivers/acpi/tables.c | 4 +- include/acpi/acpixf.h | 2 +- include/acpi/actbl.h | 4 +- include/acpi/actypes.h | 12 ++--- .../os_specific/service_layers/oslinuxtbl.c | 48 +++++++++---------- tools/power/acpi/tools/acpidump/apdump.c | 8 ++-- tools/power/acpi/tools/acpidump/apfiles.c | 8 ++-- 41 files changed, 142 insertions(+), 132 deletions(-)--
2.17.2
Rafael J. Wysocki
maintainerQuoted 16 lines · Erik Schmauss
Since ACPICA had a release within one week of each other, this patch-set contains both releases. Notable items include a patch to remove a namespace node from the global address list correctly. Other than that, there are several renamings for clarity.
This patch-set is also available at the link below:
https://github.com/SchmErik/linux/commits/acpica201904Bob Moore (5):
ACPICA: Rename nameseg copy macro for clarity
ACPICA: Rename nameseg compare macro for clarity
ACPICA: Rename nameseg length macro/define for clarity
ACPICA: Update version to 20190329
ACPICA: Update version to 20190405
Quoted 3 lines
Erik Schmauss (3):
ACPICA: Namespace: remove address node from global list after method
termination
All applied, I put this one on the fast track for 5.1-rc5.
Quoted 2 lines
ACPICA: utilities: fix spelling of PCC to
platform_comm_channel
ACPICA: Namespace: add check to avoid null pointer dereference
Thanks!