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
This commit is contained in:
Warner Losh 2017-09-07 07:30:14 +00:00
parent 1d21184075
commit 1028a2d4b3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323259
2 changed files with 8 additions and 0 deletions

View File

@ -2430,3 +2430,9 @@ efidp_format_device_path(char *buf, size_t len, const_efidp dp, ssize_t max)
return retval;
}
size_t
efidp_size(const_efidp dp)
{
return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp));
}

View File

@ -62,4 +62,6 @@ ssize_t efidp_format_device_path(char *buf, size_t len, const_efidp dp,
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_ */