drivers/acpi/acpica/dbnames.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dbnames.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dbnames.c- Extension
.c- Size
- 27771 bytes
- Lines
- 1040
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hacnamesp.hacdebug.hacpredef.hacinterp.h
Detected Declarations
function acpi_db_set_scopefunction acpi_db_dump_namespacefunction acpi_db_dump_namespace_pathsfunction acpi_db_dump_namespace_by_ownerfunction acpi_db_walk_and_match_namefunction acpi_db_find_name_in_namespacefunction acpi_db_walk_for_predefined_namesfunction acpi_db_check_predefined_namesfunction acpi_db_walk_for_object_countsfunction acpi_db_walk_for_fieldsfunction acpi_db_walk_for_specific_objectsfunction acpi_db_display_objectsfunction acpi_db_display_fieldsfunction acpi_db_integrity_walkfunction acpi_db_check_integrityfunction acpi_db_walk_for_referencesfunction acpi_db_find_referencesfunction acpi_db_bus_walkfunction acpi_db_get_bus_info
Annotated Snippet
if (ACPI_FAILURE(status)) {
goto error_exit;
}
acpi_gbl_db_scope_buf[0] = 0;
} else {
/* Validate new scope relative to old scope */
status = acpi_ns_get_node(acpi_gbl_db_scope_node, name,
ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
}
/* Build the final pathname */
if (acpi_ut_safe_strcat
(acpi_gbl_db_scope_buf, sizeof(acpi_gbl_db_scope_buf), name)) {
status = AE_BUFFER_OVERFLOW;
goto error_exit;
}
if (acpi_ut_safe_strcat
(acpi_gbl_db_scope_buf, sizeof(acpi_gbl_db_scope_buf), "\\")) {
status = AE_BUFFER_OVERFLOW;
goto error_exit;
}
acpi_gbl_db_scope_node = node;
acpi_os_printf("New scope: %s\n", acpi_gbl_db_scope_buf);
return;
error_exit:
acpi_os_printf("Could not attach scope: %s, %s\n",
name, acpi_format_exception(status));
}
/*******************************************************************************
*
* 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)
{
acpi_handle subtree_entry = acpi_gbl_root_node;
u32 max_depth = ACPI_UINT32_MAX;
/* No argument given, just start at the root and dump entire namespace */
if (start_arg) {
subtree_entry = acpi_db_convert_to_node(start_arg);
if (!subtree_entry) {
return;
}
/* Now we can check for the depth argument */
if (depth_arg) {
max_depth = strtoul(depth_arg, NULL, 0);
}
}
acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT);
if (((struct acpi_namespace_node *)subtree_entry)->parent) {
acpi_os_printf("ACPI Namespace (from %4.4s (%p) subtree):\n",
((struct acpi_namespace_node *)subtree_entry)->
name.ascii, subtree_entry);
} else {
acpi_os_printf("ACPI Namespace (from %s):\n",
ACPI_NAMESPACE_ROOT);
}
/* Display the subtree */
acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT);
acpi_ns_dump_objects(ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth,
ACPI_OWNER_ID_MAX, subtree_entry);
acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT);
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acnamesp.h`, `acdebug.h`, `acpredef.h`, `acinterp.h`.
- Detected declarations: `function acpi_db_set_scope`, `function acpi_db_dump_namespace`, `function acpi_db_dump_namespace_paths`, `function acpi_db_dump_namespace_by_owner`, `function acpi_db_walk_and_match_name`, `function acpi_db_find_name_in_namespace`, `function acpi_db_walk_for_predefined_names`, `function acpi_db_check_predefined_names`, `function acpi_db_walk_for_object_counts`, `function acpi_db_walk_for_fields`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.