drivers/acpi/acpica/evregion.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/evregion.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/evregion.c- Extension
.c- Size
- 25796 bytes
- Lines
- 887
- 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.hacevents.hacnamesp.hacinterp.h
Detected Declarations
function acpi_ev_initialize_op_regionsfunction acpi_ev_address_space_dispatchfunction acpi_ev_detach_regionfunction acpi_ev_attach_regionfunction acpi_ev_execute_reg_methodfunction acpi_ev_execute_reg_methodsfunction statefunction acpi_ev_reg_runfunction acpi_ev_execute_orphan_reg_method
Annotated Snippet
if (!region_setup) {
/* No initialization routine, exit with error */
ACPI_ERROR((AE_INFO,
"No init routine for region(%p) [%s]",
region_obj,
acpi_ut_get_region_name(region_obj->region.
space_id)));
return_ACPI_STATUS(AE_NOT_EXIST);
}
if (field_obj
&& region_obj->region.space_id ==
ACPI_ADR_SPACE_PLATFORM_COMM) {
struct acpi_pcc_info *ctx =
handler_desc->address_space.context;
ctx->internal_buffer =
field_obj->field.internal_pcc_buffer;
ctx->length = (u16)region_obj->region.length;
ctx->subspace_id = (u8)region_obj->region.address;
}
if (region_obj->region.space_id ==
ACPI_ADR_SPACE_FIXED_HARDWARE) {
struct acpi_ffh_info *ctx =
handler_desc->address_space.context;
ctx->length = region_obj->region.length;
ctx->offset = region_obj->region.address;
}
/*
* We must exit the interpreter because the region setup will
* potentially execute control methods (for example, the _REG method
* for this region)
*/
acpi_ex_exit_interpreter();
status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
context, ®ion_context);
/* Re-enter the interpreter */
acpi_ex_enter_interpreter();
/* Check for failure of the Region Setup */
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"During region initialization: [%s]",
acpi_ut_get_region_name(region_obj->
region.
space_id)));
return_ACPI_STATUS(status);
}
/* Region initialization may have been completed by region_setup */
if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
/*
* Save the returned context for use in all accesses to
* the handler for this particular region
*/
if (!(region_obj2->extra.region_context)) {
region_obj2->extra.region_context =
region_context;
}
}
}
/* We have everything we need, we can invoke the address space handler */
handler = handler_desc->address_space.handler;
address = (region_obj->region.address + region_offset);
ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
®ion_obj->region.handler->address_space, handler,
ACPI_FORMAT_UINT64(address),
acpi_ut_get_region_name(region_obj->region.
space_id)));
if (!(handler_desc->address_space.handler_flags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
/*
* For handlers other than the default (supplied) handlers, we must
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acevents.h`, `acnamesp.h`, `acinterp.h`.
- Detected declarations: `function acpi_ev_initialize_op_regions`, `function acpi_ev_address_space_dispatch`, `function acpi_ev_detach_region`, `function acpi_ev_attach_region`, `function acpi_ev_execute_reg_method`, `function acpi_ev_execute_reg_methods`, `function state`, `function acpi_ev_reg_run`, `function acpi_ev_execute_orphan_reg_method`.
- 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.