From owner-svn-src-all@freebsd.org Sat Apr 20 05:31:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7E871583D16; Sat, 20 Apr 2019 05:31:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 769F283B0A; Sat, 20 Apr 2019 05:31:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 506AC9923; Sat, 20 Apr 2019 05:31:57 +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 x3K5Vv3O015580; Sat, 20 Apr 2019 05:31:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3K5VuCb015576; Sat, 20 Apr 2019 05:31:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904200531.x3K5VuCb015576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Apr 2019 05:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346430 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 346430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 769F283B0A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2019 05:31:58 -0000 Author: imp Date: Sat Apr 20 05:31:56 2019 New Revision: 346430 URL: https://svnweb.freebsd.org/changeset/base/346430 Log: Start to reduce the number of #ifdef EFI_ZFS_BOOT There's a number of EFI_ZFS_BOOT #ifdefs that aren't needed, or can be eliminated with some trivial #defines. Remove the EFI_ZFS_BOOT ifdefs that aren't needed. Replace libzfs.h include which is not safe to include without EFI_ZFS_BOOT with efizfs.h which is and now conditionally included libzfs.h. Define efizfs_set_preferred away and define efi_zfs_probe to NULL when ZFS is compiled out. Modified: head/stand/efi/include/efizfs.h head/stand/efi/libefi/devicename.c head/stand/efi/loader/conf.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efizfs.h ============================================================================== --- head/stand/efi/include/efizfs.h Sat Apr 20 04:16:51 2019 (r346429) +++ head/stand/efi/include/efizfs.h Sat Apr 20 05:31:56 2019 (r346430) @@ -33,6 +33,8 @@ #define _EFIZFS_H_ #ifdef EFI_ZFS_BOOT +#include + typedef STAILQ_HEAD(zfsinfo_list, zfsinfo) zfsinfo_list_t; typedef struct zfsinfo @@ -50,6 +52,9 @@ bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *) zfsinfo_list_t *efizfs_get_zfsinfo_list(void); void efizfs_set_preferred(EFI_HANDLE); +#else +#define efizfs_set_preferred(x) +#define efi_zfs_probe NULL #endif #endif Modified: head/stand/efi/libefi/devicename.c ============================================================================== --- head/stand/efi/libefi/devicename.c Sat Apr 20 04:16:51 2019 (r346429) +++ head/stand/efi/libefi/devicename.c Sat Apr 20 05:31:56 2019 (r346430) @@ -34,12 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef EFI_ZFS_BOOT -#include -#endif #include #include +#include static int efi_parsedev(struct devdesc **, const char *, const char **); Modified: head/stand/efi/loader/conf.c ============================================================================== --- head/stand/efi/loader/conf.c Sat Apr 20 04:16:51 2019 (r346429) +++ head/stand/efi/loader/conf.c Sat Apr 20 05:31:56 2019 (r346430) @@ -31,9 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef EFI_ZFS_BOOT -#include -#endif +#include struct devsw *devsw[] = { &efipart_fddev, Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Sat Apr 20 04:16:51 2019 (r346429) +++ head/stand/efi/loader/main.c Sat Apr 20 05:31:56 2019 (r346430) @@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef EFI_ZFS_BOOT -#include #include "efizfs.h" -#endif #include "loader_efi.h" @@ -763,18 +760,14 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; -#ifdef EFI_ZFS_BOOT - /* Note this needs to be set before ZFS init. */ archsw.arch_zfs_probe = efi_zfs_probe; -#endif /* Get our loaded image protocol interface structure. */ BS->HandleProtocol(IH, &imgid, (VOID**)&img); -#ifdef EFI_ZFS_BOOT - /* Tell ZFS probe code where we booted from */ + /* Tell ZFS probe code where we booted from, if zfs configured */ efizfs_set_preferred(img->DeviceHandle); -#endif + /* Init the time source */ efi_time_init();