From owner-svn-src-head@freebsd.org Thu Sep 7 07:30:16 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 C0249E0DAFD; Thu, 7 Sep 2017 07:30:16 +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 5D2EC6351B; Thu, 7 Sep 2017 07:30:16 +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 v877UFra006970; Thu, 7 Sep 2017 07:30:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v877UFxI006968; Thu, 7 Sep 2017 07:30:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709070730.v877UFxI006968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Sep 2017 07:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323259 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 323259 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: Thu, 07 Sep 2017 07:30:17 -0000 Author: imp Date: Thu Sep 7 07:30:14 2017 New Revision: 323259 URL: https://svnweb.freebsd.org/changeset/base/323259 Log: Implement efidp_size efidp_size will return the size, in bytes, of a EFI device path structure. This is a convenience wrapper in the same style as the other linux routines. It's implemented by GetDevicePathSize from EDK2 we already needed for other things. Sponsored by: Netflix Modified: head/lib/libefivar/efivar-dp-format.c head/lib/libefivar/efivar-dp.h Modified: head/lib/libefivar/efivar-dp-format.c ============================================================================== --- head/lib/libefivar/efivar-dp-format.c Thu Sep 7 07:30:05 2017 (r323258) +++ head/lib/libefivar/efivar-dp-format.c Thu Sep 7 07:30:14 2017 (r323259) @@ -2430,3 +2430,9 @@ efidp_format_device_path(char *buf, size_t len, const_ return retval; } + +size_t +efidp_size(const_efidp dp) +{ + return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp)); +} Modified: head/lib/libefivar/efivar-dp.h ============================================================================== --- head/lib/libefivar/efivar-dp.h Thu Sep 7 07:30:05 2017 (r323258) +++ head/lib/libefivar/efivar-dp.h Thu Sep 7 07:30:14 2017 (r323259) @@ -62,4 +62,6 @@ ssize_t efidp_format_device_path(char *buf, size_t len ssize_t max); ssize_t efidp_parse_device_path(char *path, efidp out, size_t max); +size_t efidp_size(const_efidp); + #endif /* _EFIVAR_DP_H_ */