drivers/acpi/acpica/dswexec.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dswexec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dswexec.c- Extension
.c- Size
- 19359 bytes
- Lines
- 761
- 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.hacinterp.hacnamesp.hacdebug.haecommon.h
Detected Declarations
function acpi_ds_get_predicate_valuefunction objectfunction acpi_ds_exec_begin_opfunction acpi_ds_exec_end_op
Annotated Snippet
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Could not get result from predicate evaluation"));
return_ACPI_STATUS(status);
}
} else {
status = acpi_ds_create_operand(walk_state, walk_state->op, 0);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
status =
acpi_ex_resolve_to_value(&walk_state->operands[0],
walk_state);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
obj_desc = walk_state->operands[0];
}
if (!obj_desc) {
ACPI_ERROR((AE_INFO,
"No predicate ObjDesc=%p State=%p",
obj_desc, walk_state));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
/*
* Result of predicate evaluation must be an Integer
* object. Implicitly convert the argument if necessary.
*/
status = acpi_ex_convert_to_integer(obj_desc, &local_obj_desc,
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
if (local_obj_desc->common.type != ACPI_TYPE_INTEGER) {
ACPI_ERROR((AE_INFO,
"Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
obj_desc, walk_state, obj_desc->common.type));
status = AE_AML_OPERAND_TYPE;
goto cleanup;
}
/* Truncate the predicate to 32-bits if necessary */
(void)acpi_ex_truncate_for32bit_table(local_obj_desc);
/*
* Save the result of the predicate evaluation on
* the control stack
*/
if (local_obj_desc->integer.value) {
walk_state->control_state->common.value = TRUE;
} else {
/*
* Predicate is FALSE, we will just toss the
* rest of the package
*/
walk_state->control_state->common.value = FALSE;
status = AE_CTRL_FALSE;
}
/* Predicate can be used for an implicit return value */
(void)acpi_ds_do_implicit_return(local_obj_desc, walk_state, TRUE);
cleanup:
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Completed a predicate eval=%X Op=%p\n",
walk_state->control_state->common.value,
walk_state->op));
/* Break to debugger to display result */
acpi_db_display_result_object(local_obj_desc, walk_state);
/*
* Delete the predicate result object (we know that
* we don't need it anymore)
*/
if (local_obj_desc != obj_desc) {
acpi_ut_remove_reference(local_obj_desc);
}
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `amlcode.h`, `acdispat.h`, `acinterp.h`, `acnamesp.h`, `acdebug.h`.
- Detected declarations: `function acpi_ds_get_predicate_value`, `function object`, `function acpi_ds_exec_begin_op`, `function acpi_ds_exec_end_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.