From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0B0F6818C8 for ; Sun, 25 Dec 2016 18:52:21 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 25 Dec 2016 18:52:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,404,1477983600"; d="scan'208";a="802286712" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 25 Dec 2016 18:52:20 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 25 Dec 2016 18:52:20 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Mon, 26 Dec 2016 10:52:18 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Zhang, Chao B" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/CapsuleLib: Support result rolling over. Thread-Index: AQHSXTZPUkeTZDrrlUCUhgRtj3HYPaEZi58w Date: Mon, 26 Dec 2016 02:52:18 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B7F0F42@shsmsx102.ccr.corp.intel.com> References: <1482509075-13456-1-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1482509075-13456-1-git-send-email-jiewen.yao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/CapsuleLib: Support result rolling over. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 02:52:21 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiew= en Yao Sent: Saturday, December 24, 2016 12:05 AM To: edk2-devel@lists.01.org Cc: Tian, Feng ; Zhang, Chao B ; Zeng, Star Subject: [edk2] [PATCH] MdeModulePkg/CapsuleLib: Support result rolling ove= r. According to UEFI spec, capsule result variable may roll over to 0. Cc: Feng Tian Cc: Star Zeng Cc: Chao Zhang Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/= MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c index bba30b5..a591beb 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c @@ -167,7 +167,7 @@ WriteNewCapsuleResultVariableCache ( Get a new capsule status variable index. =20 @return A new capsule status variable index. - @retval -1 No new capsule status variable index. + @retval 0 No new capsule status variable index. Rolling over. **/ INTN GetNewCapsuleResultIndex ( @@ -178,7 +178,8 @@ GetNewCapsuleResultIndex ( =20 CurrentIndex =3D GetCurrentCapsuleLastIndex(); if (CurrentIndex >=3D PcdGet16(PcdCapsuleMax)) { - return -1; + DEBUG((DEBUG_INFO, " CapsuleResult variable Rolling Over!\n")); + return 0; } =20 return CurrentIndex + 1; @@ -206,9 +207,7 @@ WriteNewCapsuleResultVariable ( =20 CapsuleResultIndex =3D GetNewCapsuleResultIndex(); DEBUG((DEBUG_INFO, "New CapsuleResultIndex - 0x%x\n", CapsuleResultIndex= )); - if (CapsuleResultIndex =3D=3D -1) { - return EFI_OUT_OF_RESOURCES; - } + UnicodeSPrint( CapsuleResultStr, sizeof(CapsuleResultStr), --=20 2.7.4.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel