mirror of https://github.com/acidanthera/audk.git
edk2/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c:
Merge from edk2\MdePkg\Library\PeiMemoryAllocationLib\MemoryAllocationLib.c to achieve better support for additional compilers. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5280 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
bd2d157b9d
commit
bfe03264cb
|
@ -43,14 +43,12 @@ InternalAllocatePages (
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PHYSICAL_ADDRESS Memory;
|
EFI_PHYSICAL_ADDRESS Memory;
|
||||||
EFI_PEI_SERVICES **PeiServices;
|
|
||||||
|
|
||||||
if (Pages == 0) {
|
if (Pages == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PeiServices = GetPeiServicesTablePointer ();
|
Status = PeiServicesAllocatePages (MemoryType, Pages, &Memory);
|
||||||
Status = ((*PeiServices)->AllocatePages) (PeiServices, MemoryType, Pages, &Memory);
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
Memory = 0;
|
Memory = 0;
|
||||||
}
|
}
|
||||||
|
@ -352,12 +350,9 @@ GlueAllocatePool (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PEI_SERVICES **PeiServices;
|
|
||||||
VOID *Buffer;
|
VOID *Buffer;
|
||||||
|
|
||||||
PeiServices = GetPeiServicesTablePointer ();
|
Status = PeiServicesAllocatePool (AllocationSize, &Buffer);
|
||||||
|
|
||||||
Status = ((*PeiServices)->AllocatePool) (PeiServices, AllocationSize, &Buffer);
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
Buffer = NULL;
|
Buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue