diff options
author | Warner Losh <imp@FreeBSD.org> | 2023-11-21 03:30:16 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2023-11-21 03:30:16 +0000 |
commit | 0abe05aeac29d99786401b9078e97dcead35f7f3 (patch) | |
tree | 50ccbe81b849c4949054d0d5463445ef75f06876 /stand/lua | |
parent | f213da893ca8c7c76e1656b36d3a10f93f9a1760 (diff) | |
download | src-0abe05aeac29d99786401b9078e97dcead35f7f3.tar.gz src-0abe05aeac29d99786401b9078e97dcead35f7f3.zip |
stand: bandaide for acpi
Old binaries do not set acpi.rsdp early enough. So when we boot with an
older loader.efi from an ESP that's not been updated, we assume there's
no ACPI on this system. This is unwise. Put a band-aide on this until we
can implement a proper 'feature' variable that the binary reports so we
can do conditionals for things like this in the future.
This is at best a rapid-response stop-gap.
Glanced at by: kevans
Sponsored by: Netflix
Diffstat (limited to 'stand/lua')
-rw-r--r-- | stand/lua/core.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 718783309687..f4a2815769c9 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -136,9 +136,14 @@ function core.hasACPI() return loader.getenv("acpi.rsdp") ~= nil end +function core.isX86() + return loader.machine_arch == "i386" or loader.machine_arch == "amd64" +end + function core.getACPI() if not core.hasACPI() then - return false + -- x86 requires ACPI pretty much + return false or core.isX86() end -- Otherwise, respect disabled if it's set |