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