diff options
author | emaste <emaste@FreeBSD.org> | 2016-01-07 03:28:56 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-01-07 03:28:56 +0000 |
commit | 5f6f7a834a9a96b2e258879e21984f0a09ae6a95 (patch) | |
tree | aa373d97a76ca7becc8835f3f7d44c1a01ac8c05 /sys/boot/efi/loader | |
parent | 661fa31cb10b96870c0cbc9474e8cb6c2f848175 (diff) | |
download | FreeBSD-src-5f6f7a834a9a96b2e258879e21984f0a09ae6a95.zip FreeBSD-src-5f6f7a834a9a96b2e258879e21984f0a09ae6a95.tar.gz |
MFC r281138: SMBIOS support for EFI
Restore smbios support lost in r293297
Diffstat (limited to 'sys/boot/efi/loader')
-rw-r--r-- | sys/boot/efi/loader/Makefile | 6 | ||||
-rw-r--r-- | sys/boot/efi/loader/main.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile index 1625545..26fd8a0 100644 --- a/sys/boot/efi/loader/Makefile +++ b/sys/boot/efi/loader/Makefile @@ -20,9 +20,12 @@ SRCS= autoload.c \ copy.c \ devicename.c \ main.c \ + smbios.c \ vers.c .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} +# For smbios.c +.PATH: ${.CURDIR}/../../i386/libi386 .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" CFLAGS+= -fPIC @@ -32,7 +35,8 @@ CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -DNO_PCI +CFLAGS+= -I${.CURDIR}/../../i386/libi386 +CFLAGS+= -DNO_PCI -DEFI .if ${MK_FORTH} != "no" BOOT_FORTH= yes diff --git a/sys/boot/efi/loader/main.c b/sys/boot/efi/loader/main.c index 2300f6f..e6e13f1 100644 --- a/sys/boot/efi/loader/main.c +++ b/sys/boot/efi/loader/main.c @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include <efilib.h> #include <bootstrap.h> +#include <smbios.h> + #include "loader_efi.h" extern char bootprog_name[]; @@ -63,6 +65,7 @@ main(int argc, CHAR16 *argv[]) { char vendor[128]; EFI_LOADED_IMAGE *img; + EFI_GUID *guid; int i; /* @@ -128,6 +131,14 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; + for (i = 0; i < ST->NumberOfTableEntries; i++) { + guid = &ST->ConfigurationTable[i].VendorGuid; + if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + smbios_detect(ST->ConfigurationTable[i].VendorTable); + break; + } + } + interact(); /* doesn't return */ return (EFI_SUCCESS); /* keep compiler happy */ |