drivers/acpi/acpica/dsopcode.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dsopcode.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/dsopcode.c- Extension
.c- Size
- 20126 bytes
- Lines
- 763
- 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.hacevents.hactables.h
Detected Declarations
function acpi_ds_initialize_regionfunction acpi_ds_init_buffer_fieldfunction opcodesfunction acpi_ds_eval_buffer_field_operandsfunction acpi_ds_eval_region_operandsfunction acpi_ds_eval_table_region_operandsfunction acpi_ds_eval_data_object_operandsfunction acpi_ds_eval_bank_field_operands
Annotated Snippet
if (bit_count == 0) {
ACPI_BIOS_ERROR((AE_INFO,
"Attempt to CreateField of length zero"));
status = AE_AML_OPERAND_VALUE;
goto cleanup;
}
break;
case AML_CREATE_BIT_FIELD_OP:
/* Offset is in bits, Field is one bit */
bit_offset = offset;
bit_count = 1;
field_flags = AML_FIELD_ACCESS_BYTE;
break;
case AML_CREATE_BYTE_FIELD_OP:
/* Offset is in bytes, field is one byte */
bit_offset = 8 * offset;
bit_count = 8;
field_flags = AML_FIELD_ACCESS_BYTE;
break;
case AML_CREATE_WORD_FIELD_OP:
/* Offset is in bytes, field is one word */
bit_offset = 8 * offset;
bit_count = 16;
field_flags = AML_FIELD_ACCESS_WORD;
break;
case AML_CREATE_DWORD_FIELD_OP:
/* Offset is in bytes, field is one dword */
bit_offset = 8 * offset;
bit_count = 32;
field_flags = AML_FIELD_ACCESS_DWORD;
break;
case AML_CREATE_QWORD_FIELD_OP:
/* Offset is in bytes, field is one qword */
bit_offset = 8 * offset;
bit_count = 64;
field_flags = AML_FIELD_ACCESS_QWORD;
break;
default:
ACPI_ERROR((AE_INFO,
"Unknown field creation opcode 0x%02X",
aml_opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
/* Entire field must fit within the current length of the buffer */
if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
status = AE_AML_BUFFER_LIMIT;
ACPI_BIOS_EXCEPTION((AE_INFO, status,
"Field [%4.4s] at bit offset/length %u/%u "
"exceeds size of target Buffer (%u bits)",
acpi_ut_get_node_name(result_desc),
bit_offset, bit_count,
8 * (u32)buffer_desc->buffer.length));
goto cleanup;
}
/*
* Initialize areas of the field object that are common to all fields
* For field_flags, use LOCK_RULE = 0 (NO_LOCK),
* UPDATE_RULE = 0 (UPDATE_PRESERVE)
*/
status =
acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
bit_offset, bit_count);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
obj_desc->buffer_field.buffer_obj = buffer_desc;
obj_desc->buffer_field.is_create_field =
aml_opcode == AML_CREATE_FIELD_OP;
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `amlcode.h`, `acdispat.h`, `acinterp.h`, `acnamesp.h`, `acevents.h`.
- Detected declarations: `function acpi_ds_initialize_region`, `function acpi_ds_init_buffer_field`, `function opcodes`, `function acpi_ds_eval_buffer_field_operands`, `function acpi_ds_eval_region_operands`, `function acpi_ds_eval_table_region_operands`, `function acpi_ds_eval_data_object_operands`, `function acpi_ds_eval_bank_field_operands`.
- 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.