diff options
| author | kpowkitty <witchikittikat@gmail.com> | 2025-08-31 22:30:27 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2025-09-14 02:24:19 +0000 |
| commit | c8b87aa10d684111ec4f82b31a262850a28e5eb2 (patch) | |
| tree | 13a2a8c1c1f163eb9b10ba55551ca5132020efb0 /stand/efi/loader | |
| parent | fa9ea99be6fb416cd0528e6a54053363775abe00 (diff) | |
Diffstat (limited to 'stand/efi/loader')
| -rw-r--r-- | stand/efi/loader/Makefile | 4 | ||||
| -rw-r--r-- | stand/efi/loader/main.c | 42 |
2 files changed, 6 insertions, 40 deletions
diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index b30c563d4331..b4520b957b74 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -30,6 +30,10 @@ SRCS= autoload.c \ gfx_fb.c \ 8x16.c +SRCS+= acpi_detect.c +.PATH: ${EFISRC}/acpica +CFLAGS+= -I${EFISRC}/acpica/include + CFLAGS+= -I${.CURDIR}/../loader .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 304b2e48272c..2e51f15f0b5f 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -69,6 +69,8 @@ #include "actypes.h" #include "actbl.h" +#include <acpi_detect.h> + #include "loader_efi.h" struct arch_switch archsw = { /* MI/MD interface boundary */ @@ -83,8 +85,6 @@ struct arch_switch archsw = { /* MI/MD interface boundary */ .arch_zfs_probe = efi_zfs_probe, }; -EFI_GUID acpi = ACPI_TABLE_GUID; -EFI_GUID acpi20 = ACPI_20_TABLE_GUID; EFI_GUID devid = DEVICE_PATH_PROTOCOL; EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; EFI_GUID mps = MPS_TABLE_GUID; @@ -120,11 +120,6 @@ UINT16 boot_current; */ EFI_LOADED_IMAGE *boot_img; -/* - * RSDP base table. - */ -ACPI_TABLE_RSDP *rsdp; - static bool has_keyboard(void) { @@ -1130,39 +1125,6 @@ ptov(uintptr_t x) } static void -acpi_detect(void) -{ - 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; - - sprintf(buf, "0x%016"PRIxPTR, (uintptr_t)rsdp); - setenv("acpi.rsdp", buf, 1); - revision = rsdp->Revision; - if (revision == 0) - revision = 1; - sprintf(buf, "%d", revision); - setenv("acpi.revision", buf, 1); - strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId)); - buf[sizeof(rsdp->OemId)] = '\0'; - setenv("acpi.oem", buf, 1); - sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress); - setenv("acpi.rsdt", buf, 1); - if (revision >= 2) { - /* XXX extended checksum? */ - sprintf(buf, "0x%016llx", - (unsigned long long)rsdp->XsdtPhysicalAddress); - setenv("acpi.xsdt", buf, 1); - sprintf(buf, "%d", rsdp->Length); - setenv("acpi.xsdt_length", buf, 1); - } -} - -static void efi_smbios_detect(void) { VOID *smbios_v2_ptr = NULL; |
