From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 A84E520958BE9 for ; Tue, 5 Sep 2017 20:24:15 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 20:27:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,482,1498546800"; d="scan'208";a="147943780" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 05 Sep 2017 20:27:04 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 5 Sep 2017 20:27:04 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 5 Sep 2017 20:27:04 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.39]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.168]) with mapi id 14.03.0319.002; Wed, 6 Sep 2017 11:27:02 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix the bug that same region print twice in the build log Thread-Index: AQHTJiMIE4v4UUIe5kybhlnbRMKP06KnM7dA Date: Wed, 6 Sep 2017 03:27:02 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D78A93F@shsmsx102.ccr.corp.intel.com> References: <1504600991-61552-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1504600991-61552-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Wed, 06 Sep 2017 03:24:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Tuesday, September 05, 2017 4:43 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch] BaseTools: Fix the bug that same region print twice in th= e >build log > >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 >--- > 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 = BSD >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) > > GenFdsGlobalVariable.VerboseLogger('################### Gen VTF >####################') > self.GenVtfFile() > >- TempFdBuffer =3D StringIO.StringIO('') >- PreviousRegionStart =3D -1 >- PreviousRegionSize =3D 1 >- >- 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.Offset >=3DPreviousRegionStart and RegionObj.Offset < >PreviousRegionStart + PreviousRegionSize): >- pass >- elif RegionObj.Offset > PreviousRegionStart + PreviousRegionS= ize: >- GenFdsGlobalVariable.InfLogger('Padding region starting f= rom offset >0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize, >RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize))) >- PadRegion =3D Region.Region() >- PadRegion.Offset =3D PreviousRegionStart + PreviousRegion= Size >- PadRegion.Size =3D RegionObj.Offset - PadRegion.Offset >- PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, >self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDi= ct, >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 AddTo= Buffer >function') >- RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, >self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDi= ct, >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 PreviousRegionS= tart: >+ pass >+ elif RegionObj.Offset <=3D PreviousRegionStart or >(RegionObj.Offset >=3DPreviousRegionStart and RegionObj.Offset < >PreviousRegionStart + PreviousRegionSize): >+ pass >+ elif RegionObj.Offset > PreviousRegionStart + PreviousReg= ionSize: >+ GenFdsGlobalVariable.InfLogger('Padding region starti= ng from >offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize, >RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize))) >+ PadRegion =3D Region.Region() >+ PadRegion.Offset =3D PreviousRegionStart + PreviousRe= gionSize >+ PadRegion.Size =3D RegionObj.Offset - PadRegion.Offse= t >+ PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, >self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDi= ct, >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 >AddToBuffer function') >+ RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, >self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDi= ct, >self.DefineVarDict) > > FdBuffer =3D StringIO.StringIO('') > PreviousRegionStart =3D -1 > PreviousRegionSize =3D 1 > for RegionObj in self.RegionList : >-- >2.6.1.windows.1