|
From: <hc...@us...> - 2012-06-08 01:50:05
|
Revision: 2537
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2537&view=rev
Author: hchen30
Date: 2012-06-08 01:49:59 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
1. Add checkpoint of PCD datum type for DSC file
2. Add BuildOptions to the scope of section names which can have other items after ARCH.
Reviewed-by: Yurui Zeng <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-07 16:28:29 UTC (rev 2536)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-08 01:49:59 UTC (rev 2537)
@@ -38,6 +38,7 @@
TAB_UINT16 = 'UINT16'
TAB_UINT32 = 'UINT32'
TAB_UINT64 = 'UINT64'
+TAB_VOID = 'VOID*'
TAB_EDK_SOURCE = '$(EDK_SOURCE)'
TAB_EFI_SOURCE = '$(EFI_SOURCE)'
@@ -473,4 +474,5 @@
PCDS_DYNAMIC_HII.upper(),
PCDS_DYNAMICEX_DEFAULT.upper(),
PCDS_DYNAMICEX_VPD.upper(),
- PCDS_DYNAMICEX_HII.upper()]
+ PCDS_DYNAMICEX_HII.upper(),
+ TAB_BUILD_OPTIONS.upper()]
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-07 16:28:29 UTC (rev 2536)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-08 01:49:59 UTC (rev 2537)
@@ -1043,6 +1043,14 @@
EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
File=self.MetaFile, Line=self._LineIndex + 1)
+
+ # Validate the datum type of Dynamic Defaul PCD and DynamicEx Default PCD
+ ValueList = GetSplitValueList(self._ValueList[2])
+ if len(ValueList) > 1 and ValueList[1] != TAB_VOID \
+ and self._ItemType in [MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT]:
+ EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s' of PCD is wrong" % ValueList[1],
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+
# if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
@@ -1050,6 +1058,7 @@
elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
+
## [components] section parser
@ParseMacro
def _ComponentParser(self):
@@ -1441,10 +1450,11 @@
def __ProcessPcd(self):
PcdValue = None
ValueList = GetSplitValueList(self._ValueList[2])
+
#
# PCD value can be an expression
#
- if len(ValueList) > 1 and ValueList[1] == 'VOID*':
+ if len(ValueList) > 1 and ValueList[1] == TAB_VOID:
PcdValue = ValueList[0]
try:
ValueList[0] = ValueExpression(PcdValue, self._Macros)(True)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|