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
{\r
EFI_STATUS Status;\r
EFI_PHYSICAL_ADDRESS Memory; \r
{\r
EFI_STATUS Status;\r
EFI_PHYSICAL_ADDRESS Memory; \r
- EFI_PEI_SERVICES **PeiServices;\r
\r
if (Pages == 0) {\r
return NULL;\r
}\r
\r
\r
if (Pages == 0) {\r
return NULL;\r
}\r
\r
- PeiServices = GetPeiServicesTablePointer ();\r
- Status = ((*PeiServices)->AllocatePages) (PeiServices, MemoryType, Pages, &Memory);\r
+ Status = PeiServicesAllocatePages (MemoryType, Pages, &Memory);\r
if (EFI_ERROR (Status)) {\r
Memory = 0;\r
}\r
if (EFI_ERROR (Status)) {\r
Memory = 0;\r
}\r
)\r
{\r
EFI_STATUS Status;\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_PEI_SERVICES **PeiServices;\r
- PeiServices = GetPeiServicesTablePointer ();\r
-\r
- Status = ((*PeiServices)->AllocatePool) (PeiServices, AllocationSize, &Buffer);\r
+ Status = PeiServicesAllocatePool (AllocationSize, &Buffer);\r
if (EFI_ERROR (Status)) {\r
Buffer = NULL;\r
}\r
if (EFI_ERROR (Status)) {\r
Buffer = NULL;\r
}\r