diff options
Diffstat (limited to 'BaseTools/Source/Python/BPDG')
-rw-r--r-- | BaseTools/Source/Python/BPDG/GenVpd.py | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py b/BaseTools/Source/Python/BPDG/GenVpd.py index f0196e061a..bbe44eefa4 100644 --- a/BaseTools/Source/Python/BPDG/GenVpd.py +++ b/BaseTools/Source/Python/BPDG/GenVpd.py @@ -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
|