drivers/acpi/acpica/tbinstal.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/tbinstal.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/tbinstal.c- Extension
.c- Size
- 9387 bytes
- Lines
- 305
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hactables.h
Detected Declarations
function Copyrightfunction acpi_load_tablefunction ACPI_COMPARE_NAMESEGfunction acpi_tb_override_tablefunction acpi_tb_uninstall_table
Annotated Snippet
ACPI_COMPARE_NAMESEG(&new_table_desc.signature, ACPI_SIG_SSDT)) {
ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X",
new_table_desc.signature.ascii,
ACPI_FORMAT_UINT64(address)));
goto release_and_exit;
}
/* Acquire the table lock */
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
/* Validate and verify a table before installation */
status = acpi_tb_verify_temp_table(&new_table_desc, NULL, &i);
if (ACPI_FAILURE(status)) {
if (status == AE_CTRL_TERMINATE) {
/*
* Table was unloaded, allow it to be reloaded.
* As we are going to return AE_OK to the caller, we should
* take the responsibility of freeing the input descriptor.
* Refill the input descriptor to ensure
* acpi_tb_install_table_with_override() can be called again to
* indicate the re-installation.
*/
acpi_tb_uninstall_table(&new_table_desc);
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
*table_index = i;
return_ACPI_STATUS(AE_OK);
}
goto unlock_and_exit;
}
/* Add the table to the global root table list */
acpi_tb_install_table_with_override(&new_table_desc, override,
table_index);
/* Invoke table handler */
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
acpi_tb_notify_table(ACPI_TABLE_EVENT_INSTALL, new_table_desc.pointer);
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
unlock_and_exit:
/* Release the table lock */
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
release_and_exit:
/* Release the temporary table descriptor */
acpi_tb_release_temp_table(&new_table_desc);
return_ACPI_STATUS(status);
}
/*******************************************************************************
*
* FUNCTION: acpi_tb_override_table
*
* PARAMETERS: old_table_desc - Validated table descriptor to be
* overridden
*
* RETURN: None
*
* DESCRIPTION: Attempt table override by calling the OSL override functions.
* Note: If the table is overridden, then the entire new table
* is acquired and returned by this function.
* Before/after invocation, the table descriptor is in a state
* that is "VALIDATED".
*
******************************************************************************/
void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
{
acpi_status status;
struct acpi_table_desc new_table_desc;
struct acpi_table_header *table;
acpi_physical_address address;
u32 length;
ACPI_ERROR_ONLY(char *override_type);
/* (1) Attempt logical override (returns a logical address) */
status = acpi_os_table_override(old_table_desc->pointer, &table);
if (ACPI_SUCCESS(status) && table) {
acpi_tb_acquire_temp_table(&new_table_desc,
ACPI_PTR_TO_PHYSADDR(table),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL,
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `actables.h`.
- Detected declarations: `function Copyright`, `function acpi_load_table`, `function ACPI_COMPARE_NAMESEG`, `function acpi_tb_override_table`, `function acpi_tb_uninstall_table`.
- 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.