drivers/acpi/acpica/rsmisc.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/rsmisc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/rsmisc.c- Extension
.c- Size
- 19498 bytes
- Lines
- 807
- 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.hacresrc.h
Detected Declarations
function acpi_rs_convert_aml_to_resourcefunction acpi_rs_convert_resource_to_aml
Annotated Snippet
switch (info->opcode) {
case ACPI_RSC_INITGET:
/*
* Get the resource type and the initial (minimum) length
*/
memset(resource, 0, INIT_RESOURCE_LENGTH(info));
resource->type = INIT_RESOURCE_TYPE(info);
resource->length = INIT_RESOURCE_LENGTH(info);
break;
case ACPI_RSC_INITSET:
break;
case ACPI_RSC_FLAGINIT:
flags_mode = TRUE;
break;
case ACPI_RSC_1BITFLAG:
/*
* Mask and shift the flag bit
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x01));
break;
case ACPI_RSC_2BITFLAG:
/*
* Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x03));
break;
case ACPI_RSC_3BITFLAG:
/*
* Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x07));
break;
case ACPI_RSC_6BITFLAG:
/*
* Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x3F));
break;
case ACPI_RSC_COUNT:
item_count = ACPI_GET8(source);
ACPI_SET8(destination, item_count);
resource->length = resource->length +
(info->value * (item_count - 1));
break;
case ACPI_RSC_COUNT16:
item_count = aml_resource_length;
ACPI_SET16(destination, item_count);
resource->length = resource->length +
(info->value * (item_count - 1));
break;
case ACPI_RSC_COUNT_GPIO_PIN:
target = ACPI_ADD_PTR(void, aml, info->value);
item_count = ACPI_GET16(target) - ACPI_GET16(source);
resource->length = resource->length + item_count;
item_count = item_count / 2;
ACPI_SET16(destination, item_count);
break;
case ACPI_RSC_COUNT_GPIO_VEN:
item_count = ACPI_GET8(source);
ACPI_SET8(destination, item_count);
resource->length =
resource->length + (info->value * item_count);
break;
case ACPI_RSC_COUNT_GPIO_RES:
/*
* Vendor data is optional (length/offset may both be zero)
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acresrc.h`.
- Detected declarations: `function acpi_rs_convert_aml_to_resource`, `function acpi_rs_convert_resource_to_aml`.
- 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.