drivers/acpi/acpica/utprint.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/utprint.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/utprint.c- Extension
.c- Size
- 16813 bytes
- Lines
- 712
- 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_bound_string_lengthfunction vsnprintffunction snprintffunction sprintffunction vprintffunction printffunction vfprintffunction fprintf
Annotated Snippet
while (number) {
(void)acpi_ut_divide(number, base, &number,
&digit_index);
*(pos++) = digits[digit_index];
}
}
/* *(Pos++) = '0'; */
return (pos);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_scan_number
*
* PARAMETERS: string - String buffer
* number_ptr - Where the number is returned
*
* RETURN: Updated position for next valid character
*
* DESCRIPTION: Scan a string for a decimal integer.
*
******************************************************************************/
const char *acpi_ut_scan_number(const char *string, u64 *number_ptr)
{
u64 number = 0;
while (isdigit((int)*string)) {
acpi_ut_short_multiply(number, 10, &number);
number += *(string++) - '0';
}
*number_ptr = number;
return (string);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_print_number
*
* PARAMETERS: string - String buffer
* number - The number to be converted
*
* RETURN: Updated position for next valid character
*
* DESCRIPTION: Print a decimal integer into a string.
*
******************************************************************************/
const char *acpi_ut_print_number(char *string, u64 number)
{
char ascii_string[20];
const char *pos1;
char *pos2;
pos1 = acpi_ut_put_number(ascii_string, number, 10, FALSE);
pos2 = string;
while (pos1 != ascii_string) {
*(pos2++) = *(--pos1);
}
*pos2 = 0;
return (string);
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_format_number
*
* PARAMETERS: string - String buffer with boundary
* end - Boundary of the string
* number - The number to be converted
* base - Base of the integer
* width - Field width
* precision - Precision of the integer
* type - Special printing flags
*
* RETURN: Updated position for next valid character
*
* DESCRIPTION: Print an integer into a string with any base and any precision.
*
******************************************************************************/
static char *acpi_ut_format_number(char *string,
char *end,
u64 number,
u8 base, s32 width, s32 precision, u8 type)
{
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`.
- Detected declarations: `function acpi_ut_bound_string_length`, `function vsnprintf`, `function snprintf`, `function sprintf`, `function vprintf`, `function printf`, `function vfprintf`, `function fprintf`.
- 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.