drivers/acpi/acpica/rsxface.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/rsxface.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/rsxface.c- Extension
.c- Size
- 19649 bytes
- Lines
- 629
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hacresrc.hacnamesp.h
Detected Declarations
function acpi_rs_validate_parametersfunction acpi_get_irq_routing_tablefunction acpi_get_current_resourcesfunction acpi_get_possible_resourcesfunction acpi_set_current_resourcesfunction acpi_get_event_resourcesfunction acpi_resource_to_address64function acpi_get_vendor_resourcefunction acpi_rs_match_vendor_resourcefunction acpi_walk_resource_bufferfunction acpi_walk_resources
Annotated Snippet
if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
status = AE_AML_INVALID_RESOURCE_TYPE;
break;
}
/* Sanity check the length. It must not be zero, or we loop forever */
if (!resource->length) {
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
}
/* Invoke the user function, abort on any error returned */
status = user_function(resource, context);
if (ACPI_FAILURE(status)) {
if (status == AE_CTRL_TERMINATE) {
/* This is an OK termination by the user function */
status = AE_OK;
}
break;
}
/* end_tag indicates end-of-list */
if (resource->type == ACPI_RESOURCE_TYPE_END_TAG) {
break;
}
/* Get the next resource descriptor */
resource = ACPI_NEXT_RESOURCE(resource);
}
return_ACPI_STATUS(status);
}
ACPI_EXPORT_SYMBOL(acpi_walk_resource_buffer)
/*******************************************************************************
*
* FUNCTION: acpi_walk_resources
*
* PARAMETERS: device_handle - Handle to the device object for the
* device we are querying
* name - Method name of the resources we want.
* (METHOD_NAME__CRS, METHOD_NAME__PRS, or
* METHOD_NAME__AEI or METHOD_NAME__DMA)
* user_function - Called for each resource
* context - Passed to user_function
*
* RETURN: Status
*
* DESCRIPTION: Retrieves the current or possible resource list for the
* specified device. The user_function is called once for
* each resource in the list.
*
******************************************************************************/
acpi_status
acpi_walk_resources(acpi_handle device_handle,
char *name,
acpi_walk_resource_callback user_function, void *context)
{
acpi_status status;
struct acpi_buffer buffer;
ACPI_FUNCTION_TRACE(acpi_walk_resources);
/* Parameter validation */
if (!device_handle || !user_function || !name ||
(!ACPI_COMPARE_NAMESEG(name, METHOD_NAME__CRS) &&
!ACPI_COMPARE_NAMESEG(name, METHOD_NAME__PRS) &&
!ACPI_COMPARE_NAMESEG(name, METHOD_NAME__AEI) &&
!ACPI_COMPARE_NAMESEG(name, METHOD_NAME__DMA))) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
/* Get the _CRS/_PRS/_AEI/_DMA resource list */
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_rs_get_method_data(device_handle, name, &buffer);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Walk the resource list and cleanup */
status = acpi_walk_resource_buffer(&buffer, user_function, context);
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acresrc.h`, `acnamesp.h`.
- Detected declarations: `function acpi_rs_validate_parameters`, `function acpi_get_irq_routing_table`, `function acpi_get_current_resources`, `function acpi_get_possible_resources`, `function acpi_set_current_resources`, `function acpi_get_event_resources`, `function acpi_resource_to_address64`, `function acpi_get_vendor_resource`, `function acpi_rs_match_vendor_resource`, `function acpi_walk_resource_buffer`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration 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.