diff options
author | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-20 21:58:05 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-20 21:58:05 +0000 |
commit | b8800fc547440d8648e49c189a60547bfc4a1615 (patch) | |
tree | 107dfd9ca56bb3d31a08a7428b96b15a1873d830 /InOsEmuPkg/Library | |
parent | 7af94c1d0af9b8595ef536c8a2f7ff930b54a43a (diff) | |
download | edk2-platforms-b8800fc547440d8648e49c189a60547bfc4a1615.tar.xz |
InOsEmuPkg/Unix/Sec: Add BaseMemoryLib implementation to thunk layer
This implementation only covers a few BaseMemoryLib functions.
The implementation leverates malloc/free in stdlib.
Signed-off-by: jljusten
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11866 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'InOsEmuPkg/Library')
-rw-r--r-- | InOsEmuPkg/Library/ThunkPpiList/ThunkPpiList.c | 12 | ||||
-rw-r--r-- | InOsEmuPkg/Library/ThunkProtocolList/ThunkProtocolList.c | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/InOsEmuPkg/Library/ThunkPpiList/ThunkPpiList.c b/InOsEmuPkg/Library/ThunkPpiList/ThunkPpiList.c index 3531b84bf5..3c2fd93e7f 100644 --- a/InOsEmuPkg/Library/ThunkPpiList/ThunkPpiList.c +++ b/InOsEmuPkg/Library/ThunkPpiList/ThunkPpiList.c @@ -2,6 +2,7 @@ Emulator Thunk to abstract OS services from pure EFI code
Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -15,8 +16,7 @@ #include <PiPei.h>
#include <Library/BaseLib.h>
-
-#include <stdlib.h>
+#include <Library/MemoryAllocationLib.h>
UINTN gThunkPpiListSize = 0;
@@ -51,8 +51,12 @@ AddThunkPpi ( )
{
UINTN Index;
-
- gThunkPpiList = realloc (gThunkPpiList, gThunkPpiListSize + sizeof (EFI_PEI_PPI_DESCRIPTOR));
+
+ gThunkPpiList = ReallocatePool (
+ gThunkPpiListSize,
+ gThunkPpiListSize + sizeof (EFI_PEI_PPI_DESCRIPTOR),
+ gThunkPpiList
+ );
if (gThunkPpiList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
diff --git a/InOsEmuPkg/Library/ThunkProtocolList/ThunkProtocolList.c b/InOsEmuPkg/Library/ThunkProtocolList/ThunkProtocolList.c index 3c53716765..5aed594b6e 100644 --- a/InOsEmuPkg/Library/ThunkProtocolList/ThunkProtocolList.c +++ b/InOsEmuPkg/Library/ThunkProtocolList/ThunkProtocolList.c @@ -2,6 +2,7 @@ Emulator Thunk to abstract OS services from pure EFI code
Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -17,11 +18,10 @@ #include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
#include <Protocol/EmuIoThunk.h>
-#include <stdlib.h>
-
#define EMU_IO_THUNK_PROTOCOL_DATA_SIGNATURE SIGNATURE_32('E','m','u','T')
@@ -53,7 +53,7 @@ AddThunkProtocol ( }
Instance = 0;
- StartString = malloc (StrSize (ConfigString));
+ StartString = AllocatePool (StrSize (ConfigString));
StrCpy (StartString, ConfigString);
while (*StartString != '\0') {
@@ -74,7 +74,7 @@ AddThunkProtocol ( SubString++;
}
- Private = malloc (sizeof (EMU_IO_THUNK_PROTOCOL_DATA));
+ Private = AllocatePool (sizeof (EMU_IO_THUNK_PROTOCOL_DATA));
if (Private == NULL) {
return EFI_OUT_OF_RESOURCES;
}
|