drivers/acpi/acpica/exfldio.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/exfldio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/exfldio.c- Extension
.c- Size
- 27795 bytes
- Lines
- 968
- 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.
Dependency Surface
acpi/acpi.haccommon.hacinterp.hamlcode.hacevents.hacdispat.h
Detected Declarations
function acpi_ex_setup_regionfunction accessfunction datumfunction acpi_ex_access_regionfunction acpi_ex_register_overflowfunction acpi_ex_field_datum_iofunction acpi_ex_write_with_update_rulefunction acpi_ex_extract_from_fieldfunction acpi_ex_insert_into_field
Annotated Snippet
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
}
/*
* Exit now for SMBus, GSBus or IPMI address space, it has a non-linear
* address space and the request cannot be directly validated
*/
if (space_id == ACPI_ADR_SPACE_SMBUS ||
space_id == ACPI_ADR_SPACE_GSBUS ||
space_id == ACPI_ADR_SPACE_IPMI) {
/* SMBus or IPMI has a non-linear address space */
return_ACPI_STATUS(AE_OK);
}
#ifdef ACPI_UNDER_DEVELOPMENT
/*
* If the Field access is any_acc, we can now compute the optimal
* access (because we know the length of the parent region)
*/
if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
}
#endif
/*
* Validate the request. The entire request from the byte offset for a
* length of one field datum (access width) must fit within the region.
* (Region length is specified in bytes)
*/
if (rgn_desc->region.length <
(obj_desc->common_field.base_byte_offset + field_datum_byte_offset +
obj_desc->common_field.access_byte_width)) {
if (acpi_gbl_enable_interpreter_slack) {
/*
* Slack mode only: We will go ahead and allow access to this
* field if it is within the region length rounded up to the next
* access width boundary. acpi_size cast for 64-bit compile.
*/
if (ACPI_ROUND_UP(rgn_desc->region.length,
obj_desc->common_field.
access_byte_width) >=
((acpi_size)obj_desc->common_field.
base_byte_offset +
obj_desc->common_field.access_byte_width +
field_datum_byte_offset)) {
return_ACPI_STATUS(AE_OK);
}
}
if (rgn_desc->region.length <
obj_desc->common_field.access_byte_width) {
/*
* This is the case where the access_type (acc_word, etc.) is wider
* than the region itself. For example, a region of length one
* byte, and a field with Dword access specified.
*/
ACPI_ERROR((AE_INFO,
"Field [%4.4s] access width (%u bytes) "
"too large for region [%4.4s] (length %u)",
acpi_ut_get_node_name(obj_desc->
common_field.node),
obj_desc->common_field.access_byte_width,
acpi_ut_get_node_name(rgn_desc->region.
node),
rgn_desc->region.length));
}
/*
* Offset rounded up to next multiple of field width
* exceeds region length, indicate an error
*/
ACPI_ERROR((AE_INFO,
"Field [%4.4s] Base+Offset+Width %u+%u+%u "
"is beyond end of region [%4.4s] (length %u)",
acpi_ut_get_node_name(obj_desc->common_field.node),
obj_desc->common_field.base_byte_offset,
field_datum_byte_offset,
obj_desc->common_field.access_byte_width,
acpi_ut_get_node_name(rgn_desc->region.node),
rgn_desc->region.length));
return_ACPI_STATUS(AE_AML_REGION_LIMIT);
}
return_ACPI_STATUS(AE_OK);
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acinterp.h`, `amlcode.h`, `acevents.h`, `acdispat.h`.
- Detected declarations: `function acpi_ex_setup_region`, `function access`, `function datum`, `function acpi_ex_access_region`, `function acpi_ex_register_overflow`, `function acpi_ex_field_datum_io`, `function acpi_ex_write_with_update_rule`, `function acpi_ex_extract_from_field`, `function acpi_ex_insert_into_field`.
- 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.