mirror of https://github.com/acidanthera/audk.git
BaseTools: Fix the bug that same region print twice in the build log
This patch fixed the bug that same region print twice in the build log. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
f95678cf16
commit
66d00b4d65
|
@ -1,7 +1,7 @@
|
||||||
## @file
|
## @file
|
||||||
# process FD generation
|
# process FD generation
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -67,32 +67,38 @@ class FD(FDClassObject):
|
||||||
GenFdsGlobalVariable.VerboseLogger('################### Gen VTF ####################')
|
GenFdsGlobalVariable.VerboseLogger('################### Gen VTF ####################')
|
||||||
self.GenVtfFile()
|
self.GenVtfFile()
|
||||||
|
|
||||||
TempFdBuffer = StringIO.StringIO('')
|
HasCapsuleRegion = False
|
||||||
PreviousRegionStart = -1
|
for RegionObj in self.RegionList:
|
||||||
PreviousRegionSize = 1
|
|
||||||
|
|
||||||
for RegionObj in self.RegionList :
|
|
||||||
if RegionObj.RegionType == 'CAPSULE':
|
if RegionObj.RegionType == 'CAPSULE':
|
||||||
continue
|
HasCapsuleRegion = True
|
||||||
if RegionObj.Offset + RegionObj.Size <= PreviousRegionStart:
|
break
|
||||||
pass
|
if HasCapsuleRegion:
|
||||||
elif RegionObj.Offset <= PreviousRegionStart or (RegionObj.Offset >=PreviousRegionStart and RegionObj.Offset < PreviousRegionStart + PreviousRegionSize):
|
TempFdBuffer = StringIO.StringIO('')
|
||||||
pass
|
PreviousRegionStart = -1
|
||||||
elif RegionObj.Offset > PreviousRegionStart + PreviousRegionSize:
|
PreviousRegionSize = 1
|
||||||
GenFdsGlobalVariable.InfLogger('Padding region starting from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize)))
|
|
||||||
PadRegion = Region.Region()
|
for RegionObj in self.RegionList :
|
||||||
PadRegion.Offset = PreviousRegionStart + PreviousRegionSize
|
if RegionObj.RegionType == 'CAPSULE':
|
||||||
PadRegion.Size = RegionObj.Offset - PadRegion.Offset
|
continue
|
||||||
PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
|
if RegionObj.Offset + RegionObj.Size <= PreviousRegionStart:
|
||||||
PreviousRegionStart = RegionObj.Offset
|
pass
|
||||||
PreviousRegionSize = RegionObj.Size
|
elif RegionObj.Offset <= PreviousRegionStart or (RegionObj.Offset >=PreviousRegionStart and RegionObj.Offset < PreviousRegionStart + PreviousRegionSize):
|
||||||
#
|
pass
|
||||||
# Call each region's AddToBuffer function
|
elif RegionObj.Offset > PreviousRegionStart + PreviousRegionSize:
|
||||||
#
|
GenFdsGlobalVariable.InfLogger('Padding region starting from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize)))
|
||||||
if PreviousRegionSize > self.Size:
|
PadRegion = Region.Region()
|
||||||
pass
|
PadRegion.Offset = PreviousRegionStart + PreviousRegionSize
|
||||||
GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToBuffer function')
|
PadRegion.Size = RegionObj.Offset - PadRegion.Offset
|
||||||
RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
|
PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
|
||||||
|
PreviousRegionStart = RegionObj.Offset
|
||||||
|
PreviousRegionSize = 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.vtfRawDict, self.DefineVarDict)
|
||||||
|
|
||||||
FdBuffer = StringIO.StringIO('')
|
FdBuffer = StringIO.StringIO('')
|
||||||
PreviousRegionStart = -1
|
PreviousRegionStart = -1
|
||||||
|
|
Loading…
Reference in New Issue