}\r
\r
/**\r
+ The purpose of the service is to publish an interface that allows \r
+ PEIMs to allocate memory ranges that are managed by the PEI Foundation.\r
\r
- Memory allocation service on permanent memory,\r
- not usable prior to the memory installation.\r
+ @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+ @param MemoryType The type of memory to allocate.\r
+ @param Pages The number of contiguous 4 KB pages to allocate.\r
+ @param Memory Pointer to a physical address. On output, the address is set to the base \r
+ of the page range that was allocated.\r
\r
-\r
- @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
- @param MemoryType Type of memory to allocate.\r
- @param Pages Number of pages to allocate.\r
- @param Memory Pointer of memory allocated.\r
-\r
- @retval EFI_SUCCESS The allocation was successful\r
- @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available\r
- @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement\r
- to allocate the number of pages.\r
+ @retval EFI_SUCCESS The memory range was successfully allocated.\r
+ @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
+ @retval EFI_INVALID_PARAMETER Type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode, \r
+ EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,\r
+ EfiACPIReclaimMemory, or EfiACPIMemoryNVS.\r
\r
**/\r
EFI_STATUS\r
EFI_PHYSICAL_ADDRESS *FreeMemoryBottom;\r
UINTN RemainingPages;\r
\r
+ if ((MemoryType != EfiLoaderCode) &&\r
+ (MemoryType != EfiLoaderData) &&\r
+ (MemoryType != EfiRuntimeServicesCode) &&\r
+ (MemoryType != EfiRuntimeServicesData) &&\r
+ (MemoryType != EfiBootServicesCode) &&\r
+ (MemoryType != EfiBootServicesData) &&\r
+ (MemoryType != EfiACPIReclaimMemory) &&\r
+ (MemoryType != EfiACPIMemoryNVS)) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
Hob.Raw = PrivateData->HobList.Raw;\r
\r