PC-BSD/trueos 4c74867stand/efi/boot1 ufs_module.c, stand/efi/include efidevp.h efilib.h

MFC r346345-r346346, r346353, r346407-r346409, r346430, r346573, r346575

r346345:
Add a more generic efi_setenv function.

efi_setenv allows any UEFI variable to be set.

r346346:
Add efi_delenv

Add an interface to remove / delete UEFI variables.

r346353:
Minor tweak to the debug

Make it clear we're loading from UFS.

r346407:
Add define for CONST.

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

r346408:
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.

r346409:
Add wrapper functions to convert strings to EFI_DEVICE_PATH

In anticipation of new functionality, create 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.

r346430:
Start to reduce the number of #ifdef EFI_ZFS_BOOT

There's a number of EFI_ZFS_BOOT #ifdefs that aren't needed, or can be
eliminated with some trivial #defines. Remove the EFI_ZFS_BOOT ifdefs
that aren't needed. Replace libzfs.h include which is not safe to
include without EFI_ZFS_BOOT with efizfs.h which is and now
conditionally included libzfs.h. Define efizfs_set_preferred away
and define efi_zfs_probe to NULL when ZFS is compiled out.

r346573:
Move setting of console earlier in boot.

There's no reason we can't setup the console first thing after the
arch flags are setup. We set it undconditionally to efi. This is a
good default, and will get us error messages to at least the efi
console no matter what. This will also prime the pump so that as other
variables are set, they will take effect and the console will be
correct as soon as those env vars are set. Also remove the redundant
setting of the console to efi when we know the console is efi.

r346575:
Create boot_img as a global variable

Get the information from the image that we're booting and store it in
a global variable. Prefer using this to passing it around. Remove the
special case for zfs that set the preferred boot handle by having it
uses this global variable diretly.
DeltaFile
+26-32stand/efi/loader/main.c
+49-8stand/efi/libefi/devpath.c
+37-0stand/efi/libefi/efienv.c
+20-0stand/efi/include/efidevp.h
+1-9stand/efi/libefi/efizfs.c
+5-0stand/efi/include/efilib.h
+4-1stand/efi/include/efizfs.h
+5-0stand/efi/include/efi.h
+1-3stand/efi/libefi/devicename.c
+1-3stand/efi/loader/conf.c
+1-1stand/efi/boot1/ufs_module.c
+1-0stand/efi/include/efidef.h
+151-5712 files

UnifiedSplitRaw