From owner-svn-src-head@freebsd.org Sat Aug 26 18:30:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F042ADD80A1; Sat, 26 Aug 2017 18:30:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD88F74AC5; Sat, 26 Aug 2017 18:30:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QIUEt3099846; Sat, 26 Aug 2017 18:30:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QIUEVX099842; Sat, 26 Aug 2017 18:30:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261830.v7QIUEVX099842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:30:14 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 libefi loader X-SVN-Commit-Revision: 322938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Aug 2017 18:30:16 -0000 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 #include -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 #include -EFI_HANDLE IH; -EFI_SYSTEM_TABLE *ST; -EFI_BOOT_SERVICES *BS; -EFI_RUNTIME_SERVICES *RS; - static EFI_PHYSICAL_ADDRESS heap; static UINTN heapsize;