// SPDX-License-Identifier: ISC #define pr_fmt(fmt) "acpi: " fmt #include #include #include #include #include #include #include #include #include phys_t acpi_rsdp_addr = 0; static char table_buf[0x1000]; static bool use_acpi = true; void use_acpi_option(bool use) { use_acpi = use; } CMDLINE_OPTION("acpi", "Enable ACPI firmware subsystem", use_acpi_option); [[__init]] static bool acpi_stage_init(struct boot_info* info) { if (!use_acpi) { log_warn("ACPI disabled on the command line!\n"); return false; } if (!info->rsdp) { log_warn("No RSDP was passed, unable to start ACPI subsystem!\n"); return false; } acpi_rsdp_addr = info->rsdp; if (uacpi_setup_early_table_access(table_buf, sizeof(table_buf)) != UACPI_STATUS_OK) { log_err("Failed to set up early table access!\n"); return false; } return true; } INIT_TASK(acpi_stage, "dev.acpi", acpi_stage_init); INIT_DEPENDS(acpi_stage, mem_stage); INIT_ENTAILS(acpi_stage, percpu_stage);