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