Sync EDKII BaseTools to BaseTools project r2093.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11057 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2010-11-15 02:51:34 +00:00
parent 5460c4bbc5
commit 6780eef1f9
49 changed files with 1138 additions and 531 deletions

View File

@ -17,6 +17,7 @@ import os
import StringIO
import StringTable as st
import array
import re
from struct import *
import Common.EdkLogger as EdkLogger
@ -338,8 +339,27 @@ class GenVPD :
line = line.rstrip(os.linesep)
# Skip the comment line
if (not line.startswith("#")) and len(line) > 1 :
self.FileLinesList[count] = line.split('|')
if (not line.startswith("#")) and len(line) > 1 :
#
# Enhanced for support "|" character in the string.
#
ValueList = ['', '', '', '']
ValueRe = re.compile(r'\s*L?\".*\|.*\"\s*$')
PtrValue = ValueRe.findall(line)
ValueUpdateFlag = False
if len(PtrValue) >= 1:
line = re.sub(ValueRe, '', line)
ValueUpdateFlag = True
TokenList = line.split('|')
ValueList[0:len(TokenList)] = TokenList
if ValueUpdateFlag:
ValueList[3] = PtrValue[0]
self.FileLinesList[count] = ValueList
# Store the line number
self.FileLinesList[count].append(str(count+1))
elif len(line) <= 1 :
@ -524,10 +544,8 @@ class GenVPD :
if lenOfUnfixedList != 0 :
countOfUnfixedList = 0
while(countOfUnfixedList < lenOfUnfixedList) :
#needFixPcdCName, needFixPcdOffset, needFixPcdSize, needFixPcdValue, needFixUnpackValue = self.PcdUnknownOffsetList[countOfUnfixedList][0:6]
eachUnfixedPcd = self.PcdUnknownOffsetList[countOfUnfixedList]
needFixPcdSize = eachUnfixedPcd.PcdBinSize
needFixPcdOffset = eachUnfixedPcd.PcdOffset
# Not been fixed
if eachUnfixedPcd.PcdOffset == '*' :
# The offset un-fixed pcd can write into this free space
@ -546,18 +564,16 @@ class GenVPD :
FixOffsetSizeListCount += 1
# Decrease the un-fixed pcd offset list's length
countOfUnfixedList += 1
lenOfUnfixedList -= 1
# Modify the last offset value
LastOffset += needFixPcdSize
continue
LastOffset += needFixPcdSize
else :
# It can not insert into those two pcds, need to check stiil has other space can store it.
# It can not insert into those two pcds, need to check still has other space can store it.
LastOffset = NowOffset + self.PcdFixedOffsetSizeList[FixOffsetSizeListCount].PcdBinSize
FixOffsetSizeListCount += 1
break
else :
continue
break
# Set the FixOffsetSizeListCount = lenOfList for quit the loop
else :
FixOffsetSizeListCount = lenOfList