|
From: <gi...@us...> - 2011-11-28 10:25:14
|
Revision: 2439
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2439&view=rev
Author: gikidy
Date: 2011-11-28 10:25:03 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
Fix a bug if there is VPD type PCD exist in platform build will break during generate VPD data file.
Signed-off-by: gikidy
Reviewed-by: yingke
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2011-11-28 08:28:12 UTC (rev 2438)
+++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2011-11-28 10:25:03 UTC (rev 2439)
@@ -960,8 +960,7 @@
"Fail to get FLASH_DEFINITION definition in DSC file %s which is required when DSC contains VPD PCD." % str(self.Platform.MetaFile))
if VpdFile.GetCount() != 0:
- WorkspaceDb = self.BuildDatabase.WorkspaceDb
- DscTimeStamp = WorkspaceDb.GetTimeStamp(WorkspaceDb.GetFileId(str(self.Platform.MetaFile)))
+ DscTimeStamp = self.Platform.MetaFile.TimeStamp
FvPath = os.path.join(self.BuildDir, "FV")
if not os.path.exists(FvPath):
try:
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-28 08:28:12 UTC (rev 2438)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-28 10:25:03 UTC (rev 2439)
@@ -1321,6 +1321,7 @@
self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros, RaiseError=True)
def __ProcessPcd(self):
+ PcdValue = None
ValueList = GetSplitValueList(self._ValueList[2])
#
# PCD value can be an expression
@@ -1332,16 +1333,31 @@
except WrnExpression, Value:
ValueList[0] = Value.result
else:
- PcdValue = ValueList[-1]
- try:
- ValueList[-1] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValueList[-1] = Value.result
-
- if ValueList[-1] == 'True':
- ValueList[-1] = '1'
- if ValueList[-1] == 'False':
- ValueList[-1] = '0'
+ #
+ # Int*/Boolean VPD PCD
+ # TokenSpace | PcdCName | Offset | [Value]
+ #
+ # VOID* VPD PCD
+ # TokenSpace | PcdCName | Offset | [Size] | [Value]
+ #
+ if self._ItemType == MODEL_PCD_DYNAMIC_VPD:
+ if len(ValueList) >= 4:
+ PcdValue = ValueList[-1]
+ else:
+ PcdValue = ValueList[-1]
+ #
+ # For the VPD PCD, there may not have PcdValue data in DSC file
+ #
+ if PcdValue:
+ try:
+ ValueList[-1] = ValueExpression(PcdValue, self._Macros)(True)
+ except WrnExpression, Value:
+ ValueList[-1] = Value.result
+
+ if ValueList[-1] == 'True':
+ ValueList[-1] = '1'
+ if ValueList[-1] == 'False':
+ ValueList[-1] = '0'
self._ValueList[2] = '|'.join(ValueList)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|