public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2 0/6] MdeModulePkg: Transfer reset data
@ 2019-05-08  4:49 Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition Gao, Zhichao
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao, Sean Brogan,
	Michael Turner, Bret Barkelew

Indicate two guids gCapsuleArmedResetGuid and gCapsuleUpdateCompleteResetGuid
for capsule update. And define a struct which start with a null string and
followed by a EFI_GUID.

V2:
Add prefix Edkii to the new guids.
Move the new struct definition to ResetSystemLib.h.
Fix the wrong reset data to transfer.
Fix the comment of EfiResetSystem in RuntimeLib base on UEFI spec 2.8.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>

Bret Barkelew (2):
  MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data
  MdeModulePkg/CapsuleLib: Transfer reset data

Zhichao Gao (4):
  MdeModulePkg/ResetSystemLib.h: Add useful reset data definition
  MdeModulePkg/ResetUtilityLib: Replace the reset data difinition
  MdePkg/UefiRuntimeLib.h: Change the comment
  MdePkg/UefiRuntimeLib: Change the comment

 MdeModulePkg/Include/Library/ResetSystemLib.h |  9 +++++++
 .../DxeCapsuleLibFmp/DxeCapsuleLib.inf        |  4 +++-
 .../DxeCapsuleLibFmp/DxeCapsuleProcessLib.c   | 12 ++++++++--
 .../Library/ResetUtilityLib/ResetUtility.c    | 15 +++---------
 .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf   |  2 ++
 .../CapsuleRuntimeDxe/CapsuleService.c        | 24 ++++++++++++-------
 .../CapsuleRuntimeDxe/CapsuleService.h        |  3 ++-
 MdePkg/Include/Library/UefiRuntimeLib.h       |  8 +++----
 MdePkg/Library/UefiRuntimeLib/RuntimeLib.c    |  8 +++----
 9 files changed, 52 insertions(+), 33 deletions(-)

-- 
2.21.0.windows.1


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

* [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition
  2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
@ 2019-05-08  4:49 ` Gao, Zhichao
  2019-05-08  8:50   ` Laszlo Ersek
  2019-05-08  4:49 ` [PATCH V2 2/6] MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data Gao, Zhichao
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao, Sean Brogan,
	Michael Turner, Bret Barkelew, Laszlo Ersek

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

Add a useful definition of reset data which start with a NULL
string and followed by a EFI_GUID.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 MdeModulePkg/Include/Library/ResetSystemLib.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MdeModulePkg/Include/Library/ResetSystemLib.h b/MdeModulePkg/Include/Library/ResetSystemLib.h
index 3b2a098a60..e39e8c748c 100644
--- a/MdeModulePkg/Include/Library/ResetSystemLib.h
+++ b/MdeModulePkg/Include/Library/ResetSystemLib.h
@@ -13,6 +13,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Uefi/UefiBaseType.h>
 #include <Uefi/UefiMultiPhase.h>
 
+#pragma pack(1)
+typedef struct {
+  CHAR16      NullString;
+  EFI_GUID    ResetGuid;
+} RESET_DATA_WITH_NULL_STRING;
+#pragma pack()
+
+VERIFY_SIZE_OF (RESET_DATA_WITH_NULL_STRING, 18);
+
 /**
   This function causes a system-wide reset (cold reset), in which
   all circuitry within the system returns to its initial state. This type of reset
-- 
2.21.0.windows.1


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

* [PATCH V2 2/6] MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data
  2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition Gao, Zhichao
@ 2019-05-08  4:49 ` Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 3/6] MdeModulePkg/CapsuleLib: " Gao, Zhichao
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel
  Cc: Bret Barkelew, Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao,
	Sean Brogan, Michael Turner

From: Bret Barkelew <Bret.Barkelew@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

Transfer reset data start with a null sting and followed by
gEdkiiCapsuleArmedResetGuid for capsule update.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf   |  2 ++
 .../CapsuleRuntimeDxe/CapsuleService.c        | 24 ++++++++++++-------
 .../CapsuleRuntimeDxe/CapsuleService.h        |  3 ++-
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
index 338577e293..43d295f5cf 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
@@ -62,6 +62,7 @@
   PrintLib
   BaseMemoryLib
   CacheMaintenanceLib
+  ResetSystemLib
 
 [LibraryClasses.X64]
   UefiLib
@@ -72,6 +73,7 @@
   ## SOMETIMES_PRODUCES   ## Variable:L"CapsuleLongModeBuffer" # The long mode buffer used by IA32 Capsule PEIM to call X64 CapsuleCoalesce code to handle >4GB capsule blocks
   gEfiCapsuleVendorGuid
   gEfiFmpCapsuleGuid                            ## SOMETIMES_CONSUMES   ## GUID # FMP capsule GUID
+  gEdkiiCapsuleArmedResetGuid                   ## SOMETIMES_CONSUMES
 
 [Protocols]
   gEfiCapsuleArchProtocolGuid                   ## PRODUCES
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index aaf819c4c6..77cfe11e00 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify
   the capsule runtime services are ready.
 
-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
 
 **/
@@ -63,13 +63,14 @@ UpdateCapsule (
   IN EFI_PHYSICAL_ADDRESS    ScatterGatherList OPTIONAL
   )
 {
-  UINTN                     ArrayNumber;
-  EFI_STATUS                Status;
-  EFI_CAPSULE_HEADER        *CapsuleHeader;
-  BOOLEAN                   NeedReset;
-  BOOLEAN                   InitiateReset;
-  CHAR16                    CapsuleVarName[30];
-  CHAR16                    *TempVarName;
+  UINTN                         ArrayNumber;
+  EFI_STATUS                    Status;
+  EFI_CAPSULE_HEADER            *CapsuleHeader;
+  BOOLEAN                       NeedReset;
+  BOOLEAN                       InitiateReset;
+  CHAR16                        CapsuleVarName[30];
+  CHAR16                        *TempVarName;
+  RESET_DATA_WITH_NULL_STRING   ResetData;
 
   //
   // Capsule Count can't be less than one.
@@ -210,7 +211,12 @@ UpdateCapsule (
        // will initiate a reset of the platform which is compatible with the passed-in capsule request and will
        // not return back to the caller.
        //
-       EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+       ResetData.NullString = CHAR_NULL;
+       CopyGuid (
+          (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_DATA_WITH_NULL_STRING, ResetGuid)),
+          &gEdkiiCapsuleArmedResetGuid
+          );
+       EfiResetSystem (EfiResetWarm, EFI_SUCCESS, sizeof (RESET_DATA_WITH_NULL_STRING), &ResetData);
      }
   }
   return Status;
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h
index 069df3c750..6790810cf4 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify
   the capsule runtime services are ready.
 
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -30,6 +30,7 @@
 #include <Library/BaseLib.h>
 #include <Library/PrintLib.h>
 #include <Library/BaseMemoryLib.h>
+#include <Library/ResetSystemLib.h>
 
 /**
   Create the variable to save the base address of page table and stack
-- 
2.21.0.windows.1


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

* [PATCH V2 3/6] MdeModulePkg/CapsuleLib: Transfer reset data
  2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 2/6] MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data Gao, Zhichao
@ 2019-05-08  4:49 ` Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 4/6] MdeModulePkg/ResetUtilityLib: Replace the reset data difinition Gao, Zhichao
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel
  Cc: Bret Barkelew, Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao,
	Sean Brogan, Michael Turner

From: Bret Barkelew <Bret.Barkelew@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

Transfer reset data start with a null sting and followed by
gEdkiiCapsuleUpdateCompleteResetGuid for capsule update.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf       |  4 +++-
 .../Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c  | 12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf
index 14c3d19bc3..0ad9b2827b 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf
@@ -3,7 +3,7 @@
 #
 #  Capsule library instance for DXE_DRIVER module types.
 #
-#  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -47,6 +47,7 @@
   HobLib
   BmpSupportLib
   DisplayUpdateProgressLib
+  ResetSystemLib
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax                               ## CONSUMES
@@ -74,6 +75,7 @@
   gEfiCapsuleReportGuid
   gEfiCapsuleVendorGuid                   ## SOMETIMES_CONSUMES ## Variable:L"CapsuleUpdateData"
   gEfiEndOfDxeEventGroupGuid              ## CONSUMES ## Event
+  gEdkiiCapsuleUpdateCompleteResetGuid    ## SOMETIMES_CONSUMES
 
 [Depex]
   gEfiVariableWriteArchProtocolGuid
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c
index 5e2d2b87a8..5fb3a9af32 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c
@@ -9,7 +9,7 @@
   ProcessCapsules(), ProcessTheseCapsules() will receive untrusted
   input and do basic validation.
 
-  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -30,6 +30,7 @@
 #include <Library/ReportStatusCodeLib.h>
 #include <Library/CapsuleLib.h>
 #include <Library/DisplayUpdateProgressLib.h>
+#include <Library/ResetSystemLib.h>
 
 #include <IndustryStandard/WindowsUxCapsule.h>
 
@@ -514,11 +515,18 @@ DoResetSystem (
   VOID
   )
 {
+  RESET_DATA_WITH_NULL_STRING   ResetData;
+
   DEBUG((DEBUG_INFO, "Capsule Request Cold Reboot."));
 
   REPORT_STATUS_CODE(EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeResettingSystem)));
 
-  gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
+  ResetData.NullString = CHAR_NULL;
+  CopyGuid (
+    (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_DATA_WITH_NULL_STRING, ResetGuid)),
+    &gEdkiiCapsuleUpdateCompleteResetGuid
+    );
+  gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, sizeof (RESET_DATA_WITH_NULL_STRING), &ResetData);
 
   CpuDeadLoop();
 }
-- 
2.21.0.windows.1


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

* [PATCH V2 4/6] MdeModulePkg/ResetUtilityLib: Replace the reset data difinition
  2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
                   ` (2 preceding siblings ...)
  2019-05-08  4:49 ` [PATCH V2 3/6] MdeModulePkg/CapsuleLib: " Gao, Zhichao
@ 2019-05-08  4:49 ` Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 5/6] MdePkg/UefiRuntimeLib.h: Change the comment Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 6/6] MdePkg/UefiRuntimeLib: " Gao, Zhichao
  5 siblings, 0 replies; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao, Sean Brogan,
	Michael Turner, Bret Barkelew

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

Replace the definition of 'RESET_UTILITY_GUID_SPECIFIC_RESET_DATA'
with 'RESET_DATA_WITH_NULL_STRING'.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../Library/ResetUtilityLib/ResetUtility.c        | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
index 2b5af4b95a..1bf8a694fb 100644
--- a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
+++ b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
@@ -13,15 +13,6 @@
 #include <Library/BaseMemoryLib.h>
 #include <Library/ResetSystemLib.h>
 
-#pragma pack(1)
-typedef struct {
-  CHAR16 NullTerminator;
-  GUID   ResetSubtype;
-} RESET_UTILITY_GUID_SPECIFIC_RESET_DATA;
-#pragma pack()
-
-VERIFY_SIZE_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, 18);
-
 /**
   This is a shorthand helper function to reset with reset type and a subtype
   so that the caller doesn't have to bother with a function that has half
@@ -46,11 +37,11 @@ ResetSystemWithSubtype (
   IN CONST  GUID        *ResetSubtype
   )
 {
-  RESET_UTILITY_GUID_SPECIFIC_RESET_DATA  ResetData;
+  RESET_DATA_WITH_NULL_STRING   ResetData;
 
-  ResetData.NullTerminator = CHAR_NULL;
+  ResetData.NullString = CHAR_NULL;
   CopyGuid (
-    (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, ResetSubtype)),
+    (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_DATA_WITH_NULL_STRING, ResetGuid)),
     ResetSubtype
     );
 
-- 
2.21.0.windows.1


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

* [PATCH V2 5/6] MdePkg/UefiRuntimeLib.h: Change the comment
  2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
                   ` (3 preceding siblings ...)
  2019-05-08  4:49 ` [PATCH V2 4/6] MdeModulePkg/ResetUtilityLib: Replace the reset data difinition Gao, Zhichao
@ 2019-05-08  4:49 ` Gao, Zhichao
  2019-05-08  4:49 ` [PATCH V2 6/6] MdePkg/UefiRuntimeLib: " Gao, Zhichao
  5 siblings, 0 replies; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

Change the comment of EfiResetSystem base on the
UEFI spec 2.8

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 MdePkg/Include/Library/UefiRuntimeLib.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/Library/UefiRuntimeLib.h b/MdePkg/Include/Library/UefiRuntimeLib.h
index 8f13ca275d..3962347d36 100644
--- a/MdePkg/Include/Library/UefiRuntimeLib.h
+++ b/MdePkg/Include/Library/UefiRuntimeLib.h
@@ -321,10 +321,10 @@ EfiGetNextHighMonotonicCount (
   @param  DataSizeThe size, in bytes, of ResetData.
   @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown the data buffer starts with a
                       Null-terminated Unicode string, optionally followed by additional binary data. The string is a
-                      description that the caller may use to further indicate the reason for the system reset. ResetData
-                      is only valid if ResetStatus is something other then EFI_SUCCESS. This pointer must be a physical
-                      address. For a ResetType of EfiResetPlatformSpecific the data buffer also starts with a Null-terminated
-                      string that is followed by an EFI_GUID that describes the specific type of reset to perform.
+                      description that the caller may use to further indicate the reason for the system reset. This
+                      pointer must be a physical address. For a ResetType of EfiResetPlatformSpecific the data buffer
+                      also starts with a Null-terminated string that is followed by an EFI_GUID that describes the
+                      specific type of reset to perform.
 **/
 VOID
 EFIAPI
-- 
2.21.0.windows.1


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

* [PATCH V2 6/6] MdePkg/UefiRuntimeLib: Change the comment
  2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
                   ` (4 preceding siblings ...)
  2019-05-08  4:49 ` [PATCH V2 5/6] MdePkg/UefiRuntimeLib.h: Change the comment Gao, Zhichao
@ 2019-05-08  4:49 ` Gao, Zhichao
  5 siblings, 0 replies; 8+ messages in thread
From: Gao, Zhichao @ 2019-05-08  4:49 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

Change the comment of EfiResetSystem base on the
UEFI spec 2.8

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 MdePkg/Library/UefiRuntimeLib/RuntimeLib.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
index 933e0099ce..28cbf493b6 100644
--- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
+++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
@@ -218,10 +218,10 @@ EfiGoneVirtual (
   @param  DataSizeThe size, in bytes, of ResetData.
   @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown the data buffer starts with a
                       Null-terminated Unicode string, optionally followed by additional binary data. The string is a
-                      description that the caller may use to further indicate the reason for the system reset. ResetData
-                      is only valid if ResetStatus is something other then EFI_SUCCESS. This pointer must be a physical
-                      address. For a ResetType of EfiRestUpdate the data buffer also starts with a Null-terminated string
-                      that is followed by a physical VOID * to an EFI_CAPSULE_HEADER.
+                      description that the caller may use to further indicate the reason for the system reset. This
+                      pointer must be a physical address. For a ResetType of EfiResetPlatformSpecific the data buffer
+                      also starts with a Null-terminated string that is followed by an EFI_GUID that describes the
+                      specific type of reset to perform.
 
 **/
 VOID
-- 
2.21.0.windows.1


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

* Re: [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition
  2019-05-08  4:49 ` [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition Gao, Zhichao
@ 2019-05-08  8:50   ` Laszlo Ersek
  0 siblings, 0 replies; 8+ messages in thread
From: Laszlo Ersek @ 2019-05-08  8:50 UTC (permalink / raw)
  To: Zhichao Gao, devel
  Cc: Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao, Sean Brogan,
	Michael Turner, Bret Barkelew

On 05/08/19 06:49, Zhichao Gao wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> Add a useful definition of reset data which start with a NULL
> string and followed by a EFI_GUID.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Michael Turner <Michael.Turner@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> ---
>  MdeModulePkg/Include/Library/ResetSystemLib.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/MdeModulePkg/Include/Library/ResetSystemLib.h b/MdeModulePkg/Include/Library/ResetSystemLib.h
> index 3b2a098a60..e39e8c748c 100644
> --- a/MdeModulePkg/Include/Library/ResetSystemLib.h
> +++ b/MdeModulePkg/Include/Library/ResetSystemLib.h
> @@ -13,6 +13,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include <Uefi/UefiBaseType.h>
>  #include <Uefi/UefiMultiPhase.h>
>  
> +#pragma pack(1)
> +typedef struct {
> +  CHAR16      NullString;
> +  EFI_GUID    ResetGuid;
> +} RESET_DATA_WITH_NULL_STRING;
> +#pragma pack()
> +
> +VERIFY_SIZE_OF (RESET_DATA_WITH_NULL_STRING, 18);
> +
>  /**
>    This function causes a system-wide reset (cold reset), in which
>    all circuitry within the system returns to its initial state. This type of reset
> 

(1) Please insert a space character between "pack" and "(". (Two
instances in the patch.)

(2) Personally I think the structure is small and clear enough for it to
need no comments. The MdeModulePkg maintainers might still request some
light comments just above the structure.

With (1) updated, and regardless of (2):

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo


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

end of thread, other threads:[~2019-05-08  8:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08  4:49 [PATCH V2 0/6] MdeModulePkg: Transfer reset data Gao, Zhichao
2019-05-08  4:49 ` [PATCH V2 1/6] MdeModulePkg/ResetSystemLib.h: Add useful reset data definition Gao, Zhichao
2019-05-08  8:50   ` Laszlo Ersek
2019-05-08  4:49 ` [PATCH V2 2/6] MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data Gao, Zhichao
2019-05-08  4:49 ` [PATCH V2 3/6] MdeModulePkg/CapsuleLib: " Gao, Zhichao
2019-05-08  4:49 ` [PATCH V2 4/6] MdeModulePkg/ResetUtilityLib: Replace the reset data difinition Gao, Zhichao
2019-05-08  4:49 ` [PATCH V2 5/6] MdePkg/UefiRuntimeLib.h: Change the comment Gao, Zhichao
2019-05-08  4:49 ` [PATCH V2 6/6] MdePkg/UefiRuntimeLib: " Gao, Zhichao

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