From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 08A2B818CB for ; Sun, 25 Dec 2016 18:56:37 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 25 Dec 2016 18:56:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,404,1477983600"; d="scan'208";a="802287353" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 25 Dec 2016 18:56:36 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 25 Dec 2016 18:56:36 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Mon, 26 Dec 2016 10:56:34 +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: AQHSXTZPUkeTZDrrlUCUhgRtj3HYPaEZjMsw Date: Mon, 26 Dec 2016 02:56:33 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B7F0F5A@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:56:37 -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