[edk2-devel] [PATCH V2 3/6] MdeModulePkg/CapsuleLib: Transfer reset data
Gao, Zhichao
zhichao.gao at intel.com
Wed May 8 04:49:36 UTC 2019
From: Bret Barkelew <Bret.Barkelew at 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 at intel.com>
Cc: Hao Wu <hao.a.wu at intel.com>
Cc: Ray Ni <ray.ni at intel.com>
Cc: Star Zeng <star.zeng at intel.com>
Cc: Liming Gao <liming.gao at intel.com>
Cc: Sean Brogan <sean.brogan at microsoft.com>
Cc: Michael Turner <Michael.Turner at microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao at 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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#40173): https://edk2.groups.io/g/devel/message/40173
Mute This Topic: https://groups.io/mt/31540324/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list