Page MenuHomeFreeBSD

Three commits for routines to convert text to EFI_DEVICE_PATH
ClosedPublic

Authored by imp on Apr 19 2019, 7:18 PM.
Tags
None
Referenced Files
F82681243: D19971.diff
Wed, May 1, 2:20 PM
Unknown Object (File)
Feb 23 2024, 6:56 PM
Unknown Object (File)
Feb 23 2024, 6:56 PM
Unknown Object (File)
Feb 23 2024, 6:56 PM
Unknown Object (File)
Feb 23 2024, 2:26 PM
Unknown Object (File)
Dec 31 2023, 3:34 PM
Unknown Object (File)
Dec 20 2023, 2:53 AM
Unknown Object (File)
Nov 8 2023, 12:09 PM
Subscribers

Details

Summary

Add define for CONST.

Newer interfaces take CONST parameters, so define CONST to minimize
differences between our headers and the standards docs.

Add UEFI definitions related to converting string to DEVICE_PATH

Add definitions from UEFI 2.7 Errata B standards doc for converting a
text string to a device path. Added clearly missing 'e' at the end of
Device to resolve mismatch in that document in
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL element names.

Add wrapper functions to convert strings to EFI_DEVICE_PATH

In anticipation of new functionality, creae routines to convert char *
and a CHAR16 * to a EFI_DEVICE_PATH
EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path);
void efi_devpath_free(EFI_DEVICE_PATH *dp);
The first two return an EFI_DEVICE_PATH for the passed in paths. The
third frees up the storage the first two return when the caller is
done with it.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23773
Build 22721: arc lint + arc unit

Event Timeline

jhb added a subscriber: jhb.
jhb added inline comments.
stand/efi/include/efidevp.h
473

Extra blank line?

stand/efi/libefi/devpath.c
73

Compared to the previous version this calls BS->LocateProtocol repeatedly if it doesn't exist.

126

Maybe 'devpath' instead of 'dp' to match the style of other routines in this file? I would be tempted to use 'devpath' instead of 'rv' in the other two routines as well.

This revision is now accepted and ready to land.Apr 19 2019, 7:23 PM
stand/efi/libefi/devpath.c
73

Yes. But it does allow us to share toTextProtocol if we implement a wrapper around ConvertDeviceNodeToText and share it. And the optimization isn't a big win...

126

Hmmm, everywhere else in the code not in this file we have it's dp, but I'll change it

This revision was automatically updated to reflect the committed changes.
stand/efi/libefi/devpath.c
73

You could always use the 'once' thing in a helper routine which is 'find the 'toTextProtocol'' for example. It mostly does not matter. I'm not sure what systems wouldn't have this protocol anyway.