drivers/acpi/acpica/utstrsuppt.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/utstrsuppt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/utstrsuppt.c- Extension
.c- Size
- 13200 bytes
- Lines
- 444
- 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.h
Detected Declarations
function acpi_ut_convert_octal_stringfunction acpi_ut_convert_decimal_stringfunction acpi_ut_convert_hex_stringfunction stringfunction stringfunction acpi_ut_detect_hex_prefixfunction acpi_ut_remove_hex_prefixfunction acpi_ut_detect_octal_prefixfunction overflowfunction acpi_ut_strtoul_multiply64function acpi_ut_strtoul_add64
Annotated Snippet
if (!(ACPI_IS_OCTAL_DIGIT(*string))) {
#ifdef ACPI_ASL_COMPILER
status = AE_BAD_OCTAL_CONSTANT;
#endif
break;
}
/* Convert and insert this octal digit into the accumulator */
status = acpi_ut_insert_digit(&accumulated_value, 8, *string);
if (ACPI_FAILURE(status)) {
status = AE_OCTAL_OVERFLOW;
break;
}
string++;
}
/* Always return the value that has been accumulated */
*return_value_ptr = accumulated_value;
return (status);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_convert_decimal_string
*
* PARAMETERS: string - Null terminated input string
* return_value_ptr - Where the converted value is returned
*
* RETURN: Status and 64-bit converted integer
*
* DESCRIPTION: Performs a base 10 conversion of the input string to an
* integer value, either 32 or 64 bits.
*
* NOTE: Maximum 64-bit unsigned decimal value is 18446744073709551615
* Maximum 32-bit unsigned decimal value is 4294967295
*
******************************************************************************/
acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr)
{
u64 accumulated_value = 0;
acpi_status status = AE_OK;
/* Convert each ASCII byte in the input string */
while (*string) {
/*
* Character must be ASCII 0-9, otherwise:
* 1) Runtime: terminate with no error, per the ACPI spec
* 2) Compiler: return an error
*/
if (!isdigit((int)*string)) {
#ifdef ACPI_ASL_COMPILER
status = AE_BAD_DECIMAL_CONSTANT;
#endif
break;
}
/* Convert and insert this decimal digit into the accumulator */
status = acpi_ut_insert_digit(&accumulated_value, 10, *string);
if (ACPI_FAILURE(status)) {
status = AE_DECIMAL_OVERFLOW;
break;
}
string++;
}
/* Always return the value that has been accumulated */
*return_value_ptr = accumulated_value;
return (status);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_convert_hex_string
*
* PARAMETERS: string - Null terminated input string
* return_value_ptr - Where the converted value is returned
*
* RETURN: Status and 64-bit converted integer
*
* DESCRIPTION: Performs a base 16 conversion of the input string to an
* integer value, either 32 or 64 bits.
*
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`.
- Detected declarations: `function acpi_ut_convert_octal_string`, `function acpi_ut_convert_decimal_string`, `function acpi_ut_convert_hex_string`, `function string`, `function string`, `function acpi_ut_detect_hex_prefix`, `function acpi_ut_remove_hex_prefix`, `function acpi_ut_detect_octal_prefix`, `function overflow`, `function acpi_ut_strtoul_multiply64`.
- 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.