From nobody Thu Dec 26 12:45:23 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504601002290987.6564243878935; Tue, 5 Sep 2017 01:43:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B127F2095DCAE; Tue, 5 Sep 2017 01:40:29 -0700 (PDT) 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 CC58321EA35DA for ; Tue, 5 Sep 2017 01:40:27 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 01:43:16 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by fmsmga005.fm.intel.com with ESMTP; 05 Sep 2017 01:43:14 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,479,1498546800"; d="scan'208";a="147561963" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Tue, 5 Sep 2017 16:43:11 +0800 Message-Id: <1504600991-61552-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Fix the bug that same region print twice in the build log X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixed the bug that same region print twice in the build log. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/GenFds/Fd.py | 58 ++++++++++++++++++++------------= ---- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/Fd.py b/BaseTools/Source/Python= /GenFds/Fd.py index 684b5ce..f330a7e 100644 --- a/BaseTools/Source/Python/GenFds/Fd.py +++ b/BaseTools/Source/Python/GenFds/Fd.py @@ -1,9 +1,9 @@ ## @file # process FD generation # -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License # which accompanies this distribution. The full text of the license may = be found at # http://opensource.org/licenses/bsd-license.php @@ -65,36 +65,42 @@ class FD(FDClassObject): GenFdsGlobalVariable.VerboseLogger(FvObj) =20 GenFdsGlobalVariable.VerboseLogger('################### Gen VTF ##= ##################') self.GenVtfFile() =20 - TempFdBuffer =3D StringIO.StringIO('') - PreviousRegionStart =3D -1 - PreviousRegionSize =3D 1 - =20 - for RegionObj in self.RegionList : + HasCapsuleRegion =3D False + for RegionObj in self.RegionList: if RegionObj.RegionType =3D=3D 'CAPSULE': - continue - if RegionObj.Offset + RegionObj.Size <=3D PreviousRegionStart: - pass - elif RegionObj.Offset <=3D PreviousRegionStart or (RegionObj.O= ffset >=3DPreviousRegionStart and RegionObj.Offset < PreviousRegionStart + = PreviousRegionSize): - pass - elif RegionObj.Offset > PreviousRegionStart + PreviousRegionSi= ze: - GenFdsGlobalVariable.InfLogger('Padding region starting fr= om offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize,= RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize))) - PadRegion =3D Region.Region() - PadRegion.Offset =3D PreviousRegionStart + PreviousRegionS= ize - PadRegion.Size =3D RegionObj.Offset - PadRegion.Offset - PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, self= .BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, s= elf.DefineVarDict) - PreviousRegionStart =3D RegionObj.Offset - PreviousRegionSize =3D RegionObj.Size - # - # Call each region's AddToBuffer function - # - if PreviousRegionSize > self.Size: - pass - GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToB= uffer function') - RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, self.Bl= ockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self= .DefineVarDict) + HasCapsuleRegion =3D True + break + if HasCapsuleRegion: + TempFdBuffer =3D StringIO.StringIO('') + PreviousRegionStart =3D -1 + PreviousRegionSize =3D 1 + + for RegionObj in self.RegionList : + if RegionObj.RegionType =3D=3D 'CAPSULE': + continue + if RegionObj.Offset + RegionObj.Size <=3D PreviousRegionSt= art: + pass + elif RegionObj.Offset <=3D PreviousRegionStart or (RegionO= bj.Offset >=3DPreviousRegionStart and RegionObj.Offset < PreviousRegionStar= t + PreviousRegionSize): + pass + elif RegionObj.Offset > PreviousRegionStart + PreviousRegi= onSize: + GenFdsGlobalVariable.InfLogger('Padding region startin= g from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionS= ize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize))) + PadRegion =3D Region.Region() + PadRegion.Offset =3D PreviousRegionStart + PreviousReg= ionSize + PadRegion.Size =3D RegionObj.Offset - PadRegion.Offset + PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, = self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDic= t, self.DefineVarDict) + PreviousRegionStart =3D RegionObj.Offset + PreviousRegionSize =3D RegionObj.Size + # + # Call each region's AddToBuffer function + # + if PreviousRegionSize > self.Size: + pass + GenFdsGlobalVariable.VerboseLogger('Call each region\'s Ad= dToBuffer function') + RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, sel= f.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, = self.DefineVarDict) =20 FdBuffer =3D StringIO.StringIO('') PreviousRegionStart =3D -1 PreviousRegionSize =3D 1 for RegionObj in self.RegionList : --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel