Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Aug 2017 18:30:14 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322938 - in head/sys/boot/efi: boot1 libefi loader
Message-ID:  <201708261830.v7QIUEVX099842@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Aug 26 18:30:14 2017
New Revision: 322938
URL: https://svnweb.freebsd.org/changeset/base/322938

Log:
  Link in libefi for boot1
  
  Add libefi to the list of libraries we'll link in. Move EFI table
  definitions back to libefi so we don't have drift between the two
  efi_main routines.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/boot1/boot1.c
  head/sys/boot/efi/libefi/libefi.c
  head/sys/boot/efi/loader/efi_main.c

Modified: head/sys/boot/efi/boot1/Makefile
==============================================================================
--- head/sys/boot/efi/boot1/Makefile	Sat Aug 26 18:30:08 2017	(r322937)
+++ head/sys/boot/efi/boot1/Makefile	Sat Aug 26 18:30:14 2017	(r322938)
@@ -76,13 +76,15 @@ CFLAGS+=	-fPIC
 LDFLAGS+=	-Wl,-znocombreloc
 .endif
 
+LIBEFI=		${.OBJDIR}/../libefi/libefi.a
+
 #
 # Add libstand for the runtime functions used by the compiler - for example
 # __aeabi_* (arm) or __divdi3 (i386).
 # as well as required string and memory functions for all platforms.
 #
-DPADD+=		${LIBSTAND}
-LDADD+=		-lstand
+DPADD+=		${LIBEFI} ${LIBSTAND}
+LDADD+=		${LIBEFI} -lstand
 
 DPADD+=		${LDSCRIPT}
 

Modified: head/sys/boot/efi/boot1/boot1.c
==============================================================================
--- head/sys/boot/efi/boot1/boot1.c	Sat Aug 26 18:30:08 2017	(r322937)
+++ head/sys/boot/efi/boot1/boot1.c	Sat Aug 26 18:30:14 2017	(r322938)
@@ -47,11 +47,6 @@ static const boot_module_t *boot_modules[] =
 /* The initial number of handles used to query EFI for partitions. */
 #define NUM_HANDLES_INIT	24
 
-EFI_HANDLE		IH;
-EFI_SYSTEM_TABLE	*ST;
-EFI_BOOT_SERVICES	*BS;
-EFI_RUNTIME_SERVICES	*RS;
-
 static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL;
 static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
 static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL;

Modified: head/sys/boot/efi/libefi/libefi.c
==============================================================================
--- head/sys/boot/efi/libefi/libefi.c	Sat Aug 26 18:30:08 2017	(r322937)
+++ head/sys/boot/efi/libefi/libefi.c	Sat Aug 26 18:30:14 2017	(r322938)
@@ -32,7 +32,10 @@ __FBSDID("$FreeBSD$");
 #include <efilib.h>
 #include <stand.h>
 
-extern EFI_SYSTEM_TABLE *ST;
+EFI_HANDLE		IH;
+EFI_SYSTEM_TABLE	*ST;
+EFI_BOOT_SERVICES	*BS;
+EFI_RUNTIME_SERVICES	*RS;
 
 void *
 efi_get_table(EFI_GUID *tbl)

Modified: head/sys/boot/efi/loader/efi_main.c
==============================================================================
--- head/sys/boot/efi/loader/efi_main.c	Sat Aug 26 18:30:08 2017	(r322937)
+++ head/sys/boot/efi/loader/efi_main.c	Sat Aug 26 18:30:14 2017	(r322938)
@@ -32,11 +32,6 @@ __FBSDID("$FreeBSD$");
 #include <efilib.h>
 #include <stand.h>
 
-EFI_HANDLE		IH;
-EFI_SYSTEM_TABLE	*ST;
-EFI_BOOT_SERVICES	*BS;
-EFI_RUNTIME_SERVICES	*RS;
-
 static EFI_PHYSICAL_ADDRESS heap;
 static UINTN heapsize;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708261830.v7QIUEVX099842>