drivers/acpi/acpica/psutils.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/psutils.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/psutils.c- Extension
.c- Size
- 5466 bytes
- Lines
- 215
- 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.hacconvert.h
Detected Declarations
function Copyrightfunction acpi_ps_init_opfunction acpi_ps_free_opfunction acpi_ps_is_leading_charfunction acpi_ps_get_namefunction acpi_ps_set_name
Annotated Snippet
if (opcode == AML_SCOPE_OP) {
acpi_gbl_current_scope = op;
}
if (acpi_gbl_capture_comments) {
ASL_CV_TRANSFER_COMMENTS(op);
}
}
return (op);
}
/*******************************************************************************
*
* FUNCTION: acpi_ps_free_op
*
* PARAMETERS: op - Op to be freed
*
* RETURN: None.
*
* DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list
* or actually free it.
*
******************************************************************************/
void acpi_ps_free_op(union acpi_parse_object *op)
{
ACPI_FUNCTION_NAME(ps_free_op);
ASL_CV_CLEAR_OP_COMMENTS(op);
if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
"Free retval op: %p\n", op));
}
if (op->common.flags & ACPI_PARSEOP_GENERIC) {
(void)acpi_os_release_object(acpi_gbl_ps_node_cache, op);
} else {
(void)acpi_os_release_object(acpi_gbl_ps_node_ext_cache, op);
}
}
/*******************************************************************************
*
* FUNCTION: Utility functions
*
* DESCRIPTION: Low level character and object functions
*
******************************************************************************/
/*
* Is "c" a namestring lead character?
*/
u8 acpi_ps_is_leading_char(u32 c)
{
return ((u8) (c == '_' || (c >= 'A' && c <= 'Z')));
}
/*
* Get op's name (4-byte name segment) or 0 if unnamed
*/
u32 acpi_ps_get_name(union acpi_parse_object * op)
{
/* The "generic" object has no name associated with it */
if (op->common.flags & ACPI_PARSEOP_GENERIC) {
return (0);
}
/* Only the "Extended" parse objects have a name */
return (op->named.name);
}
/*
* Set op's name
*/
void acpi_ps_set_name(union acpi_parse_object *op, u32 name)
{
/* The "generic" object has no name associated with it */
if (op->common.flags & ACPI_PARSEOP_GENERIC) {
return;
}
op->named.name = name;
}
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `amlcode.h`, `acconvert.h`.
- Detected declarations: `function Copyright`, `function acpi_ps_init_op`, `function acpi_ps_free_op`, `function acpi_ps_is_leading_char`, `function acpi_ps_get_name`, `function acpi_ps_set_name`.
- 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.