drivers/acpi/acpica/dswstate.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dswstate.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dswstate.c- Extension
.c- Size
- 19800 bytes
- Lines
- 729
- 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.hacdispat.hacnamesp.h
Detected Declarations
function acpi_ds_result_popfunction acpi_ds_result_pushfunction acpi_ds_result_stack_pushfunction acpi_ds_result_stack_popfunction acpi_ds_obj_stack_pushfunction acpi_ds_obj_stack_popfunction acpi_ds_obj_stack_pop_and_deletefunction acpi_ds_push_walk_statefunction acpi_ds_init_aml_walkfunction acpi_ds_delete_walk_state
Annotated Snippet
if (ACPI_FAILURE(status)) {
return (status);
}
}
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Obj=%p [%s] Index=%X State=%p Num=%X\n", *object,
acpi_ut_get_object_type_name(*object),
index, walk_state, walk_state->result_count));
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_ds_result_push
*
* PARAMETERS: object - Where to return the popped object
* walk_state - Current Walk state
*
* RETURN: Status
*
* DESCRIPTION: Push an object onto the current result stack
*
******************************************************************************/
acpi_status
acpi_ds_result_push(union acpi_operand_object *object,
struct acpi_walk_state *walk_state)
{
union acpi_generic_state *state;
acpi_status status;
u32 index;
ACPI_FUNCTION_NAME(ds_result_push);
if (walk_state->result_count > walk_state->result_size) {
ACPI_ERROR((AE_INFO, "Result stack is full"));
return (AE_AML_INTERNAL);
} else if (walk_state->result_count == walk_state->result_size) {
/* Extend the result stack */
status = acpi_ds_result_stack_push(walk_state);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
"Failed to extend the result stack"));
return (status);
}
}
if (!(walk_state->result_count < walk_state->result_size)) {
ACPI_ERROR((AE_INFO, "No free elements in result stack"));
return (AE_AML_INTERNAL);
}
state = walk_state->results;
if (!state) {
ACPI_ERROR((AE_INFO, "No result stack frame during push"));
return (AE_AML_INTERNAL);
}
if (!object) {
ACPI_ERROR((AE_INFO,
"Null Object! State=%p Num=%u",
walk_state, walk_state->result_count));
return (AE_BAD_PARAMETER);
}
/* Assign the address of object to the top free element of result stack */
index = (u32)walk_state->result_count % ACPI_RESULTS_FRAME_OBJ_NUM;
state->results.obj_desc[index] = object;
walk_state->result_count++;
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
object,
acpi_ut_get_object_type_name((union
acpi_operand_object *)
object), walk_state,
walk_state->result_count,
walk_state->current_result));
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_ds_result_stack_push
*
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `acdispat.h`, `acnamesp.h`.
- Detected declarations: `function acpi_ds_result_pop`, `function acpi_ds_result_push`, `function acpi_ds_result_stack_push`, `function acpi_ds_result_stack_pop`, `function acpi_ds_obj_stack_push`, `function acpi_ds_obj_stack_pop`, `function acpi_ds_obj_stack_pop_and_delete`, `function acpi_ds_push_walk_state`, `function acpi_ds_init_aml_walk`, `function acpi_ds_delete_walk_state`.
- 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.