drivers/acpi/acpica/utaddress.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/utaddress.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/utaddress.c- Extension
.c- Size
- 7738 bytes
- Lines
- 257
- 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.hacnamesp.h
Detected Declarations
function Copyrightfunction acpi_ut_remove_address_rangefunction acpi_ut_check_address_rangefunction acpi_ut_delete_address_lists
Annotated Snippet
if (range_info->region_node == region_node) {
if (range_info == prev) { /* Found at list head */
acpi_gbl_address_range_list[space_id] =
range_info->next;
} else {
prev->next = range_info->next;
}
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
acpi_ut_get_node_name(range_info->
region_node),
ACPI_FORMAT_UINT64(range_info->
start_address),
ACPI_FORMAT_UINT64(range_info->
end_address)));
ACPI_FREE(range_info);
return_VOID;
}
prev = range_info;
range_info = range_info->next;
}
return_VOID;
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_check_address_range
*
* PARAMETERS: space_id - Address space ID
* address - Start address
* length - Length of address range
* warn - TRUE if warning on overlap desired
*
* RETURN: Count of the number of conflicts detected. Zero is always
* returned for Space IDs other than Memory or I/O.
*
* DESCRIPTION: Check if the input address range overlaps any of the
* ASL operation region address ranges. The only supported
* Space IDs are Memory and I/O.
*
* MUTEX: Assumes the namespace is locked.
*
******************************************************************************/
u32
acpi_ut_check_address_range(acpi_adr_space_type space_id,
acpi_physical_address address, u32 length, u8 warn)
{
struct acpi_address_range *range_info;
acpi_physical_address end_address;
char *pathname;
u32 overlap_count = 0;
ACPI_FUNCTION_TRACE(ut_check_address_range);
if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
(space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
return_UINT32(0);
}
range_info = acpi_gbl_address_range_list[space_id];
end_address = address + length - 1;
/* Check entire list for all possible conflicts */
while (range_info) {
/*
* Check if the requested address/length overlaps this
* address range. There are four cases to consider:
*
* 1) Input address/length is contained completely in the
* address range
* 2) Input address/length overlaps range at the range start
* 3) Input address/length overlaps range at the range end
* 4) Input address/length completely encompasses the range
*/
if ((address <= range_info->end_address) &&
(end_address >= range_info->start_address)) {
/* Found an address range overlap */
overlap_count++;
if (warn) { /* Optional warning message */
pathname =
acpi_ns_get_normalized_pathname(range_info->
region_node,
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acnamesp.h`.
- Detected declarations: `function Copyright`, `function acpi_ut_remove_address_range`, `function acpi_ut_check_address_range`, `function acpi_ut_delete_address_lists`.
- 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.