tools/power/acpi/os_specific/service_layers/osunixxf.c
Source file repositories/reference/linux-study-clean/tools/power/acpi/os_specific/service_layers/osunixxf.c
File Facts
- System
- Linux kernel
- Corpus path
tools/power/acpi/os_specific/service_layers/osunixxf.c- Extension
.c- Size
- 33088 bytes
- Lines
- 1318
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hamlcode.hacparser.hacdebug.hstdio.hstdlib.hstdarg.hunistd.hsys/time.hsemaphore.hpthread.herrno.htermios.h
Detected Declarations
function readlinefunction os_exit_line_edit_modefunction acpi_os_initializefunction acpi_os_terminatefunction acpi_os_get_root_pointerfunction acpi_os_predefined_overridefunction acpi_os_table_overridefunction acpi_os_physical_table_overridefunction acpi_os_enter_sleepfunction acpi_os_redirect_outputfunction acpi_os_printffunction acpi_os_vprintffunction acpi_os_get_linefunction acpi_os_unmap_memoryfunction acpi_os_freefunction acpi_os_create_semaphorefunction acpi_os_delete_semaphorefunction acpi_os_wait_semaphorefunction acpi_os_signal_semaphorefunction acpi_os_create_semaphorefunction acpi_os_delete_semaphorefunction acpi_os_wait_semaphorefunction acpi_os_signal_semaphorefunction acpi_os_create_lockfunction acpi_os_delete_lockfunction acpi_os_acquire_lockfunction acpi_os_release_lockfunction acpi_os_install_interrupt_handlerfunction acpi_os_remove_interrupt_handlerfunction acpi_os_stallfunction acpi_os_sleepfunction acpi_os_get_timerfunction acpi_os_read_pci_configurationfunction acpi_os_write_pci_configurationfunction acpi_os_read_portfunction acpi_os_write_portfunction acpi_os_read_memoryfunction acpi_os_write_memoryfunction acpi_os_readablefunction acpi_os_writablefunction acpi_os_signalfunction acpi_os_get_thread_idfunction acpi_os_executefunction acpi_os_get_thread_idfunction acpi_os_executefunction acpi_os_wait_events_complete
Annotated Snippet
if (acpi_gbl_debug_file) {
/* Output file is open, send the output there */
va_start(args, fmt);
vfprintf(acpi_gbl_debug_file, fmt, args);
va_end(args);
} else {
/* No redirection, send output to console (once only!) */
flags |= ACPI_DB_CONSOLE_OUTPUT;
}
}
if (flags & ACPI_DB_CONSOLE_OUTPUT) {
va_start(args, fmt);
vfprintf(acpi_gbl_output_file, fmt, args);
va_end(args);
}
}
/******************************************************************************
*
* FUNCTION: acpi_os_vprintf
*
* PARAMETERS: fmt - Standard printf format
* args - Argument list
*
* RETURN: None
*
* DESCRIPTION: Formatted output with argument list pointer. Note: very
* similar to acpi_os_printf, changes should be tracked in both
* functions.
*
*****************************************************************************/
void acpi_os_vprintf(const char *fmt, va_list args)
{
u8 flags;
char buffer[ACPI_VPRINTF_BUFFER_SIZE];
/*
* We build the output string in a local buffer because we may be
* outputting the buffer twice. Using vfprintf is problematic because
* some implementations modify the args pointer/structure during
* execution. Thus, we use the local buffer for portability.
*
* Note: Since this module is intended for use by the various ACPICA
* utilities/applications, we can safely declare the buffer on the stack.
* Also, This function is used for relatively small error messages only.
*/
vsnprintf(buffer, ACPI_VPRINTF_BUFFER_SIZE, fmt, args);
flags = acpi_gbl_db_output_flags;
if (flags & ACPI_DB_REDIRECTABLE_OUTPUT) {
/* Output is directable to either a file (if open) or the console */
if (acpi_gbl_debug_file) {
/* Output file is open, send the output there */
fputs(buffer, acpi_gbl_debug_file);
} else {
/* No redirection, send output to console (once only!) */
flags |= ACPI_DB_CONSOLE_OUTPUT;
}
}
if (flags & ACPI_DB_CONSOLE_OUTPUT) {
fputs(buffer, acpi_gbl_output_file);
}
}
#ifndef ACPI_EXEC_APP
/******************************************************************************
*
* FUNCTION: acpi_os_get_line
*
* PARAMETERS: buffer - Where to return the command line
* buffer_length - Maximum length of Buffer
* bytes_read - Where the actual byte count is returned
*
* RETURN: Status and actual bytes read
*
* DESCRIPTION: Get the next input line from the terminal. NOTE: For the
* acpi_exec utility, we use the acgetline module instead to
* provide line-editing and history support.
*
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `amlcode.h`, `acparser.h`, `acdebug.h`, `stdio.h`, `stdlib.h`, `stdarg.h`.
- Detected declarations: `function readline`, `function os_exit_line_edit_mode`, `function acpi_os_initialize`, `function acpi_os_terminate`, `function acpi_os_get_root_pointer`, `function acpi_os_predefined_override`, `function acpi_os_table_override`, `function acpi_os_physical_table_override`, `function acpi_os_enter_sleep`, `function acpi_os_redirect_output`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.