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_ */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to