drivers/acpi/acpica/exutils.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/exutils.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/exutils.c- Extension
.c- Size
- 12456 bytes
- Lines
- 411
- 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_enter_interpreterfunction acpi_ex_exit_interpreterfunction acpi_ex_truncate_for32bit_tablefunction acpi_ex_acquire_global_lockfunction acpi_ex_release_global_lockfunction Basefunction acpi_ex_eisa_id_to_stringfunction isfunction ACPI_PCICLS_STRING_SIZEfunction acpi_is_valid_space_id
Annotated Snippet
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
*
* Copyright (C) 2000 - 2026, Intel Corp.
*
*****************************************************************************/
/*
* DEFINE_AML_GLOBALS is tested in amlcode.h
* to determine whether certain global names should be "defined" or only
* "declared" in the current compilation. This enhances maintainability
* by enabling a single header file to embody all knowledge of the names
* in question.
*
* Exactly one module of any executable should #define DEFINE_GLOBALS
* before #including the header files which use this convention. The
* names in question will be defined and initialized in that module,
* and declared as extern in all other modules which #include those
* header files.
*/
#define DEFINE_AML_GLOBALS
#include <acpi/acpi.h>
#include "accommon.h"
#include "acinterp.h"
#include "amlcode.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exutils")
/* Local prototypes */
static u32 acpi_ex_digits_needed(u64 value, u32 base);
/*******************************************************************************
*
* FUNCTION: acpi_ex_enter_interpreter
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Enter the interpreter execution region. Failure to enter
* the interpreter region is a fatal system error. Used in
* conjunction with exit_interpreter.
*
******************************************************************************/
void acpi_ex_enter_interpreter(void)
{
acpi_status status;
ACPI_FUNCTION_TRACE(ex_enter_interpreter);
status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
"Could not acquire AML Interpreter mutex"));
}
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "Could not acquire AML Namespace mutex"));
}
return_VOID;
}
/*******************************************************************************
*
* FUNCTION: acpi_ex_exit_interpreter
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Exit the interpreter execution region. This is the top level
* routine used to exit the interpreter when all processing has
* been completed, or when the method blocks.
*
* Cases where the interpreter is unlocked internally:
* 1) Method will be blocked on a Sleep() AML opcode
* 2) Method will be blocked on an Acquire() AML opcode
* 3) Method will be blocked on a Wait() AML opcode
* 4) Method will be blocked to acquire the global lock
* 5) Method will be blocked waiting to execute a serialized control
* method that is currently executing
* 6) About to invoke a user-installed opregion handler
*
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acinterp.h`, `amlcode.h`.
- Detected declarations: `function acpi_ex_enter_interpreter`, `function acpi_ex_exit_interpreter`, `function acpi_ex_truncate_for32bit_table`, `function acpi_ex_acquire_global_lock`, `function acpi_ex_release_global_lock`, `function Base`, `function acpi_ex_eisa_id_to_string`, `function is`, `function ACPI_PCICLS_STRING_SIZE`, `function acpi_is_valid_space_id`.
- 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.