The UEFI Platform Initialization Specification and the Unified Extensible
Firmware Interface (UEFI) Specification (respectively for PEI and DXE)
determine that the signature for these methods must have a VOID return value,
but in all cases fields of the given types are initialised from methods
matching the CopyMem and SetMem declarations in BaseMemoryLib.h, which
have a VOID * return value.
There is no guarantee that a function returning a pointer can be safely
called by a caller expecting it to return void, even if this works in
practice with the calling conventions used, so wrapper methods are more
correct.
Fixing this is required to be able to compile with cast-function-type-mismatch
warning enabled for Xcode and clang toolchains, but it is at least arguably
a genuine unwanted mismatch in any case.
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
This library supports a Boot Services table library implementation
that allows code dependent upon UefiBootServicesTableLib to operate
in an isolated execution environment such as within
the context of a host-based unit test framework.
The unit test should initialize the Boot Services database with any
required elements (e.g. protocols, events, handles, etc.) prior to
the services being invoked by code under test.
It is strongly recommended to clean any global databases (e.g.
protocol, event, handles, etc.) after every unit test so the tests
execute in a predictable manner from a clean state.
This library is being moved here from PrmPkg so it can be made more
generally available to other packages and improved upon for others
use.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>