public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kubacki, Michael A" <michael.a.kubacki@intel.com>
To: devel@edk2.groups.io
Cc: Dandan Bi <dandan.bi@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Hao A Wu <hao.a.wu@intel.com>
Subject: [PATCH V1 1/1] MdeModulePkg PeiCore: Improve PeiInstallPeiMemory() description
Date: Sun, 17 Nov 2019 23:21:03 -0800	[thread overview]
Message-ID: <20191118072103.2436-1-michael.a.kubacki@intel.com> (raw)

Updates the function description for PeiInstallPeiMemory () to be
more helpful. The description is based on that given in the PI
Specification Version 1.7.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
---
 MdeModulePkg/Core/Pei/PeiMain.h               | 23 ++++++++++++++----
 MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 25 +++++++++++++-------
 2 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index f2aa97c664..14dfb20d05 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -898,13 +898,26 @@ InitializeMemoryServices (
   );
 
 /**
+  Registers the found memory configuration with the PEI Foundation.
 
-  Install the permanent memory is now available.
-  Creates HOB (PHIT and Stack).
+  This service enables PEIMs to register the permanent memory configuration that has been initialized
+  with the PEI Foundation. The result of this call-set is the creation of the appropriate Hand-Off Block
+  (HOB) describing the physical memory.
 
-  @param PeiServices     An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
-  @param MemoryBegin     Start of memory address.
-  @param MemoryLength    Length of memory.
+  The usage model is that the PEIM that discovers the permanent memory shall invoke this service.
+  This routine will store discovered memory information in the PeiCore's private data, and set the
+  SwitchStackSignal flag. After the PEIM who discovered memory is dispatched, the PeiDispatcher will
+  migrate temporary memory to permanent memory.
+
+  The memory reported is a single contiguous run. It should be enough to allocate a PEI stack and
+  some HOB list. The full memory map will be reported using the appropriate memory HOBs. The
+  PEI Foundation will follow up with an installation of EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI.
+
+  Any invocations of this service after the first invocation which returns EFI_SUCCESS will be ignored.
+
+  @param[in] PeiServices     An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
+  @param[in] MemoryBegin     Start of memory address.
+  @param[in] MemoryLength    Length of memory.
 
   @return EFI_SUCCESS Always success.
 
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index 706837890f..b6ac876145 100644
--- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
+++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
@@ -1,7 +1,7 @@
 /** @file
   EFI PEI Core memory services
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -55,17 +55,26 @@ InitializeMemoryServices (
 }
 
 /**
+  Registers the found memory configuration with the PEI Foundation.
 
-  This function registers the found memory configuration with the PEI Foundation.
+  This service enables PEIMs to register the permanent memory configuration that has been initialized
+  with the PEI Foundation. The result of this call-set is the creation of the appropriate Hand-Off Block
+  (HOB) describing the physical memory.
 
   The usage model is that the PEIM that discovers the permanent memory shall invoke this service.
-  This routine will hold discoveried memory information into PeiCore's private data,
-  and set SwitchStackSignal flag. After PEIM who discovery memory is dispatched,
-  PeiDispatcher will migrate temporary memory to permenement memory.
+  This routine will store discovered memory information in the PeiCore's private data, and set the
+  SwitchStackSignal flag. After the PEIM who discovered memory is dispatched, the PeiDispatcher will
+  migrate temporary memory to permanent memory.
 
-  @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
-  @param MemoryBegin        Start of memory address.
-  @param MemoryLength       Length of memory.
+  The memory reported is a single contiguous run. It should be enough to allocate a PEI stack and
+  some HOB list. The full memory map will be reported using the appropriate memory HOBs. The
+  PEI Foundation will follow up with an installation of EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI.
+
+  Any invocations of this service after the first invocation which returns EFI_SUCCESS will be ignored.
+
+  @param[in] PeiServices     An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
+  @param[in] MemoryBegin     Start of memory address.
+  @param[in] MemoryLength    Length of memory.
 
   @return EFI_SUCCESS Always success.
 
-- 
2.16.2.windows.1


             reply	other threads:[~2019-11-18  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18  7:21 Kubacki, Michael A [this message]
2019-11-18 15:11 ` [edk2-devel] [PATCH V1 1/1] MdeModulePkg PeiCore: Improve PeiInstallPeiMemory() description Wang, Jian J
2019-11-19  1:54 ` Liming Gao
2019-11-19  3:10   ` Kubacki, Michael A

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=20191118072103.2436-1-michael.a.kubacki@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