drivers/acpi/acpica/dbmethod.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dbmethod.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dbmethod.c- Extension
.c- Size
- 15023 bytes
- Lines
- 590
- 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.hacdispat.hacnamesp.hacdebug.hacparser.hacpredef.h
Detected Declarations
function acpi_db_set_method_breakpointfunction acpi_db_set_method_call_breakpointfunction acpi_db_set_method_datafunction acpi_db_disassemble_amlfunction acpi_db_disassemble_methodfunction acpi_db_evaluate_objectfunction acpi_db_walk_for_executefunction acpi_db_walk_for_execute_allfunction acpi_db_evaluate_predefined_namesfunction acpi_db_evaluate_all
Annotated Snippet
if (!node) {
return;
}
if (node->type != ACPI_TYPE_INTEGER) {
acpi_os_printf("Can only set Integer nodes\n");
return;
}
obj_desc = node->object;
obj_desc->integer.value = value;
return;
}
/* Get the index and value */
index = strtoul(index_arg, NULL, 16);
walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
if (!walk_state) {
acpi_os_printf("There is no method currently executing\n");
return;
}
/* Create and initialize the new object */
obj_desc = acpi_ut_create_integer_object((u64)value);
if (!obj_desc) {
acpi_os_printf("Could not create an internal object\n");
return;
}
/* Store the new object into the target */
switch (type) {
case 'A':
/* Set a method argument */
if (index > ACPI_METHOD_MAX_ARG) {
acpi_os_printf("Arg%u - Invalid argument name\n",
index);
goto cleanup;
}
status = acpi_ds_store_object_to_local(ACPI_REFCLASS_ARG,
index, obj_desc,
walk_state);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
obj_desc = walk_state->arguments[index].object;
acpi_os_printf("Arg%u: ", index);
acpi_db_display_internal_object(obj_desc, walk_state);
break;
case 'L':
/* Set a method local */
if (index > ACPI_METHOD_MAX_LOCAL) {
acpi_os_printf
("Local%u - Invalid local variable name\n", index);
goto cleanup;
}
status = acpi_ds_store_object_to_local(ACPI_REFCLASS_LOCAL,
index, obj_desc,
walk_state);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
obj_desc = walk_state->local_variables[index].object;
acpi_os_printf("Local%u: ", index);
acpi_db_display_internal_object(obj_desc, walk_state);
break;
default:
break;
}
cleanup:
acpi_ut_remove_reference(obj_desc);
}
#ifdef ACPI_DISASSEMBLER
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acdispat.h`, `acnamesp.h`, `acdebug.h`, `acparser.h`, `acpredef.h`.
- Detected declarations: `function acpi_db_set_method_breakpoint`, `function acpi_db_set_method_call_breakpoint`, `function acpi_db_set_method_data`, `function acpi_db_disassemble_aml`, `function acpi_db_disassemble_method`, `function acpi_db_evaluate_object`, `function acpi_db_walk_for_execute`, `function acpi_db_walk_for_execute_all`, `function acpi_db_evaluate_predefined_names`, `function acpi_db_evaluate_all`.
- 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.