from WorkspaceCommon import GetDeclaredPcd\r
from Common.Misc import AnalyzeDscPcd\r
import re\r
+from Common.Parsing import IsValidWord\r
\r
## Platform build information from DSC file\r
#\r
VariableName, VariableGuid, VariableOffset, DefaultValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)\r
\r
ExceedMax = False\r
+ FormatCorrect = True\r
if VariableOffset.isdigit():\r
if int(VariableOffset,10) > 0xFFFF:\r
ExceedMax = True\r
elif re.match(r'[\t\s]*0[xX][a-fA-F0-9]+$',VariableOffset):\r
if int(VariableOffset,16) > 0xFFFF:\r
ExceedMax = True\r
+ # For Offset written in "A.B"\r
+ elif VariableOffset.find('.') > -1:\r
+ VariableOffsetList = VariableOffset.split(".")\r
+ if not (len(VariableOffsetList) == 2\r
+ and IsValidWord(VariableOffsetList[0])\r
+ and IsValidWord(VariableOffsetList[1])):\r
+ FormatCorrect = False\r
else:\r
+ FormatCorrect = False\r
+ if not FormatCorrect:\r
EdkLogger.error('Build', FORMAT_INVALID, "Invalid syntax or format of the variable offset value is incorrect for %s." % ".".join((TokenSpaceGuid,PcdCName)))\r
\r
if ExceedMax:\r