summaryrefslogtreecommitdiff
path: root/InOsEmuPkg/Unix/Sec/EmuThunk.c
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-24 14:48:38 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-24 14:48:38 +0000
commitc217506815e1a769ef9ac3ab6dbf3e68ba5f00e0 (patch)
treee3e6b53f66766445c59f75f1736e654aa827d874 /InOsEmuPkg/Unix/Sec/EmuThunk.c
parent54e0b04c74a1e55ccfd3b428415eb419b975de8b (diff)
downloadedk2-platforms-c217506815e1a769ef9ac3ab6dbf3e68ba5f00e0.tar.xz
[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
Diffstat (limited to 'InOsEmuPkg/Unix/Sec/EmuThunk.c')
-rw-r--r--InOsEmuPkg/Unix/Sec/EmuThunk.c19
1 files changed, 19 insertions, 0 deletions
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,