drivers/acpi/acpica/utobject.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/utobject.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/utobject.c- Extension
.c- Size
- 18879 bytes
- Lines
- 684
- 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.hlinux/kmemleak.haccommon.hacnamesp.h
Detected Declarations
function acpi_ut_valid_internal_objectfunction acpi_ut_delete_object_descfunction acpi_ut_get_simple_object_sizefunction acpi_ut_get_element_lengthfunction acpi_ut_get_package_object_sizefunction acpi_ut_get_object_size
Annotated Snippet
if (!second_object) {
acpi_ut_delete_object_desc(object);
return_PTR(NULL);
}
second_object->common.type = ACPI_TYPE_LOCAL_EXTRA;
second_object->common.reference_count = 1;
/* Link the second object to the first */
object->common.next_object = second_object;
break;
default:
/* All others have no secondary object */
break;
}
/* Save the object type in the object descriptor */
object->common.type = (u8) type;
/* Init the reference count */
object->common.reference_count = 1;
/* Any per-type initialization should go here */
return_PTR(object);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_package_object
*
* PARAMETERS: count - Number of package elements
*
* RETURN: Pointer to a new Package object, null on failure
*
* DESCRIPTION: Create a fully initialized package object
*
******************************************************************************/
union acpi_operand_object *acpi_ut_create_package_object(u32 count)
{
union acpi_operand_object *package_desc;
union acpi_operand_object **package_elements;
ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count);
/* Create a new Package object */
package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
if (!package_desc) {
return_PTR(NULL);
}
/*
* Create the element array. Count+1 allows the array to be null
* terminated.
*/
package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size)count +
1) * sizeof(void *));
if (!package_elements) {
acpi_ut_delete_object_desc(package_desc);
return_PTR(NULL);
}
package_desc->package.count = count;
package_desc->package.elements = package_elements;
return_PTR(package_desc);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_integer_object
*
* PARAMETERS: initial_value - Initial value for the integer
*
* RETURN: Pointer to a new Integer object, null on failure
*
* DESCRIPTION: Create an initialized integer object
*
******************************************************************************/
union acpi_operand_object *acpi_ut_create_integer_object(u64 initial_value)
{
union acpi_operand_object *integer_desc;
Annotation
- Immediate include surface: `acpi/acpi.h`, `linux/kmemleak.h`, `accommon.h`, `acnamesp.h`.
- Detected declarations: `function acpi_ut_valid_internal_object`, `function acpi_ut_delete_object_desc`, `function acpi_ut_get_simple_object_size`, `function acpi_ut_get_element_length`, `function acpi_ut_get_package_object_size`, `function acpi_ut_get_object_size`.
- 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.