drivers/acpi/acpica/dbcmds.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dbcmds.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dbcmds.c- Extension
.c- Size
- 32192 bytes
- Lines
- 1205
- 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.hacevents.hacdebug.hacnamesp.hacresrc.hactables.h
Detected Declarations
function acpi_db_sleepfunction acpi_db_do_one_sleep_statefunction acpi_db_display_locksfunction acpi_db_display_table_infofunction acpi_db_unload_acpi_tablefunction acpi_db_send_notifyfunction acpi_db_display_interfacesfunction acpi_db_display_templatefunction acpi_dm_compare_aml_resourcesfunction acpi_dm_test_resource_conversionfunction acpi_db_resource_callbackfunction acpi_db_device_resourcesfunction acpi_db_display_resourcesfunction acpi_db_generate_interruptfunction acpi_db_generate_gpefunction acpi_db_generate_scifunction acpi_db_trace
Annotated Snippet
if (!acpi_os_readable(node, sizeof(struct acpi_namespace_node))) {
acpi_os_printf("Address %p is invalid", node);
return (NULL);
}
/* Make sure pointer is valid NS node */
if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
acpi_os_printf
("Address %p is not a valid namespace node [%s]\n",
node, acpi_ut_get_descriptor_name(node));
return (NULL);
}
} else {
/*
* Alpha argument: The parameter is a name string that must be
* resolved to a Namespace object.
*/
node = acpi_db_local_ns_lookup(in_string);
if (!node) {
acpi_os_printf
("Could not find [%s] in namespace, defaulting to root node\n",
in_string);
node = acpi_gbl_root_node;
}
}
return (node);
}
/*******************************************************************************
*
* FUNCTION: acpi_db_sleep
*
* PARAMETERS: object_arg - Desired sleep state (0-5). NULL means
* invoke all possible sleep states.
*
* RETURN: Status
*
* DESCRIPTION: Simulate sleep/wake sequences
*
******************************************************************************/
acpi_status acpi_db_sleep(char *object_arg)
{
u8 sleep_state;
u32 i;
ACPI_FUNCTION_TRACE(acpi_db_sleep);
/* Null input (no arguments) means to invoke all sleep states */
if (!object_arg) {
acpi_os_printf("Invoking all possible sleep states, 0-%d\n",
ACPI_S_STATES_MAX);
for (i = 0; i <= ACPI_S_STATES_MAX; i++) {
acpi_db_do_one_sleep_state((u8)i);
}
return_ACPI_STATUS(AE_OK);
}
/* Convert argument to binary and invoke the sleep state */
sleep_state = (u8)strtoul(object_arg, NULL, 0);
acpi_db_do_one_sleep_state(sleep_state);
return_ACPI_STATUS(AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_db_do_one_sleep_state
*
* PARAMETERS: sleep_state - Desired sleep state (0-5)
*
* RETURN: None
*
* DESCRIPTION: Simulate a sleep/wake sequence
*
******************************************************************************/
static void acpi_db_do_one_sleep_state(u8 sleep_state)
{
acpi_status status;
u8 sleep_type_a;
u8 sleep_type_b;
/* Validate parameter */
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acevents.h`, `acdebug.h`, `acnamesp.h`, `acresrc.h`, `actables.h`.
- Detected declarations: `function acpi_db_sleep`, `function acpi_db_do_one_sleep_state`, `function acpi_db_display_locks`, `function acpi_db_display_table_info`, `function acpi_db_unload_acpi_table`, `function acpi_db_send_notify`, `function acpi_db_display_interfaces`, `function acpi_db_display_template`, `function acpi_dm_compare_aml_resources`, `function acpi_dm_test_resource_conversion`.
- 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.