]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Pi/PiPeiCis.h
MdePkg PiPeiCis.h: Add FreePages definition
[mirror_edk2.git] / MdePkg / Include / Pi / PiPeiCis.h
index eda814a8701a2001853682de970bcc72909ac0f9..aebe3eacf442e84eaff7774b531aa6420eaba9d4 100644 (file)
@@ -452,6 +452,11 @@ EFI_STATUS
   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
+  Prior to InstallPeiMemory() being called, PEI will allocate pages from the heap.\r
+  After InstallPeiMemory() is called, PEI will allocate pages within the region\r
+  of memory provided by InstallPeiMemory() service in a best-effort fashion.\r
+  Location-specific allocations are not managed by the PEI foundation code.\r
+\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
@@ -474,6 +479,27 @@ EFI_STATUS
   OUT EFI_PHYSICAL_ADDRESS      *Memory\r
   );\r
 \r
+/**\r
+  Frees memory pages.\r
+\r
+  @param[in] PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param[in] Memory             The base physical address of the pages to be freed.\r
+  @param[in] Pages              The number of contiguous 4 KB 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
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_FREE_PAGES) (\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
+  IN EFI_PHYSICAL_ADDRESS       Memory,\r
+  IN UINTN                      Pages\r
+  );\r
+\r
 /**\r
   The purpose of this service is to publish an interface that \r
   allows PEIMs to allocate memory ranges that are managed by the PEI Foundation.\r
@@ -929,6 +955,7 @@ struct _EFI_PEI_SERVICES {
   EFI_PEI_FFS_FIND_SECTION_DATA3  FindSectionData3;\r
   EFI_PEI_FFS_GET_FILE_INFO2      FfsGetFileInfo2;\r
   EFI_PEI_RESET2_SYSTEM           ResetSystem2;\r
+  EFI_PEI_FREE_PAGES              FreePages;\r
 };\r
 \r
 \r