drivers/acpi/acpica/exnames.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/exnames.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/exnames.c- Extension
.c- Size
- 9761 bytes
- Lines
- 399
- 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.h
Detected Declarations
function acpi_ex_name_segmentfunction acpi_ex_get_name_string
Annotated Snippet
while (prefix_count--) {
*temp_ptr++ = AML_PARENT_PREFIX;
}
}
/* Set up Dual or Multi prefixes if needed */
if (num_name_segs > 2) {
/* Set up multi prefixes */
*temp_ptr++ = AML_MULTI_NAME_PREFIX;
*temp_ptr++ = (char)num_name_segs;
} else if (2 == num_name_segs) {
/* Set up dual prefixes */
*temp_ptr++ = AML_DUAL_NAME_PREFIX;
}
/*
* Terminate string following prefixes. acpi_ex_name_segment() will
* append the segment(s)
*/
*temp_ptr = 0;
return_PTR(name_string);
}
/*******************************************************************************
*
* FUNCTION: acpi_ex_name_segment
*
* PARAMETERS: in_aml_address - Pointer to the name in the AML code
* name_string - Where to return the name. The name is appended
* to any existing string to form a namepath
*
* RETURN: Status
*
* DESCRIPTION: Extract an ACPI name (4 bytes) from the AML byte stream
*
******************************************************************************/
static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
{
char *aml_address = (void *)*in_aml_address;
acpi_status status = AE_OK;
u32 index;
char char_buf[5];
ACPI_FUNCTION_TRACE(ex_name_segment);
/*
* If first character is a digit, then we know that we aren't looking
* at a valid name segment
*/
char_buf[0] = *aml_address;
if ('0' <= char_buf[0] && char_buf[0] <= '9') {
ACPI_ERROR((AE_INFO, "Invalid leading digit: %c", char_buf[0]));
return_ACPI_STATUS(AE_CTRL_PENDING);
}
for (index = 0;
(index < ACPI_NAMESEG_SIZE)
&& (acpi_ut_valid_name_char(*aml_address, 0)); index++) {
char_buf[index] = *aml_address++;
}
/* Valid name segment */
if (index == 4) {
/* Found 4 valid characters */
char_buf[4] = '\0';
if (name_string) {
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Appending NameSeg %s\n", char_buf));
strcat(name_string, char_buf);
} else {
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"No Name string - %s\n", char_buf));
}
} else if (index == 0) {
/*
* First character was not a valid name character,
* so we are looking at something other than a name.
*/
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acinterp.h`, `amlcode.h`.
- Detected declarations: `function acpi_ex_name_segment`, `function acpi_ex_get_name_string`.
- 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.