drivers/acpi/acpica/tbfadt.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/tbfadt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/tbfadt.c- Extension
.c- Size
- 22448 bytes
- Lines
- 722
- 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 acpi_tb_init_generic_addressfunction acpi_tb_select_addressfunction acpi_tb_parse_fadtfunction acpi_tb_create_local_fadtfunction acpi_tb_convert_fadtfunction optionalfunction acpi_tb_setup_fadt_registersfunction register
Annotated Snippet
if (!(flags & ACPI_FADT_GPE_REGISTER)) {
ACPI_ERROR((AE_INFO,
"%s - 32-bit FADT register is too long (%u bytes, %u bits) "
"to convert to GAS struct - 255 bits max, truncating",
register_name, byte_width,
(byte_width * 8)));
}
bit_width = 255;
}
/*
* The 64-bit Address field is non-aligned in the byte packed
* GAS struct.
*/
ACPI_MOVE_64_TO_64(&generic_address->address, &address);
/* All other fields are byte-wide */
generic_address->space_id = space_id;
generic_address->bit_width = bit_width;
generic_address->bit_offset = 0;
generic_address->access_width = 0; /* Access width ANY */
}
/*******************************************************************************
*
* FUNCTION: acpi_tb_select_address
*
* PARAMETERS: register_name - ASCII name of the ACPI register
* address32 - 32-bit address of the register
* address64 - 64-bit address of the register
*
* RETURN: The resolved 64-bit address
*
* DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within
* the FADT. Used for the FACS and DSDT addresses.
*
* NOTES:
*
* Check for FACS and DSDT address mismatches. An address mismatch between
* the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
* DSDT/X_DSDT) could be a corrupted address field or it might indicate
* the presence of two FACS or two DSDT tables.
*
* November 2013:
* By default, as per the ACPICA specification, a valid 64-bit address is
* used regardless of the value of the 32-bit address. However, this
* behavior can be overridden via the acpi_gbl_use32_bit_fadt_addresses flag.
*
******************************************************************************/
static u64
acpi_tb_select_address(char *register_name, u32 address32, u64 address64)
{
if (!address64) {
/* 64-bit address is zero, use 32-bit address */
return ((u64)address32);
}
if (address32 && (address64 != (u64)address32)) {
/* Address mismatch between 32-bit and 64-bit versions */
ACPI_BIOS_WARNING((AE_INFO,
"32/64X %s address mismatch in FADT: "
"0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
register_name, address32,
ACPI_FORMAT_UINT64(address64),
acpi_gbl_use32_bit_fadt_addresses ? 32 :
64));
/* 32-bit address override */
if (acpi_gbl_use32_bit_fadt_addresses) {
return ((u64)address32);
}
}
/* Default is to use the 64-bit address */
return (address64);
}
/*******************************************************************************
*
* FUNCTION: acpi_tb_parse_fadt
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `actables.h`.
- Detected declarations: `function acpi_tb_init_generic_address`, `function acpi_tb_select_address`, `function acpi_tb_parse_fadt`, `function acpi_tb_create_local_fadt`, `function acpi_tb_convert_fadt`, `function optional`, `function acpi_tb_setup_fadt_registers`, `function register`.
- 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.