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 3/5] MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages
Date: Sat, 19 Aug 2017 00:00:36 +0800	[thread overview]
Message-ID: <1503072038-134760-4-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1503072038-134760-1-git-send-email-star.zeng@intel.com>

Update Free(Aligned)Pages to use PeiServicesFreePages.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 .../Library/PeiMemoryAllocationLib/MemoryAllocationLib.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
index a6cce6c23550..37273dde561a 100644
--- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
@@ -2,7 +2,7 @@
   Support routines for memory allocation routines 
   based on PeiService for PEI phase drivers.
 
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials                          
   are licensed and made available under the terms and conditions of the BSD License         
   which accompanies this distribution.  The full text of the license may be found at        
@@ -148,10 +148,11 @@ FreePages (
   IN UINTN  Pages
   )
 {
+  EFI_STATUS  Status;
+
   ASSERT (Pages != 0);
-  //
-  // PEI phase does not support to free pages, so leave it as NOP.
-  //
+  Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
+  ASSERT_EFI_ERROR (Status);
 }
 
 /**
@@ -444,10 +445,11 @@ FreeAlignedPages (
   IN UINTN  Pages
   )
 {
+  EFI_STATUS  Status;
+
   ASSERT (Pages != 0);
-  //
-  // PEI phase does not support to free pages, so leave it as NOP.
-  //
+  Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
+  ASSERT_EFI_ERROR (Status);
 }
 
 /**
-- 
2.7.0.windows.1



  parent 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 ` [PATCH 1/5] MdePkg PiPeiCis.h: Add FreePages definition Star Zeng
2017-08-18 16:00 ` [PATCH 2/5] MdePkg PeiServicesLib: Add PeiServicesFreePages Star Zeng
2017-08-18 16:00 ` Star Zeng [this message]
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-4-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