arch/arm64/kernel/acpi.c
Source file repositories/reference/linux-study-clean/arch/arm64/kernel/acpi.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kernel/acpi.c- Extension
.c- Size
- 13059 bytes
- Lines
- 491
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/arm-smccc.hlinux/cpumask.hlinux/efi.hlinux/efi-bgrt.hlinux/init.hlinux/irq.hlinux/irqdomain.hlinux/irq_work.hlinux/memblock.hlinux/of_fdt.hlinux/libfdt.hlinux/smp.hlinux/serial_core.hlinux/suspend.hlinux/pgtable.hacpi/ghes.hacpi/processor.hasm/cputype.hasm/cpu_ops.hasm/daifflags.hasm/smp_plat.h
Detected Declarations
function parse_acpifunction dt_is_stubfunction fdt_for_each_subnodefunction __acpi_map_tablefunction __acpi_unmap_tablefunction acpi_psci_presentfunction acpi_psci_use_hvcfunction acpi_fadt_sanity_checkfunction acpi_boot_table_initfunction __acpi_get_writethrough_mem_attributefunction __acpi_get_mem_attributefunction for_each_efi_memory_descfunction apei_claim_seafunction arch_reserve_mem_areafunction acpi_map_cpufunction acpi_unmap_cpufunction acpi_get_cpu_uidfunction get_cpu_for_acpi_idexport acpi_disabledexport acpi_pci_disabledexport acpi_map_cpuexport acpi_unmap_cpuexport acpi_get_cpu_uid
Annotated Snippet
if (!fadt->arm_boot_flags) {
ret = -EINVAL;
goto out;
}
pr_err("FADT has ARM boot flags set, assuming 5.1\n");
}
if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) {
pr_err("FADT not ACPI hardware reduced compliant\n");
ret = -EINVAL;
}
out:
/*
* acpi_get_table() creates FADT table mapping that
* should be released after parsing and before resuming boot
*/
acpi_put_table(table);
return ret;
}
/*
* acpi_boot_table_init() called from setup_arch(), always.
* 1. find RSDP and get its address, and then find XSDT
* 2. extract all tables and checksums them all
* 3. check ACPI FADT revision
* 4. check ACPI FADT HW reduced flag
*
* We can parse ACPI boot-time tables such as MADT after
* this function is called.
*
* On return ACPI is enabled if either:
*
* - ACPI tables are initialized and sanity checks passed
* - acpi=force was passed in the command line and ACPI was not disabled
* explicitly through acpi=off command line parameter
*
* ACPI is disabled on function return otherwise
*/
void __init acpi_boot_table_init(void)
{
/*
* Enable ACPI instead of device tree unless
* - ACPI has been disabled explicitly (acpi=off), or
* - the device tree is not empty (it has more than just a /chosen node,
* and a /hypervisor node when running on Xen)
* and ACPI has not been [force] enabled (acpi=on|force)
*/
if (param_acpi_off ||
(!param_acpi_on && !param_acpi_force && !dt_is_stub()))
goto done;
/*
* ACPI is disabled at this point. Enable it in order to parse
* the ACPI tables and carry out sanity checks
*/
enable_acpi();
/*
* If ACPI tables are initialized and FADT sanity checks passed,
* leave ACPI enabled and carry on booting; otherwise disable ACPI
* on initialization error.
* If acpi=force was passed on the command line it forces ACPI
* to be enabled even if its initialization failed.
*/
if (acpi_table_init() || acpi_fadt_sanity_check()) {
pr_err("Failed to init ACPI tables\n");
if (!param_acpi_force)
disable_acpi();
}
done:
if (acpi_disabled) {
if (earlycon_acpi_spcr_enable)
early_init_dt_scan_chosen_stdout();
} else {
#ifdef CONFIG_HIBERNATION
struct acpi_table_header *facs = NULL;
acpi_get_table(ACPI_SIG_FACS, 1, &facs);
if (facs) {
swsusp_hardware_signature =
((struct acpi_table_facs *)facs)->hardware_signature;
acpi_put_table(facs);
}
#endif
/*
* For varying privacy and security reasons, sometimes need
* to completely silence the serial console output, and only
* enable it when needed.
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/arm-smccc.h`, `linux/cpumask.h`, `linux/efi.h`, `linux/efi-bgrt.h`, `linux/init.h`, `linux/irq.h`, `linux/irqdomain.h`.
- Detected declarations: `function parse_acpi`, `function dt_is_stub`, `function fdt_for_each_subnode`, `function __acpi_map_table`, `function __acpi_unmap_table`, `function acpi_psci_present`, `function acpi_psci_use_hvc`, `function acpi_fadt_sanity_check`, `function acpi_boot_table_init`, `function __acpi_get_writethrough_mem_attribute`.
- Atlas domain: Architecture Layer / arch/arm64.
- Implementation status: integration 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.