From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Tue, 07 May 2019 21:50:39 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 21:50:39 -0700 X-ExtLoop1: 1 Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by orsmga002.jf.intel.com with ESMTP; 07 May 2019 21:50:37 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner Subject: [PATCH V2 3/6] MdeModulePkg/CapsuleLib: Transfer reset data Date: Wed, 8 May 2019 12:49:36 +0800 Message-Id: <20190508044939.15744-4-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190508044939.15744-1-zhichao.gao@intel.com> References: <20190508044939.15744-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bret Barkelew 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 Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- .../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.
+# Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
# 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.
+ Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -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