public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V1 0/2] Improve PeiInstallPeiMemory() description
@ 2019-11-19  7:11 Kubacki, Michael A
  2019-11-19  7:11 ` [PATCH V3 1/2] MdeModulePkg PeiCore: " Kubacki, Michael A
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kubacki, Michael A @ 2019-11-19  7:11 UTC (permalink / raw)
  To: devel; +Cc: Dandan Bi, Liming Gao, Michael D Kinney, Jian J Wang, Hao A Wu

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: Michael D Kinney <michael.d.kinney@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>

Michael Kubacki (2):
  MdeModulePkg PeiCore: Improve PeiInstallPeiMemory() description
  MdePkg PiPeiCis.h: Improve PeiInstallPeiMemory() description

 MdeModulePkg/Core/Pei/PeiMain.h               | 28 ++++++++++++++----
 MdePkg/Include/Pi/PiPeiCis.h                  | 26 +++++++++++++----
 MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 30 ++++++++++++++------
 3 files changed, 64 insertions(+), 20 deletions(-)

-- 
2.16.2.windows.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V3 1/2] MdeModulePkg PeiCore: Improve PeiInstallPeiMemory() description
  2019-11-19  7:11 [PATCH V1 0/2] Improve PeiInstallPeiMemory() description Kubacki, Michael A
@ 2019-11-19  7:11 ` Kubacki, Michael A
  2019-11-19  7:11 ` [PATCH V1 2/2] MdePkg PiPeiCis.h: " Kubacki, Michael A
  2019-11-19 14:14 ` [edk2-devel] [PATCH V1 0/2] " Liming Gao
  2 siblings, 0 replies; 4+ messages in thread
From: Kubacki, Michael A @ 2019-11-19  7:11 UTC (permalink / raw)
  To: devel; +Cc: Dandan Bi, Liming Gao, Jian J Wang, Hao A Wu

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>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
---

Notes:
    V3 Changes:
    1. Remove the change to PiPeiCis.h as it is moved to a separate
       patch.
    
    V2 Changes:
    1. Updated the status code return values to those defined in the
       function description in the PI specification, Vol 1 v1.7.
    2. Updated the EFI_PEI_INSTALL_PEI_MEMORY function description
       in PiPeiCis.h.

 MdeModulePkg/Core/Pei/PeiMain.h               | 28 ++++++++++++++----
 MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 30 ++++++++++++++------
 2 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index f2aa97c664..0d3d62dbbe 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -898,15 +898,31 @@ 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.
 
-  @return EFI_SUCCESS Always success.
+  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.
+
+  @retval EFI_SUCCESS           The region was successfully installed in a HOB or this service was successfully
+                                invoked earlier and no HOB modification will occur.
+  @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.
 
 **/
 EFI_STATUS
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index 706837890f..679ac20493 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,19 +55,31 @@ 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.
 
-  @return EFI_SUCCESS Always success.
+  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.
+
+  @retval EFI_SUCCESS           The region was successfully installed in a HOB or this service was successfully
+                                invoked earlier and no HOB modification will occur.
+  @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.
 
 **/
 EFI_STATUS
-- 
2.16.2.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V1 2/2] MdePkg PiPeiCis.h: Improve PeiInstallPeiMemory() description
  2019-11-19  7:11 [PATCH V1 0/2] Improve PeiInstallPeiMemory() description Kubacki, Michael A
  2019-11-19  7:11 ` [PATCH V3 1/2] MdeModulePkg PeiCore: " Kubacki, Michael A
@ 2019-11-19  7:11 ` Kubacki, Michael A
  2019-11-19 14:14 ` [edk2-devel] [PATCH V1 0/2] " Liming Gao
  2 siblings, 0 replies; 4+ messages in thread
From: Kubacki, Michael A @ 2019-11-19  7:11 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

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: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
---
 MdePkg/Include/Pi/PiPeiCis.h | 26 ++++++++++++++++----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/MdePkg/Include/Pi/PiPeiCis.h b/MdePkg/Include/Pi/PiPeiCis.h
index d9d4ed7d41..e8c48acb21 100644
--- a/MdePkg/Include/Pi/PiPeiCis.h
+++ b/MdePkg/Include/Pi/PiPeiCis.h
@@ -422,13 +422,29 @@ EFI_STATUS
   );
 
 /**
-  This function registers the found memory configuration with the PEI Foundation.
+  Registers the found memory configuration with the PEI Foundation.
 
-  @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
-  @param  MemoryBegin      The value of a region of installed memory.
-  @param  MemoryLength     The corresponding length of a region of installed memory.
+  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.
 
-  @retval EFI_SUCCESS           The region was successfully installed in a HOB.
+  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.
+
+  @retval EFI_SUCCESS           The region was successfully installed in a HOB or this service was successfully
+                                invoked earlier and no HOB modification will occur.
   @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
   @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.
 
-- 
2.16.2.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH V1 0/2] Improve PeiInstallPeiMemory() description
  2019-11-19  7:11 [PATCH V1 0/2] Improve PeiInstallPeiMemory() description Kubacki, Michael A
  2019-11-19  7:11 ` [PATCH V3 1/2] MdeModulePkg PeiCore: " Kubacki, Michael A
  2019-11-19  7:11 ` [PATCH V1 2/2] MdePkg PiPeiCis.h: " Kubacki, Michael A
@ 2019-11-19 14:14 ` Liming Gao
  2 siblings, 0 replies; 4+ messages in thread
From: Liming Gao @ 2019-11-19 14:14 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kubacki, Michael A
  Cc: Bi, Dandan, Kinney, Michael D, Wang, Jian J, Wu, Hao A

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Kubacki, Michael A
> Sent: Tuesday, November 19, 2019 3:12 PM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Wang,
> Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>
> Subject: [edk2-devel] [PATCH V1 0/2] Improve PeiInstallPeiMemory() description
> 
> 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: Michael D Kinney <michael.d.kinney@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>
> 
> Michael Kubacki (2):
>   MdeModulePkg PeiCore: Improve PeiInstallPeiMemory() description
>   MdePkg PiPeiCis.h: Improve PeiInstallPeiMemory() description
> 
>  MdeModulePkg/Core/Pei/PeiMain.h               | 28 ++++++++++++++----
>  MdePkg/Include/Pi/PiPeiCis.h                  | 26 +++++++++++++----
>  MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 30 ++++++++++++++------
>  3 files changed, 64 insertions(+), 20 deletions(-)
> 
> --
> 2.16.2.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-19 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-19  7:11 [PATCH V1 0/2] Improve PeiInstallPeiMemory() description Kubacki, Michael A
2019-11-19  7:11 ` [PATCH V3 1/2] MdeModulePkg PeiCore: " Kubacki, Michael A
2019-11-19  7:11 ` [PATCH V1 2/2] MdePkg PiPeiCis.h: " Kubacki, Michael A
2019-11-19 14:14 ` [edk2-devel] [PATCH V1 0/2] " Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox