]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PeiServicesLib.h
MdePkg PeiServicesLib: Add PeiServicesFreePages
[mirror_edk2.git] / MdePkg / Include / Library / PeiServicesLib.h
index 2b51d374c9b4056e383bf2913049e408107f7ecc..9fc22a10c178b3bece98b16d9c668c37c3d8f306 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides library functions for all PEI Services.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -264,16 +264,16 @@ PeiServicesInstallPeiMemory (
   );\r
 \r
 /**\r
-  This service enables PEIMs to allocate memory after the permanent memory has been installed by a\r
-  PEIM.\r
+  This service enables PEIMs to allocate memory.\r
 \r
   @param  MemoryType            Type of memory to allocate.\r
-  @param  Pages                 Number of pages to allocate.\r
+  @param  Pages                 The number of pages to allocate.\r
   @param  Memory                Pointer of memory allocated.\r
 \r
   @retval EFI_SUCCESS           The memory range was successfully allocated.\r
-  @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.\r
-  @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.\r
+  @retval EFI_INVALID_PARAMETER Type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,\r
+                                EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,\r
+                                EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.\r
   @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.\r
 \r
 **/\r
@@ -285,6 +285,25 @@ PeiServicesAllocatePages (
   OUT EFI_PHYSICAL_ADDRESS      *Memory\r
   );\r
 \r
+/**\r
+  This service enables PEIMs to free memory.\r
+\r
+  @param Memory                 Memory to be freed.\r
+  @param Pages                  The number of pages to free.\r
+\r
+  @retval EFI_SUCCESS           The requested pages were freed.\r
+  @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.\r
+  @retval EFI_NOT_FOUND         The requested memory pages were not allocated with\r
+                                AllocatePages().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiServicesFreePages (\r
+  IN EFI_PHYSICAL_ADDRESS       Memory,\r
+  IN UINTN                      Pages\r
+  );\r
+\r
 /**\r
   This service allocates memory from the Hand-Off Block (HOB) heap.\r
 \r