Date: Thu, 7 Sep 2017 07:30:15 +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: r323259 - head/lib/libefivar Message-ID: <201709070730.v877UFxI006968@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709070730.v877UFxI006968>