summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/BPDG
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-15 02:51:34 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-15 02:51:34 +0000
commit6780eef1f9ed0af24795708c3be7adafd7113691 (patch)
tree1a9fd2fca0bd71c4a64a8bf3f10e492f45a232d8 /BaseTools/Source/Python/BPDG
parent5460c4bbc5aa9d99d25c55c6b936166bea3dbea0 (diff)
downloadedk2-platforms-6780eef1f9ed0af24795708c3be7adafd7113691.tar.xz
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
Diffstat (limited to 'BaseTools/Source/Python/BPDG')
-rw-r--r--BaseTools/Source/Python/BPDG/GenVpd.py38
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