]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libefivar/FreeBSD-update
Merge commit '2f8d4418415511460bd7b3b3e532f6b328cf993f'
[FreeBSD/FreeBSD.git] / lib / libefivar / FreeBSD-update
1 For the printing and parsing functionality, we use the Tianocore routines
2 directly.
3
4 efivar-dp-format.c is a copy of MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
5 efivar-dp-parse.c is a copy of MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
6
7 These files are first mechnaically processed with
8
9 sed -e "s/L'/'/;"'s/L"/"/g;s/%g/%36s/g;s/%a/%s/g;s/^VOID/static VOID/g;s/ *$//g'
10
11 for several reasons. We're moving from wide rotuines to narrow routines. The
12 UTC-2 this code is written for is a bad match for wchar_t which is an int. It's
13 a much better match for plain narrow characters on FreeBSD. So we pretend that
14 CHAR16 for these files is really char * (ASCII).
15
16 Next, we have have to convert the Unicode printf that this code expects to
17 FreeBSD's printf. %g means "Print the GUID" and %a means "print the ASCII
18 string." so we mechanically convert them. Once we've done that we can compare
19 efivar-dp-*.c to its source to see what's changed. Because we go through this
20 indirection, I've done that outside of git. To upgrade you have to do these
21 files by hand. You have to go through and make routines static.
22
23 uefi-*.[ch] are internal routines to support this. They've been copied from EDK2
24 as well, but in a more hap-hazard manner. This was a trade off between ease of
25 implementation / upgrade vs pulling in too much since less than half of any file
26 was needed.
27
28 efi-osdep.h shims the EDK2 types to FreeBSD's types. It's included by
29 ProcessorBind.h which EDK2 uses to define the CPU. We keep it separate from
30 uefi-dplib.h to allow better sharing.
31
32 uefi-dplib.h shims the EDK2 routines that are needed to FreeBSD's routines. This
33 is relatively easy since we map all the UCS-2 routines to simple char *
34 routines.
35
36 RESIST THE URGE TO CLEAN UP THESE FILES. Except when such cleanups help with the
37 goal of keeping them in sync with EDK2.