drivers/acpi/acpica/dsobject.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dsobject.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dsobject.c- Extension
.c- Size
- 14605 bytes
- Lines
- 546
- 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.hacparser.hamlcode.hacdispat.hacnamesp.hacinterp.h
Detected Declarations
function Copyrightfunction acpi_ds_build_internal_buffer_objfunction acpi_ds_create_nodefunction acpi_ds_init_object_from_op
Annotated Snippet
if (!op->common.node) {
/* Check if we are resolving a named reference within a package */
if ((op->common.parent->common.aml_opcode ==
AML_PACKAGE_OP)
|| (op->common.parent->common.aml_opcode ==
AML_VARIABLE_PACKAGE_OP)) {
/*
* We won't resolve package elements here, we will do this
* after all ACPI tables are loaded into the namespace. This
* behavior supports both forward references to named objects
* and external references to objects in other tables.
*/
goto create_new_object;
} else {
status = acpi_ns_lookup(walk_state->scope_info,
op->common.value.string,
ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT |
ACPI_NS_DONT_OPEN_SCOPE,
NULL,
ACPI_CAST_INDIRECT_PTR
(struct
acpi_namespace_node,
&(op->common.node)));
if (ACPI_FAILURE(status)) {
ACPI_ERROR_NAMESPACE(walk_state->
scope_info,
op->common.value.
string, status);
return_ACPI_STATUS(status);
}
}
}
}
create_new_object:
/* Create and init a new internal ACPI object */
obj_desc = acpi_ut_create_internal_object((acpi_ps_get_opcode_info
(op->common.aml_opcode))->
object_type);
if (!obj_desc) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
status =
acpi_ds_init_object_from_op(walk_state, op, op->common.aml_opcode,
&obj_desc);
if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference(obj_desc);
return_ACPI_STATUS(status);
}
/*
* Handling for unresolved package reference elements.
* These are elements that are namepaths.
*/
if ((op->common.parent->common.aml_opcode == AML_PACKAGE_OP) ||
(op->common.parent->common.aml_opcode == AML_VARIABLE_PACKAGE_OP)) {
obj_desc->reference.resolved = TRUE;
if ((op->common.aml_opcode == AML_INT_NAMEPATH_OP) &&
!obj_desc->reference.node) {
/*
* Name was unresolved above.
* Get the prefix node for later lookup
*/
obj_desc->reference.node =
walk_state->scope_info->scope.node;
obj_desc->reference.aml = op->common.aml;
obj_desc->reference.resolved = FALSE;
}
}
*obj_desc_ptr = obj_desc;
return_ACPI_STATUS(status);
}
/*******************************************************************************
*
* FUNCTION: acpi_ds_build_internal_buffer_obj
*
* PARAMETERS: walk_state - Current walk state
* op - Parser object to be translated
* buffer_length - Length of the buffer
* obj_desc_ptr - Where the ACPI internal object is returned
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `amlcode.h`, `acdispat.h`, `acnamesp.h`, `acinterp.h`.
- Detected declarations: `function Copyright`, `function acpi_ds_build_internal_buffer_obj`, `function acpi_ds_create_node`, `function acpi_ds_init_object_from_op`.
- 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.