drivers/acpi/acpica/dbtest.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dbtest.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dbtest.c- Extension
.c- Size
- 29348 bytes
- Lines
- 1105
- 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.hacdebug.hacnamesp.hacpredef.hacinterp.h
Detected Declarations
function acpi_db_execute_testfunction acpi_db_test_all_objectsfunction acpi_db_test_one_objectfunction acpi_db_test_integer_typefunction acpi_db_test_buffer_typefunction acpi_db_test_string_typefunction acpi_db_test_package_typefunction acpi_db_test_field_unit_typefunction acpi_db_read_from_objectfunction acpi_db_write_to_objectfunction acpi_db_evaluate_all_predefined_namesfunction acpi_db_evaluate_one_predefined_name
Annotated Snippet
if (ACPI_FAILURE(status)) {
acpi_os_printf
("%s, Could not install debugger read method\n",
acpi_format_exception(status));
return;
}
status =
acpi_get_handle(NULL, ACPI_DB_READ_METHOD, &read_handle);
if (ACPI_FAILURE(status)) {
acpi_os_printf
("Could not obtain handle for debug method %s\n",
ACPI_DB_READ_METHOD);
return;
}
}
/* Install the debugger write-object control method if necessary */
if (!write_handle) {
status = acpi_install_method(write_method_code);
if (ACPI_FAILURE(status)) {
acpi_os_printf
("%s, Could not install debugger write method\n",
acpi_format_exception(status));
return;
}
status =
acpi_get_handle(NULL, ACPI_DB_WRITE_METHOD, &write_handle);
if (ACPI_FAILURE(status)) {
acpi_os_printf
("Could not obtain handle for debug method %s\n",
ACPI_DB_WRITE_METHOD);
return;
}
}
/* Walk the entire namespace, testing each supported named data object */
(void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, acpi_db_test_one_object,
NULL, NULL, NULL);
}
/*******************************************************************************
*
* FUNCTION: acpi_db_test_one_object
*
* PARAMETERS: acpi_walk_callback
*
* RETURN: Status
*
* DESCRIPTION: Test one namespace object. Supported types are Integer,
* String, Buffer, Package, buffer_field, and field_unit.
* All other object types are simply ignored.
*
******************************************************************************/
static acpi_status
acpi_db_test_one_object(acpi_handle obj_handle,
u32 nesting_level, void *context, void **return_value)
{
struct acpi_namespace_node *node;
union acpi_operand_object *obj_desc;
acpi_object_type local_type;
u32 bit_length = 0;
u32 byte_length = 0;
acpi_status status = AE_OK;
node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle);
obj_desc = node->object;
/*
* For the supported types, get the actual bit length or
* byte length. Map the type to one of Integer/String/Buffer.
*/
switch (node->type) {
case ACPI_TYPE_INTEGER:
/* Integer width is either 32 or 64 */
local_type = ACPI_TYPE_INTEGER;
bit_length = acpi_gbl_integer_bit_width;
break;
case ACPI_TYPE_STRING:
local_type = ACPI_TYPE_STRING;
byte_length = obj_desc->string.length;
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acdebug.h`, `acnamesp.h`, `acpredef.h`, `acinterp.h`.
- Detected declarations: `function acpi_db_execute_test`, `function acpi_db_test_all_objects`, `function acpi_db_test_one_object`, `function acpi_db_test_integer_type`, `function acpi_db_test_buffer_type`, `function acpi_db_test_string_type`, `function acpi_db_test_package_type`, `function acpi_db_test_field_unit_type`, `function acpi_db_read_from_object`, `function acpi_db_write_to_object`.
- 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.