public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 1/5] MdePkg PiPeiCis.h: Add FreePages definition
Date: Sat, 19 Aug 2017 00:00:34 +0800	[thread overview]
Message-ID: <1503072038-134760-2-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1503072038-134760-1-git-send-email-star.zeng@intel.com>

Follow PI 1.6 spec to add FreePages definition and comments for
AllocatePages that will support pre permanent memory page allocation.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdePkg/Include/Pi/PiPeiCis.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/MdePkg/Include/Pi/PiPeiCis.h b/MdePkg/Include/Pi/PiPeiCis.h
index eda814a8701a..aebe3eacf442 100644
--- a/MdePkg/Include/Pi/PiPeiCis.h
+++ b/MdePkg/Include/Pi/PiPeiCis.h
@@ -452,6 +452,11 @@ EFI_STATUS
   The purpose of the service is to publish an interface that allows 
   PEIMs to allocate memory ranges that are managed by the PEI Foundation.
 
+  Prior to InstallPeiMemory() being called, PEI will allocate pages from the heap.
+  After InstallPeiMemory() is called, PEI will allocate pages within the region
+  of memory provided by InstallPeiMemory() service in a best-effort fashion.
+  Location-specific allocations are not managed by the PEI foundation code.
+
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
   @param  MemoryType       The type of memory to allocate.
   @param  Pages            The number of contiguous 4 KB pages to allocate.
@@ -475,6 +480,27 @@ EFI_STATUS
   );
 
 /**
+  Frees memory pages.
+
+  @param[in] PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
+  @param[in] Memory             The base physical address of the pages to be freed.
+  @param[in] Pages              The number of contiguous 4 KB pages to free.
+
+  @retval EFI_SUCCESS           The requested pages were freed.
+  @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
+  @retval EFI_NOT_FOUND         The requested memory pages were not allocated with
+                                AllocatePages().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FREE_PAGES) (
+  IN CONST EFI_PEI_SERVICES     **PeiServices,
+  IN EFI_PHYSICAL_ADDRESS       Memory,
+  IN UINTN                      Pages
+  );
+
+/**
   The purpose of this service is to publish an interface that 
   allows PEIMs to allocate memory ranges that are managed by the PEI Foundation.
 
@@ -929,6 +955,7 @@ struct _EFI_PEI_SERVICES {
   EFI_PEI_FFS_FIND_SECTION_DATA3  FindSectionData3;
   EFI_PEI_FFS_GET_FILE_INFO2      FfsGetFileInfo2;
   EFI_PEI_RESET2_SYSTEM           ResetSystem2;
+  EFI_PEI_FREE_PAGES              FreePages;
 };
 
 
-- 
2.7.0.windows.1



  reply	other threads:[~2017-08-18 15:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 16:00 [PATCH 0/5] PeiCore: Support pre memory page allocation Star Zeng
2017-08-18 16:00 ` Star Zeng [this message]
2017-08-18 16:00 ` [PATCH 2/5] MdePkg PeiServicesLib: Add PeiServicesFreePages Star Zeng
2017-08-18 16:00 ` [PATCH 3/5] MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages Star Zeng
2017-08-18 16:00 ` [PATCH 4/5] MdePkg PeiMemoryAllocationLib: Update InternalAllocateAlignedPages Star Zeng
2017-08-18 16:00 ` [PATCH 5/5] MdeModule PeiCore: Support pre memory page allocation Star Zeng
2017-08-23  7:53 ` [PATCH 0/5] " Gao, Liming
2017-08-23  7:55   ` Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503072038-134760-2-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox