From c217506815e1a769ef9ac3ab6dbf3e68ba5f00e0 Mon Sep 17 00:00:00 2001 From: andrewfish Date: Fri, 24 Jun 2011 14:48:38 +0000 Subject: [InOSEmPkg] Add OS malloc and free to the Thunk. Added OS malloc and free so we can make MemoryAllocationLib instance that uses OS guard malloc. This will allow all the debug support built into the OS for finding malloc bugs to be used with a driver in the emulator. Signed-off-by: andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11883 6f19259b-4bc3-4df7-8a09-765794883524 --- InOsEmuPkg/Unix/Sec/EmuThunk.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'InOsEmuPkg/Unix/Sec/EmuThunk.c') diff --git a/InOsEmuPkg/Unix/Sec/EmuThunk.c b/InOsEmuPkg/Unix/Sec/EmuThunk.c index 97c339d241..50afbb5cd6 100644 --- a/InOsEmuPkg/Unix/Sec/EmuThunk.c +++ b/InOsEmuPkg/Unix/Sec/EmuThunk.c @@ -118,6 +118,23 @@ SecPollStdIn ( } +VOID * +SecMalloc ( + IN UINTN Size + ) +{ + return malloc ((size_t)Size); +} + +VOID +SecFree ( + IN VOID *Ptr + ) +{ + free (Ptr); + return; +} + void settimer_handler (int sig) @@ -370,6 +387,8 @@ EMU_THUNK_PROTOCOL gEmuThunkProtocol = { GasketSecWriteStdOut, GasketSecReadStdIn, GasketSecPollStdIn, + GasketSecMalloc, + GasketSecFree, GasketSecPeCoffGetEntryPoint, GasketSecPeCoffRelocateImageExtraAction, GasketSecPeCoffUnloadImageExtraAction, -- cgit v1.2.3