drivers/acpi/acpica/nsobject.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/nsobject.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/nsobject.c- Extension
.c- Size
- 11775 bytes
- Lines
- 439
- 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.h
Detected Declarations
function acpi_ns_attach_objectfunction thatfunction acpi_ns_detach_objectfunction objectsfunction acpi_ns_attach_datafunction acpi_ns_detach_datafunction acpi_ns_get_attached_data
Annotated Snippet
while (last_obj_desc->common.next_object) {
last_obj_desc = last_obj_desc->common.next_object;
}
/* Install the object at the front of the object list */
last_obj_desc->common.next_object = node->object;
}
node->type = (u8) object_type;
node->object = obj_desc;
return_ACPI_STATUS(AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_ns_detach_object
*
* PARAMETERS: node - A Namespace node whose object will be detached
*
* RETURN: None.
*
* DESCRIPTION: Detach/delete an object associated with a namespace node.
* if the object is an allocated object, it is freed.
* Otherwise, the field is simply cleared.
*
******************************************************************************/
void acpi_ns_detach_object(struct acpi_namespace_node *node)
{
union acpi_operand_object *obj_desc;
ACPI_FUNCTION_TRACE(ns_detach_object);
obj_desc = node->object;
/* Alias nodes point directly to other namespace nodes; skip teardown */
if (node->flags & ANOBJ_IS_ALIAS) {
node->object = NULL;
return_VOID;
}
if (!obj_desc || (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) {
return_VOID;
}
if (node->flags & ANOBJ_ALLOCATED_BUFFER) {
/* Free the dynamic aml buffer */
if (obj_desc->common.type == ACPI_TYPE_METHOD) {
ACPI_FREE(obj_desc->method.aml_start);
}
}
if (obj_desc->common.type == ACPI_TYPE_REGION) {
acpi_ut_remove_address_range(obj_desc->region.space_id, node);
}
/* Clear the Node entry in all cases */
node->object = NULL;
if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_OPERAND) {
/* Unlink object from front of possible object list */
node->object = obj_desc->common.next_object;
/* Handle possible 2-descriptor object */
if (node->object &&
(node->object->common.type != ACPI_TYPE_LOCAL_DATA)) {
node->object = node->object->common.next_object;
}
/*
* Detach the object from any data objects (which are still held by
* the namespace node)
*/
if (obj_desc->common.next_object &&
((obj_desc->common.next_object)->common.type ==
ACPI_TYPE_LOCAL_DATA)) {
obj_desc->common.next_object = NULL;
}
}
/* Reset the node type to untyped */
node->type = ACPI_TYPE_ANY;
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acnamesp.h`.
- Detected declarations: `function acpi_ns_attach_object`, `function that`, `function acpi_ns_detach_object`, `function objects`, `function acpi_ns_attach_data`, `function acpi_ns_detach_data`, `function acpi_ns_get_attached_data`.
- 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.