From owner-svn-src-head@freebsd.org Tue Sep 3 14:07:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DBDFDD664; Tue, 3 Sep 2019 14:07:12 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N80H5Xzrz4QLb; Tue, 3 Sep 2019 14:07:11 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7CE3C1B238; Tue, 3 Sep 2019 14:06:31 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 47E8C738E; Sat, 20 Apr 2019 05:32:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76F7583B18; Sat, 20 Apr 2019 05:32:01 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1DDAF7378; Sat, 20 Apr 2019 05:32:01 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EDFD57376 for ; 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 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 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 76F7583B18 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.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:07:34 -0000 X-Original-Date: Sat, 20 Apr 2019 05:31:56 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:07:34 -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();