1314926Simp$FreeBSD: stable/11/lib/libefivar/FreeBSD-update 318576 2017-05-20 16:12:44Z kib $
2314926Simp
3314926SimpFor the printing and parsing functionalit, we use the Tianocore routines directly.
4314926Simp
5314926Simpefivar-dp-format.c is a copy of MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
6314926Simpefivar-dp-parse.c is a copy of MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
7314926Simp
8314926SimpThese files are first mechnaically processed with
9314926Simp
10314926Simpsed -e "s/L'/'/;"'s/L"/"/g;s/%g/%36s/g;s/%a/%s/g;s/^VOID/static VOID/g;s/ *$//g'
11314926Simp
12314926Simpfor several reasons. We're moving from wide rotuines to narrow
13314926Simproutines. The UTC-2 this code is written for is a bad match for
14314926Simpwchar_t which is an int. It's a much better match for plain narrow
15314926Simpcharacters on FreeBSD. So we pretend that CHAR16 for these files is
16314926Simpreally char * (ASCII).
17314926Simp
18314926SimpNext, we have have to convert the Unicode printf that this code
19314926Simpexpects to FreeBSD's printf. %g means "Print the GUID" and %a means
20314926Simp"print the ASCII string." so we mechanically convert them. Once we've
21314926Simpdone that we can compare efivar-dp-*.c to its source to see what's
22314926Simpchanged. Because we go through this indirection, I've done that
23314926Simpoutside of svn. To upgrade you have to do these files by hand. You
24314926Simphave to go through and make routines static.
25314926Simp
26314926Simpuefi-*.[ch] are internal routines to support this. They've been copied
27314926Simpfrom EDK2 as well, but in a more hap-hazard manner. This was a trade
28314926Simpoff between ease of implementation / upgrade vs pulling in too much
29314926Simpsince less than half of any file was needed.
30314926Simp
31314926Simpefi-osdep.h shims the EDK2 types to FreeBSD's types. It's included by
32314926SimpProcessorBind.h which EDK2 uses to define the CPU. We keep it separate
33314926Simpfrom uefi-dplib.h to allow better sharing.
34314926Simp
35314926Simpuefi-dplib.h shims the EDK2 routines that are needed to FreeBSD's
36314926Simproutines. This is relatively easy since we map all the UCS-2 routines
37314926Simpto simple char * routines.
38314926Simp
39314926SimpRESIST THE URGE TO CLEAN UP THESE FILES.
40