## @file\r
# process FD generation\r
#\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#\r
import Region\r
import Fv\r
-import os\r
+import Common.LongFilePathOs as os\r
import StringIO\r
import sys\r
from struct import *\r
PreviousRegionStart = RegionObj.Offset\r
PreviousRegionSize = RegionObj.Size\r
#\r
+ # Verify current region fits within allocated FD section Size\r
+ #\r
+ if PreviousRegionStart + PreviousRegionSize > self.Size:\r
+ EdkLogger.error("GenFds", GENFDS_ERROR,\r
+ 'FD %s size too small to fit region with offset 0x%X and size 0x%X'\r
+ % (self.FdUiName, PreviousRegionStart, PreviousRegionSize))\r
+ #\r
# Call each region's AddToBuffer function\r
#\r
- if PreviousRegionSize > self.Size:\r
- EdkLogger.error("GenFds", GENFDS_ERROR, 'FD %s size too small' % self.FdUiName)\r
GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToBuffer function')\r
RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)\r
#\r