// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /******************************************************************************* * * Module Name: dbnames - Debugger commands for the acpi namespace * ******************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acnamesp.h" #include "acdebug.h" #include "acpredef.h" #include "acinterp.h" #define _COMPONENT … ACPI_MODULE_NAME("dbnames") /* Local prototypes */ static acpi_status acpi_db_walk_and_match_name(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); static acpi_status acpi_db_walk_for_predefined_names(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); static acpi_status acpi_db_walk_for_specific_objects(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); static acpi_status acpi_db_walk_for_object_counts(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); static acpi_status acpi_db_integrity_walk(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); static acpi_status acpi_db_walk_for_references(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); static acpi_status acpi_db_bus_walk(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); /* * Arguments for the Objects command * These object types map directly to the ACPI_TYPES */ static struct acpi_db_argument_info acpi_db_object_types[] = …; /******************************************************************************* * * FUNCTION: acpi_db_set_scope * * PARAMETERS: name - New scope path * * RETURN: Status * * DESCRIPTION: Set the "current scope" as maintained by this utility. * The scope is used as a prefix to ACPI paths. * ******************************************************************************/ void acpi_db_set_scope(char *name) { … } /******************************************************************************* * * FUNCTION: acpi_db_dump_namespace * * PARAMETERS: start_arg - Node to begin namespace dump * depth_arg - Maximum tree depth to be dumped * * RETURN: None * * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed * with type and other information. * ******************************************************************************/ void acpi_db_dump_namespace(char *start_arg, char *depth_arg) { … } /******************************************************************************* * * FUNCTION: acpi_db_dump_namespace_paths * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Dump entire namespace with full object pathnames and object * type information. Alternative to "namespace" command. * ******************************************************************************/ void acpi_db_dump_namespace_paths(void) { … } /******************************************************************************* * * FUNCTION: acpi_db_dump_namespace_by_owner * * PARAMETERS: owner_arg - Owner ID whose nodes will be displayed * depth_arg - Maximum tree depth to be dumped * * RETURN: None * * DESCRIPTION: Dump elements of the namespace that are owned by the owner_id. * ******************************************************************************/ void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg) { … } /******************************************************************************* * * FUNCTION: acpi_db_walk_and_match_name * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Find a particular name/names within the namespace. Wildcards * are supported -- '?' matches any character. * ******************************************************************************/ static acpi_status acpi_db_walk_and_match_name(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_find_name_in_namespace * * PARAMETERS: name_arg - The 4-character ACPI name to find. * wildcards are supported. * * RETURN: None * * DESCRIPTION: Search the namespace for a given name (with wildcards) * ******************************************************************************/ acpi_status acpi_db_find_name_in_namespace(char *name_arg) { … } /******************************************************************************* * * FUNCTION: acpi_db_walk_for_predefined_names * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Detect and display predefined ACPI names (names that start with * an underscore) * ******************************************************************************/ static acpi_status acpi_db_walk_for_predefined_names(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_check_predefined_names * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Validate all predefined names in the namespace * ******************************************************************************/ void acpi_db_check_predefined_names(void) { … } /******************************************************************************* * * FUNCTION: acpi_db_walk_for_object_counts * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display short info about objects in the namespace * ******************************************************************************/ static acpi_status acpi_db_walk_for_object_counts(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_walk_for_fields * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display short info about objects in the namespace * ******************************************************************************/ static acpi_status acpi_db_walk_for_fields(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_walk_for_specific_objects * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display short info about objects in the namespace * ******************************************************************************/ static acpi_status acpi_db_walk_for_specific_objects(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_display_objects * * PARAMETERS: obj_type_arg - Type of object to display * display_count_arg - Max depth to display * * RETURN: None * * DESCRIPTION: Display objects in the namespace of the requested type * ******************************************************************************/ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg) { … } /******************************************************************************* * * FUNCTION: acpi_db_display_fields * * PARAMETERS: obj_type_arg - Type of object to display * display_count_arg - Max depth to display * * RETURN: None * * DESCRIPTION: Display objects in the namespace of the requested type * ******************************************************************************/ acpi_status acpi_db_display_fields(u32 address_space_id) { … } /******************************************************************************* * * FUNCTION: acpi_db_integrity_walk * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Examine one NS node for valid values. * ******************************************************************************/ static acpi_status acpi_db_integrity_walk(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_check_integrity * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Check entire namespace for data structure integrity * ******************************************************************************/ void acpi_db_check_integrity(void) { … } /******************************************************************************* * * FUNCTION: acpi_db_walk_for_references * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Check if this namespace object refers to the target object * that is passed in as the context value. * * Note: Currently doesn't check subobjects within the Node's object * ******************************************************************************/ static acpi_status acpi_db_walk_for_references(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_find_references * * PARAMETERS: object_arg - String with hex value of the object * * RETURN: None * * DESCRIPTION: Search namespace for all references to the input object * ******************************************************************************/ void acpi_db_find_references(char *object_arg) { … } /******************************************************************************* * * FUNCTION: acpi_db_bus_walk * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display info about device objects that have a corresponding * _PRT method. * ******************************************************************************/ static acpi_status acpi_db_bus_walk(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_get_bus_info * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display info about system buses. * ******************************************************************************/ void acpi_db_get_bus_info(void) { … }