diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -34,6 +34,9 @@ #include #include #include +#if defined(__amd64__) || defined(__aarch64__) +#include +#endif #include #include @@ -79,20 +82,28 @@ static void smbios_identify (driver_t *driver, device_t parent) { +#if defined(__amd64__) || defined(__aarch64__) + static struct uuid efi_smbios = EFI_TABLE_SMBIOS; +#endif struct smbios_eps *eps; device_t child; - vm_paddr_t addr; + vm_paddr_t addr = 0; + void *addr_efi; int length; int rid; if (!device_is_alive(parent)) return; +#if defined(__amd64__) || defined(__aarch64__) + if (!efi_get_table(&efi_smbios, &addr_efi)) + addr = (vm_paddr_t)addr_efi; +#endif + #if defined(__amd64__) || defined(__i386__) - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, - SMBIOS_STEP, SMBIOS_OFF); -#else - addr = 0; + if (addr == 0) + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + SMBIOS_STEP, SMBIOS_OFF); #endif if (addr != 0) { @@ -242,6 +253,9 @@ }; DRIVER_MODULE(smbios, nexus, smbios_driver, smbios_devclass, smbios_modevent, 0); +#if defined(__amd64__) || defined(__aarch64__) +MODULE_DEPEND(smbios, efirt, 1, 1, 1); +#endif MODULE_VERSION(smbios, 1); static int