]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r336651-r336655: stand: libefi: various boot protocol aux impl.
authorkevans <kevans@FreeBSD.org>
Thu, 21 Feb 2019 02:37:01 +0000 (02:37 +0000)
committerkevans <kevans@FreeBSD.org>
Thu, 21 Feb 2019 02:37:01 +0000 (02:37 +0000)
commit80d3bfe098d90136d183fcd338c2c6a339f01d8e
tree6bfdc6f0b17f1c6c42c059f65697d5cb8ab7604f
parentf97e406c3f078e813bb32bf95a89a4b69cb1ed55
MFC r336651-r336655: stand: libefi: various boot protocol aux impl.

r336651:
Implement efi_devpath_to_media_path

Takes a generic device path as its input. Scans through it to find the
first media_path node in it and returns a pointer to it. If none is
found, NULL is returned.

r336652:
Store the number of handles we get back in efipart_nhandles rather
than the number of bytes. Don't divide by the element size every time
we have to iterate. Eliminate now-unused variables.

r336653:
Implement efi_devpath_match_node

Returns true if the first node pointed to by devpath1 is identical to
the first node pointed to by devpath2, with care taken to not read
past the end of the valid parts of either devpath1 or
devpath2. Otherwise, returns false.

r336654:
Implement efi_devpath_length

Return the total length, in bytes, of the device path (including the
terminating node at the end).

r336655:
Implement efiblk_get_pdinfo_by_device_path

Lookup a block device by it's device path. We use a 'loose' lookup
whereby we scan forward to the first Media Path portion of the device
path, then look at all our handles for one whose first Media Path
matches. This will also work if the device path pointed to has a
following file path (or paths) as that's ignored. It assumes that
there's only one media path node that describes the entire device,
which is true as of the latest UEFI spec (2.7 Errata A) as far as I've
been able to determine.
stand/efi/include/efilib.h
stand/efi/libefi/devpath.c
stand/efi/libefi/efipart.c