Page MenuHomeFreeBSD

D42727.diff
No OneTemporary

D42727.diff

diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -909,6 +909,7 @@
char buf[24];
int revision;
+ feature_enable(FEATURE_EARLY_ACPI);
if ((rsdp = efi_get_table(&acpi20)) == NULL)
if ((rsdp = efi_get_table(&acpi)) == NULL)
return;
diff --git a/stand/i386/libi386/biosacpi.c b/stand/i386/libi386/biosacpi.c
--- a/stand/i386/libi386/biosacpi.c
+++ b/stand/i386/libi386/biosacpi.c
@@ -54,6 +54,8 @@
char buf[24];
int revision;
+ feature_enable(FEATURE_EARLY_ACPI);
+
/* locate and validate the RSDP */
if ((rsdp = biosacpi_find_rsdp()) == NULL)
return;
diff --git a/stand/lua/core.lua b/stand/lua/core.lua
--- a/stand/lua/core.lua
+++ b/stand/lua/core.lua
@@ -133,17 +133,20 @@
end
function core.hasACPI()
- return loader.getenv("acpi.rsdp") ~= nil
-end
+ -- We can't trust acpi.rsdp to be set if the loader binary doesn't do
+ -- ACPI detection early enough. UEFI loader historically didn't, so
+ -- we'll fallback to assuming ACPI is enabled if this binary does not
+ -- declare that it probes for ACPI early enough
+ if loader.getenv("acpi.rsdp") ~= nil then
+ return true
+ end
-function core.isX86()
- return loader.machine_arch == "i386" or loader.machine_arch == "amd64"
+ return not core.hasFeature("EARLY_ACPI")
end
function core.getACPI()
if not core.hasACPI() then
- -- x86 requires ACPI pretty much
- return false or core.isX86()
+ return false
end
-- Otherwise, respect disabled if it's set
@@ -157,13 +160,11 @@
end
if acpi then
- loader.setenv("acpi_load", "YES")
+ config.enableModule("acpi")
loader.setenv("hint.acpi.0.disabled", "0")
- loader.unsetenv("loader.acpi_disabled_by_user")
else
- loader.unsetenv("acpi_load")
+ config.disableModule("acpi")
loader.setenv("hint.acpi.0.disabled", "1")
- loader.setenv("loader.acpi_disabled_by_user", "1")
end
core.acpi = acpi
end

File Metadata

Mime Type
text/plain
Expires
Thu, Feb 6, 8:34 AM (20 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16489922
Default Alt Text
D42727.diff (1 KB)

Event Timeline