## @file\r
# parse FDF file\r
#\r
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
from Common.Expression import *\r
from Common import GlobalData\r
from Common.String import ReplaceMacro\r
-\r
+import uuid\r
from Common.Misc import tdict\r
-\r
-import re\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
import Common.LongFilePathOs as os\r
from Common.LongFilePathSupport import OpenLongFilePath as open\r
+from Capsule import EFI_CERT_TYPE_PKCS7_GUID\r
+from Capsule import EFI_CERT_TYPE_RSA2048_SHA256_GUID\r
\r
##define T_CHAR_SPACE ' '\r
##define T_CHAR_NULL '\0'\r
RegionOffsetPcdPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*$")\r
ShortcutPcdPattern = re.compile("\s*\w+\s*=\s*(?P<value>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<name>\w+\.\w+)\s*")\r
\r
-IncludeFileList = []\r
+AllIncludeFileList = []\r
+\r
+# Get the closest parent\r
+def GetParentAtLine (Line):\r
+ for Profile in AllIncludeFileList:\r
+ if Profile.IsLineInFile(Line):\r
+ return Profile\r
+ return None\r
+\r
+# Check include loop\r
+def IsValidInclude (File, Line):\r
+ for Profile in AllIncludeFileList:\r
+ if Profile.IsLineInFile(Line) and Profile.FileName == File:\r
+ return False\r
+\r
+ return True\r
\r
def GetRealFileLine (File, Line):\r
\r
InsertedLines = 0\r
- for Profile in IncludeFileList:\r
- if Line >= Profile.InsertStartLineNumber and Line < Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):\r
- return (Profile.FileName, Line - Profile.InsertStartLineNumber + 1)\r
- if Line >= Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):\r
- InsertedLines += Profile.InsertAdjust + len(Profile.FileLinesList)\r
+ for Profile in AllIncludeFileList:\r
+ if Profile.IsLineInFile(Line):\r
+ return Profile.GetLineInFile(Line)\r
+ elif Line >= Profile.InsertStartLineNumber and Profile.Level == 1:\r
+ InsertedLines += Profile.GetTotalLines()\r
\r
return (File, Line - InsertedLines)\r
\r
FileLineTuple = GetRealFileLine(File, Line)\r
self.FileName = FileLineTuple[0]\r
self.LineNumber = FileLineTuple[1]\r
+ self.OriginalLineNumber = Line\r
self.Message = Str\r
self.ToolName = 'FdfParser'\r
\r
fsock = open(FileName, "rb", 0)\r
try:\r
self.FileLinesList = fsock.readlines()\r
+ for index, line in enumerate(self.FileLinesList):\r
+ if not line.endswith('\n'):\r
+ self.FileLinesList[index] += '\n'\r
+\r
finally:\r
fsock.close()\r
\r
\r
self.InsertStartLineNumber = None\r
self.InsertAdjust = 0\r
+ self.IncludeFileList = []\r
+ self.Level = 1 # first level include file\r
+ \r
+ def GetTotalLines(self):\r
+ TotalLines = self.InsertAdjust + len(self.FileLinesList)\r
+\r
+ for Profile in self.IncludeFileList:\r
+ TotalLines += Profile.GetTotalLines()\r
+\r
+ return TotalLines\r
+\r
+ def IsLineInFile(self, Line):\r
+ if Line >= self.InsertStartLineNumber and Line < self.InsertStartLineNumber + self.GetTotalLines():\r
+ return True\r
+\r
+ return False\r
+\r
+ def GetLineInFile(self, Line):\r
+ if not self.IsLineInFile (Line):\r
+ return (self.FileName, -1)\r
+ \r
+ InsertedLines = self.InsertStartLineNumber\r
+\r
+ for Profile in self.IncludeFileList:\r
+ if Profile.IsLineInFile(Line):\r
+ return Profile.GetLineInFile(Line)\r
+ elif Line >= Profile.InsertStartLineNumber:\r
+ InsertedLines += Profile.GetTotalLines()\r
+\r
+ return (self.FileName, Line - InsertedLines + 1)\r
+\r
+\r
\r
## The FDF content class that used to record file data when parsing FDF\r
#\r
\r
self.PcdDict = {}\r
self.InfList = []\r
+ self.InfDict = {'ArchTBD':[]}\r
# ECC will use this Dict and List information\r
self.PcdFileLineDict = {}\r
self.InfFileLineList = []\r
self.VtfList = []\r
self.RuleDict = {}\r
self.OptRomDict = {}\r
+ self.FmpPayloadDict = {}\r
\r
## The syntax parser for FDF\r
#\r
# Reset file data buffer to the initial state\r
#\r
# @param self The object pointer\r
+ # @param DestLine Optional new destination line number.\r
+ # @param DestOffset Optional new destination offset. \r
#\r
- def Rewind(self):\r
- self.CurrentLineNumber = 1\r
- self.CurrentOffsetWithinLine = 0\r
+ def Rewind(self, DestLine = 1, DestOffset = 0): \r
+ self.CurrentLineNumber = DestLine \r
+ self.CurrentOffsetWithinLine = DestOffset \r
\r
## __UndoOneChar() method\r
#\r
# @param self The object pointer\r
#\r
def PreprocessIncludeFile(self):\r
-\r
+ # nested include support\r
+ Processed = False\r
+ MacroDict = {}\r
while self.__GetNextToken():\r
\r
- if self.__Token == '!include':\r
+ if self.__Token == 'DEFINE':\r
+ if not self.__GetNextToken():\r
+ raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)\r
+ Macro = self.__Token\r
+ if not self.__IsToken( "="):\r
+ raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
+ Value = self.__GetExpression()\r
+ MacroDict[Macro] = Value\r
+\r
+ elif self.__Token == '!include':\r
+ Processed = True\r
IncludeLine = self.CurrentLineNumber\r
IncludeOffset = self.CurrentOffsetWithinLine - len('!include')\r
if not self.__GetNextToken():\r
raise Warning("expected include file name", self.FileName, self.CurrentLineNumber)\r
IncFileName = self.__Token\r
- __IncludeMacros = {}\r
- for Macro in ['WORKSPACE', 'ECP_SOURCE', 'EFI_SOURCE', 'EDK_SOURCE']:\r
+ PreIndex = 0\r
+ StartPos = IncFileName.find('$(', PreIndex)\r
+ EndPos = IncFileName.find(')', StartPos+2)\r
+ while StartPos != -1 and EndPos != -1:\r
+ Macro = IncFileName[StartPos+2 : EndPos]\r
MacroVal = self.__GetMacroValue(Macro)\r
- if MacroVal:\r
- __IncludeMacros[Macro] = MacroVal\r
+ if not MacroVal:\r
+ if Macro in MacroDict:\r
+ MacroVal = MacroDict[Macro]\r
+ if MacroVal != None:\r
+ IncFileName = IncFileName.replace('$(' + Macro + ')', MacroVal, 1)\r
+ if MacroVal.find('$(') != -1:\r
+ PreIndex = StartPos\r
+ else:\r
+ PreIndex = StartPos + len(MacroVal)\r
+ else:\r
+ raise Warning("The Macro %s is not defined" %Macro, self.FileName, self.CurrentLineNumber)\r
+ StartPos = IncFileName.find('$(', PreIndex)\r
+ EndPos = IncFileName.find(')', StartPos+2)\r
\r
- try:\r
- IncludedFile = NormPath(ReplaceMacro(IncFileName, __IncludeMacros, RaiseError=True))\r
- except:\r
- raise Warning("only these system environment variables are permitted to start the path of the included file: "\r
- "$(WORKSPACE), $(ECP_SOURCE), $(EFI_SOURCE), $(EDK_SOURCE)",\r
- self.FileName, self.CurrentLineNumber)\r
+ IncludedFile = NormPath(IncFileName)\r
#\r
# First search the include file under the same directory as FDF file\r
#\r
raise Warning("The include file does not exist under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), PlatformDir, GlobalData.gWorkspace), \r
self.FileName, self.CurrentLineNumber)\r
\r
+ if not IsValidInclude (IncludedFile1.Path, self.CurrentLineNumber):\r
+ raise Warning("The include file {0} is causing a include loop.\n".format (IncludedFile1.Path), self.FileName, self.CurrentLineNumber)\r
+\r
IncFileProfile = IncludeFileProfile(IncludedFile1.Path)\r
\r
CurrentLine = self.CurrentLineNumber\r
CurrentOffset = self.CurrentOffsetWithinLine\r
# list index of the insertion, note that line number is 'CurrentLine + 1'\r
InsertAtLine = CurrentLine\r
+ ParentProfile = GetParentAtLine (CurrentLine)\r
+ if ParentProfile != None:\r
+ ParentProfile.IncludeFileList.insert(0, IncFileProfile)\r
+ IncFileProfile.Level = ParentProfile.Level + 1\r
IncFileProfile.InsertStartLineNumber = InsertAtLine + 1\r
# deal with remaining portions after "!include filename", if exists.\r
if self.__GetNextToken():\r
self.CurrentLineNumber += 1\r
InsertAtLine += 1\r
\r
- IncludeFileList.append(IncFileProfile)\r
+ # reversely sorted to better determine error in file\r
+ AllIncludeFileList.insert(0, IncFileProfile)\r
\r
# comment out the processed include file statement\r
TempList = list(self.Profile.FileLinesList[IncludeLine - 1])\r
TempList.insert(IncludeOffset, '#')\r
self.Profile.FileLinesList[IncludeLine - 1] = ''.join(TempList)\r
-\r
+ if Processed: # Nested and back-to-back support\r
+ self.Rewind(DestLine = IncFileProfile.InsertStartLineNumber - 1)\r
+ Processed = False\r
+ # Preprocess done.\r
self.Rewind()\r
\r
def __GetIfListCurrentItemStat(self, IfList):\r
self.__SetMacroValue(Macro, Value)\r
self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))\r
elif self.__Token == 'SET':\r
+ if not self.__GetIfListCurrentItemStat(IfList):\r
+ continue\r
SetLine = self.CurrentLineNumber - 1\r
SetOffset = self.CurrentOffsetWithinLine - len('SET')\r
PcdPair = self.__GetNextPcdName()\r
\r
MacroDict.update(GlobalData.gGlobalDefines)\r
MacroDict.update(GlobalData.gCommandLineDefines)\r
+ if GlobalData.BuildOptionPcd:\r
+ for Item in GlobalData.BuildOptionPcd:\r
+ if type(Item) is tuple:\r
+ continue\r
+ PcdName, TmpValue = Item.split("=")\r
+ TmpValue = BuildOptionValue(TmpValue, {})\r
+ MacroDict[PcdName.strip()] = TmpValue\r
# Highest priority\r
\r
return MacroDict\r
self.__UndoToken()\r
return False\r
\r
+ def __Verify(self, Name, Value, Scope):\r
+ if Scope in ['UINT64', 'UINT8']:\r
+ ValueNumber = 0\r
+ try:\r
+ if Value.upper().startswith('0X'):\r
+ ValueNumber = int (Value, 16)\r
+ else:\r
+ ValueNumber = int (Value)\r
+ except:\r
+ EdkLogger.error("FdfParser", FORMAT_INVALID, "The value is not valid dec or hex number for %s." % Name)\r
+ if ValueNumber < 0:\r
+ EdkLogger.error("FdfParser", FORMAT_INVALID, "The value can't be set to negative value for %s." % Name)\r
+ if Scope == 'UINT64':\r
+ if ValueNumber >= 0x10000000000000000:\r
+ EdkLogger.error("FdfParser", FORMAT_INVALID, "Too large value for %s." % Name)\r
+ if Scope == 'UINT8':\r
+ if ValueNumber >= 0x100:\r
+ EdkLogger.error("FdfParser", FORMAT_INVALID, "Too large value for %s." % Name)\r
+ return True\r
+\r
## __UndoToken() method\r
#\r
# Go back one token unit in file buffer\r
\r
try:\r
self.Preprocess()\r
- while self.__GetFd():\r
- pass\r
-\r
- while self.__GetFv():\r
- pass\r
-\r
- while self.__GetCapsule():\r
- pass\r
-\r
- while self.__GetVtf():\r
- pass\r
-\r
- while self.__GetRule():\r
- pass\r
- \r
- while self.__GetOptionRom():\r
+ #\r
+ # Keep processing sections of the FDF until no new sections or a syntax error is found\r
+ #\r
+ while self.__GetFd() or self.__GetFv() or self.__GetFmp() or self.__GetCapsule() or self.__GetVtf() or self.__GetRule() or self.__GetOptionRom():\r
pass\r
\r
except Warning, X:\r
self.__UndoToken()\r
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
#'\n\tGot Token: \"%s\" from File %s\n' % (self.__Token, FileLineTuple[0]) + \\r
- X.Message += ' near line %d, column %d: %s' \\r
+ # At this point, the closest parent would be the included file itself\r
+ Profile = GetParentAtLine(X.OriginalLineNumber)\r
+ if Profile != None:\r
+ X.Message += ' near line %d, column %d: %s' \\r
+ % (X.LineNumber, 0, Profile.FileLinesList[X.LineNumber-1])\r
+ else:\r
+ FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
+ X.Message += ' near line %d, column %d: %s' \\r
% (FileLineTuple[1], self.CurrentOffsetWithinLine + 1, self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :].rstrip('\n').rstrip('\r'))\r
raise\r
\r
+ ## SectionParser() method\r
+ #\r
+ # Parse the file section info\r
+ # Exception will be raised if syntax error found\r
+ #\r
+ # @param self The object pointer\r
+ # @param section The section string\r
+\r
+ def SectionParser(self, section):\r
+ S = section.upper()\r
+ if not S.startswith("[DEFINES") and not S.startswith("[FD.") and not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \\r
+ and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM.") and not S.startswith('[FMPPAYLOAD.'):\r
+ raise Warning("Unknown section or section appear sequence error (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.], [FMPPAYLOAD.])", self.FileName, self.CurrentLineNumber)\r
+\r
## __GetDefines() method\r
#\r
# Get Defines section contents and store its data into AllMacrosList\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[DEFINES"):\r
- if not S.startswith("[FD.") and not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \\r
- and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):\r
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)\r
+ self.SectionParser(S)\r
self.__UndoToken()\r
return False\r
\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[FD."):\r
- if not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \\r
+ if not S.startswith("[FV.") and not S.startswith('[FMPPAYLOAD.') and not S.startswith("[CAPSULE.") \\r
and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):\r
raise Warning("Unknown section", self.FileName, self.CurrentLineNumber)\r
self.__UndoToken()\r
if not self.__GetNextWord():\r
return True\r
\r
- if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE"):\r
+ if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE", "INF"):\r
#\r
# If next token is a word which is not a valid FV type, it might be part of [PcdOffset[|PcdSize]]\r
# Or it might be next region's offset described by an expression which starts with a PCD.\r
\r
elif self.__Token == "FILE":\r
self.__UndoToken()\r
- self.__GetRegionFileType( RegionObj)\r
+ self.__GetRegionFileType(RegionObj)\r
+\r
+ elif self.__Token == "INF":\r
+ self.__UndoToken()\r
+ RegionObj.RegionType = "INF"\r
+ while self.__IsKeyword("INF"):\r
+ self.__UndoToken()\r
+ ffsInf = self.__ParseInfStatement()\r
+ if not ffsInf:\r
+ break\r
+ RegionObj.RegionDataList.append(ffsInf)\r
\r
elif self.__Token == "DATA":\r
self.__UndoToken()\r
- self.__GetRegionDataType( RegionObj)\r
+ self.__GetRegionDataType(RegionObj)\r
else:\r
self.__UndoToken()\r
if self.__GetRegionLayout(Fd):\r
return True\r
raise Warning("A valid region type was not found. "\r
- "Valid types are [SET, FV, CAPSULE, FILE, DATA]. This error occurred",\r
+ "Valid types are [SET, FV, CAPSULE, FILE, DATA, INF]. This error occurred",\r
self.FileName, self.CurrentLineNumber)\r
\r
return True\r
raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)\r
\r
RegionObj.RegionType = "FV"\r
- RegionObj.RegionDataList.append(self.__Token)\r
+ RegionObj.RegionDataList.append((self.__Token).upper())\r
\r
while self.__IsKeyword( "FV"):\r
\r
if not self.__GetNextToken():\r
raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)\r
\r
- RegionObj.RegionDataList.append(self.__Token)\r
+ RegionObj.RegionDataList.append((self.__Token).upper())\r
\r
## __GetRegionCapType() method\r
#\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[FV."):\r
- if not S.startswith("[CAPSULE.") \\r
- and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):\r
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)\r
+ self.SectionParser(S)\r
self.__UndoToken()\r
return False\r
\r
if not (self.__GetBlockStatement(FvObj) or self.__GetFvBaseAddress(FvObj) or \r
self.__GetFvForceRebase(FvObj) or self.__GetFvAlignment(FvObj) or \r
self.__GetFvAttributes(FvObj) or self.__GetFvNameGuid(FvObj) or \r
- self.__GetFvExtEntryStatement(FvObj)):\r
+ self.__GetFvExtEntryStatement(FvObj) or self.__GetFvNameString(FvObj)):\r
break\r
\r
+ if FvObj.FvNameString == 'TRUE' and not FvObj.FvNameGuid:\r
+ raise Warning("FvNameString found but FvNameGuid was not found", self.FileName, self.CurrentLineNumber)\r
+\r
self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())\r
self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())\r
\r
"WRITE_DISABLED_CAP", "WRITE_STATUS", "READ_ENABLED_CAP", \\r
"READ_DISABLED_CAP", "READ_STATUS", "READ_LOCK_CAP", \\r
"READ_LOCK_STATUS", "WRITE_LOCK_CAP", "WRITE_LOCK_STATUS", \\r
- "WRITE_POLICY_RELIABLE", "WEAK_ALIGNMENT"):\r
+ "WRITE_POLICY_RELIABLE", "WEAK_ALIGNMENT", "FvUsedSizeEnable"):\r
self.__UndoToken()\r
return False\r
\r
\r
return True\r
\r
+ def __GetFvNameString(self, FvObj):\r
+\r
+ if not self.__IsKeyword( "FvNameString"):\r
+ return False\r
+\r
+ if not self.__IsToken( "="):\r
+ raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
+\r
+ if not self.__GetNextToken() or self.__Token not in ('TRUE', 'FALSE'):\r
+ raise Warning("expected TRUE or FALSE for FvNameString", self.FileName, self.CurrentLineNumber)\r
+\r
+ FvObj.FvNameString = self.__Token\r
+\r
+ return True\r
+\r
def __GetFvExtEntryStatement(self, FvObj):\r
\r
- if not self.__IsKeyword( "FV_EXT_ENTRY"):\r
+ if not (self.__IsKeyword( "FV_EXT_ENTRY") or self.__IsKeyword( "FV_EXT_ENTRY_TYPE")):\r
return False\r
\r
if not self.__IsKeyword ("TYPE"):\r
FvObj.AprioriSectionList.append(AprSectionObj)\r
return True\r
\r
- ## __GetInfStatement() method\r
- #\r
- # Get INF statements\r
- #\r
- # @param self The object pointer\r
- # @param Obj for whom inf statement is got\r
- # @param MacroDict dictionary used to replace macro\r
- # @retval True Successfully find inf statement\r
- # @retval False Not able to find inf statement\r
- #\r
- def __GetInfStatement(self, Obj, ForCapsule = False, MacroDict = {}):\r
-\r
- if not self.__IsKeyword( "INF"):\r
- return False\r
+ def __ParseInfStatement(self):\r
+ if not self.__IsKeyword("INF"):\r
+ return None\r
\r
ffsInf = FfsInfStatement.FfsInfStatement()\r
- self.__GetInfOptions( ffsInf)\r
+ self.__GetInfOptions(ffsInf)\r
\r
if not self.__GetNextToken():\r
raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)\r
ffsInf.InfFileName = self.__Token\r
+ if not ffsInf.InfFileName.endswith('.inf'):\r
+ raise Warning("expected .inf file path", self.FileName, self.CurrentLineNumber)\r
\r
ffsInf.CurrentLineNum = self.CurrentLineNumber\r
ffsInf.CurrentLineContent = self.__CurrentLine()\r
self.Profile.InfList.append(ffsInf.InfFileName)\r
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
self.Profile.InfFileLineList.append(FileLineTuple)\r
+ if ffsInf.UseArch:\r
+ if ffsInf.UseArch not in self.Profile.InfDict:\r
+ self.Profile.InfDict[ffsInf.UseArch] = [ffsInf.InfFileName]\r
+ else:\r
+ self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.InfFileName)\r
+ else:\r
+ self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)\r
\r
if self.__IsToken('|'):\r
if self.__IsKeyword('RELOCS_STRIPPED'):\r
ffsInf.KeepReloc = True\r
else:\r
raise Warning("Unknown reloc strip flag '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
- \r
+ return ffsInf\r
+\r
+ ## __GetInfStatement() method\r
+ #\r
+ # Get INF statements\r
+ #\r
+ # @param self The object pointer\r
+ # @param Obj for whom inf statement is got\r
+ # @param MacroDict dictionary used to replace macro\r
+ # @retval True Successfully find inf statement\r
+ # @retval False Not able to find inf statement\r
+ #\r
+ def __GetInfStatement(self, Obj, ForCapsule=False, MacroDict={}):\r
+ ffsInf = self.__ParseInfStatement()\r
+ if not ffsInf:\r
+ return False\r
+\r
if ForCapsule:\r
capsuleFfs = CapsuleData.CapsuleFfs()\r
capsuleFfs.Ffs = ffsInf\r
elif self.__Token in ("DEFINE", "APRIORI", "SECTION"):\r
self.__UndoToken()\r
self.__GetSectionData( FfsFileObj, MacroDict)\r
+\r
+ elif hasattr(FfsFileObj, 'FvFileType') and FfsFileObj.FvFileType == 'RAW':\r
+ self.__UndoToken()\r
+ self.__GetRAWData(FfsFileObj, MacroDict)\r
+\r
else:\r
FfsFileObj.CurrentLineNum = self.CurrentLineNumber\r
FfsFileObj.CurrentLineContent = self.__CurrentLine()\r
if not self.__IsToken( "}"):\r
raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)\r
\r
+ ## __GetRAWData() method\r
+ #\r
+ # Get RAW data for FILE statement\r
+ #\r
+ # @param self The object pointer\r
+ # @param FfsFileObj for whom section is got\r
+ # @param MacroDict dictionary used to replace macro\r
+ #\r
+ def __GetRAWData(self, FfsFileObj, MacroDict = {}):\r
+ FfsFileObj.FileName = []\r
+ FfsFileObj.SubAlignment = []\r
+ while True:\r
+ AlignValue = None\r
+ if self.__GetAlignment():\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
+ raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
+ #For FFS, Auto is default option same to ""\r
+ if not self.__Token == "Auto":\r
+ AlignValue = self.__Token\r
+ if not self.__GetNextToken():\r
+ raise Warning("expected Filename value", self.FileName, self.CurrentLineNumber)\r
+\r
+ FileName = self.__Token.replace('$(SPACE)', ' ')\r
+ if FileName == '}':\r
+ self.__UndoToken()\r
+ raise Warning("expected Filename value", self.FileName, self.CurrentLineNumber)\r
+\r
+ self.__VerifyFile(FileName)\r
+ File = PathClass(NormPath(FileName), GenFdsGlobalVariable.WorkSpaceDir)\r
+ FfsFileObj.FileName.append(File.Path)\r
+ FfsFileObj.SubAlignment.append(AlignValue)\r
+\r
+ if self.__IsToken( "}"):\r
+ self.__UndoToken()\r
+ break\r
+\r
+ if len(FfsFileObj.SubAlignment) == 1:\r
+ FfsFileObj.SubAlignment = FfsFileObj.SubAlignment[0]\r
+ if len(FfsFileObj.FileName) == 1:\r
+ FfsFileObj.FileName = FfsFileObj.FileName[0]\r
+\r
## __GetFileOpts() method\r
#\r
# Get options for FILE statement\r
FfsFileObj.CheckSum = True\r
\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
#For FFS, Auto is default option same to ""\r
if not self.__Token == "Auto":\r
\r
AlignValue = None\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
AlignValue = self.__Token\r
\r
\r
AlignValue = None\r
if self.__GetAlignment():\r
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
AlignValue = self.__Token\r
\r
else:\r
return True\r
\r
+ def __GetFmp(self):\r
+ if not self.__GetNextToken():\r
+ return False\r
+ S = self.__Token.upper()\r
+ if S.startswith("[") and not S.startswith("[FMPPAYLOAD."):\r
+ self.SectionParser(S)\r
+ self.__UndoToken()\r
+ return False\r
+\r
+ self.__UndoToken()\r
+ self.__SkipToToken("[FMPPAYLOAD.", True)\r
+ FmpUiName = self.__GetUiName().upper()\r
+ if FmpUiName in self.Profile.FmpPayloadDict:\r
+ raise Warning("Duplicated FMP UI name found: %s" % FmpUiName, self.FileName, self.CurrentLineNumber)\r
+\r
+ FmpData = CapsuleData.CapsulePayload()\r
+ FmpData.UiName = FmpUiName\r
+\r
+ if not self.__IsToken( "]"):\r
+ raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)\r
+\r
+ if not self.__GetNextToken():\r
+ raise Warning("The FMP payload section is empty!", self.FileName, self.CurrentLineNumber)\r
+ FmpKeyList = ['IMAGE_HEADER_INIT_VERSION', 'IMAGE_TYPE_ID', 'IMAGE_INDEX', 'HARDWARE_INSTANCE', 'CERTIFICATE_GUID', 'MONOTONIC_COUNT']\r
+ while self.__Token in FmpKeyList:\r
+ Name = self.__Token\r
+ FmpKeyList.remove(Name)\r
+ if not self.__IsToken("="):\r
+ raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
+ if Name == 'IMAGE_TYPE_ID':\r
+ if not self.__GetNextGuid():\r
+ raise Warning("expected GUID value for IMAGE_TYPE_ID.", self.FileName, self.CurrentLineNumber)\r
+ FmpData.ImageTypeId = self.__Token\r
+ elif Name == 'CERTIFICATE_GUID':\r
+ if not self.__GetNextGuid():\r
+ raise Warning("expected GUID value for CERTIFICATE_GUID.", self.FileName, self.CurrentLineNumber)\r
+ FmpData.Certificate_Guid = self.__Token\r
+ if uuid.UUID(FmpData.Certificate_Guid) != EFI_CERT_TYPE_RSA2048_SHA256_GUID and uuid.UUID(FmpData.Certificate_Guid) != EFI_CERT_TYPE_PKCS7_GUID:\r
+ raise Warning("Only support EFI_CERT_TYPE_RSA2048_SHA256_GUID or EFI_CERT_TYPE_PKCS7_GUID for CERTIFICATE_GUID.", self.FileName, self.CurrentLineNumber)\r
+ else:\r
+ if not self.__GetNextToken():\r
+ raise Warning("expected value of %s" % Name, self.FileName, self.CurrentLineNumber)\r
+ Value = self.__Token\r
+ if Name == 'IMAGE_HEADER_INIT_VERSION':\r
+ if self.__Verify(Name, Value, 'UINT8'):\r
+ FmpData.Version = Value\r
+ elif Name == 'IMAGE_INDEX':\r
+ if self.__Verify(Name, Value, 'UINT8'):\r
+ FmpData.ImageIndex = Value\r
+ elif Name == 'HARDWARE_INSTANCE':\r
+ if self.__Verify(Name, Value, 'UINT8'):\r
+ FmpData.HardwareInstance = Value\r
+ elif Name == 'MONOTONIC_COUNT':\r
+ if self.__Verify(Name, Value, 'UINT64'):\r
+ FmpData.MonotonicCount = Value\r
+ if FmpData.MonotonicCount.upper().startswith('0X'):\r
+ FmpData.MonotonicCount = (long)(FmpData.MonotonicCount, 16)\r
+ else:\r
+ FmpData.MonotonicCount = (long)(FmpData.MonotonicCount)\r
+ if not self.__GetNextToken():\r
+ break\r
+ else:\r
+ self.__UndoToken()\r
+\r
+ if (FmpData.MonotonicCount and not FmpData.Certificate_Guid) or (not FmpData.MonotonicCount and FmpData.Certificate_Guid):\r
+ EdkLogger.error("FdfParser", FORMAT_INVALID, "CERTIFICATE_GUID and MONOTONIC_COUNT must be work as a pair.")\r
+\r
+ # Only the IMAGE_TYPE_ID is required item\r
+ if FmpKeyList and 'IMAGE_TYPE_ID' in FmpKeyList:\r
+ raise Warning("Missing keywords IMAGE_TYPE_ID in FMP payload section.", self.FileName, self.CurrentLineNumber)\r
+ # get the Image file and Vendor code file\r
+ self.__GetFMPCapsuleData(FmpData)\r
+ if not FmpData.ImageFile:\r
+ raise Warning("Missing image file in FMP payload section.", self.FileName, self.CurrentLineNumber)\r
+ # check whether more than one Vendor code file\r
+ if len(FmpData.VendorCodeFile) > 1:\r
+ raise Warning("At most one Image file and one Vendor code file are allowed in FMP payload section.", self.FileName, self.CurrentLineNumber)\r
+ self.Profile.FmpPayloadDict[FmpUiName] = FmpData\r
+ return True\r
+\r
## __GetCapsule() method\r
#\r
# Get capsule section contents and store its data into capsule list of self.Profile\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[CAPSULE."):\r
- if not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):\r
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)\r
+ self.SectionParser(S)\r
self.__UndoToken()\r
return False\r
\r
def __GetCapsuleTokens(self, Obj):\r
if not self.__GetNextToken():\r
return False\r
- while self.__Token in ("CAPSULE_GUID", "CAPSULE_HEADER_SIZE", "CAPSULE_FLAGS", "OEM_CAPSULE_FLAGS"):\r
+ while self.__Token in ("CAPSULE_GUID", "CAPSULE_HEADER_SIZE", "CAPSULE_FLAGS", "OEM_CAPSULE_FLAGS", "CAPSULE_HEADER_INIT_VERSION"):\r
Name = self.__Token.strip()\r
if not self.__IsToken("="):\r
raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
IsFd = self.__GetFdStatement(Obj)\r
IsAnyFile = self.__GetAnyFileStatement(Obj)\r
IsAfile = self.__GetAfileStatement(Obj)\r
- if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile or IsAfile):\r
+ IsFmp = self.__GetFmpStatement(Obj)\r
+ if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile or IsAfile or IsFmp):\r
+ break\r
+\r
+ ## __GetFMPCapsuleData() method\r
+ #\r
+ # Get capsule data for FMP capsule\r
+ #\r
+ # @param self The object pointer\r
+ # @param Obj for whom capsule data are got\r
+ #\r
+ def __GetFMPCapsuleData(self, Obj):\r
+\r
+ while True:\r
+ IsFv = self.__GetFvStatement(Obj, True)\r
+ IsFd = self.__GetFdStatement(Obj, True)\r
+ IsAnyFile = self.__GetAnyFileStatement(Obj, True)\r
+ if not (IsFv or IsFd or IsAnyFile):\r
break\r
\r
## __GetFvStatement() method\r
# @retval True Successfully find a FV statement\r
# @retval False Not able to find a FV statement\r
#\r
- def __GetFvStatement(self, CapsuleObj):\r
+ def __GetFvStatement(self, CapsuleObj, FMPCapsule = False):\r
\r
if not self.__IsKeyword("FV"):\r
return False\r
\r
CapsuleFv = CapsuleData.CapsuleFv()\r
CapsuleFv.FvName = self.__Token\r
- CapsuleObj.CapsuleDataList.append(CapsuleFv)\r
+ if FMPCapsule:\r
+ if not CapsuleObj.ImageFile:\r
+ CapsuleObj.ImageFile.append(CapsuleFv)\r
+ else:\r
+ CapsuleObj.VendorCodeFile.append(CapsuleFv)\r
+ else:\r
+ CapsuleObj.CapsuleDataList.append(CapsuleFv)\r
return True\r
\r
## __GetFdStatement() method\r
# @retval True Successfully find a FD statement\r
# @retval False Not able to find a FD statement\r
#\r
- def __GetFdStatement(self, CapsuleObj):\r
+ def __GetFdStatement(self, CapsuleObj, FMPCapsule = False):\r
\r
if not self.__IsKeyword("FD"):\r
return False\r
\r
CapsuleFd = CapsuleData.CapsuleFd()\r
CapsuleFd.FdName = self.__Token\r
- CapsuleObj.CapsuleDataList.append(CapsuleFd)\r
+ if FMPCapsule:\r
+ if not CapsuleObj.ImageFile:\r
+ CapsuleObj.ImageFile.append(CapsuleFd)\r
+ else:\r
+ CapsuleObj.VendorCodeFile.append(CapsuleFd)\r
+ else:\r
+ CapsuleObj.CapsuleDataList.append(CapsuleFd)\r
return True\r
\r
- ## __GetAnyFileStatement() method\r
- #\r
- # Get AnyFile for capsule\r
- #\r
- # @param self The object pointer\r
- # @param CapsuleObj for whom AnyFile is got\r
- # @retval True Successfully find a Anyfile statement\r
- # @retval False Not able to find a AnyFile statement\r
- #\r
- def __GetAnyFileStatement(self, CapsuleObj):\r
+ def __GetFmpStatement(self, CapsuleObj):\r
+ if not self.__IsKeyword("FMP_PAYLOAD"):\r
+ if not self.__IsKeyword("FMP"):\r
+ return False\r
\r
+ if not self.__IsKeyword("PAYLOAD"):\r
+ self.__UndoToken()\r
+ return False\r
+\r
+ if not self.__IsToken("="):\r
+ raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
+\r
+ if not self.__GetNextToken():\r
+ raise Warning("expected payload name after FMP_PAYLOAD =", self.FileName, self.CurrentLineNumber)\r
+ Payload = self.__Token.upper()\r
+ if Payload not in self.Profile.FmpPayloadDict:\r
+ raise Warning("This FMP Payload does not exist: %s" % self.__Token, self.FileName, self.CurrentLineNumber)\r
+ CapsuleObj.FmpPayloadList.append(self.Profile.FmpPayloadDict[Payload])\r
+ return True\r
+\r
+ def __ParseRawFileStatement(self):\r
if not self.__IsKeyword("FILE"):\r
- return False\r
+ return None\r
\r
if not self.__IsKeyword("DATA"):\r
self.__UndoToken()\r
- return False\r
+ return None\r
\r
if not self.__IsToken("="):\r
raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
raise Warning("expected File name", self.FileName, self.CurrentLineNumber)\r
\r
AnyFileName = self.__Token\r
- AnyFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(AnyFileName)\r
- if not os.path.exists(AnyFileName):\r
- raise Warning("File %s not exists"%AnyFileName, self.FileName, self.CurrentLineNumber)\r
+ self.__VerifyFile(AnyFileName)\r
+\r
+ if not os.path.isabs(AnyFileName):\r
+ AnyFileName = mws.join(GenFdsGlobalVariable.WorkSpaceDir, AnyFileName)\r
+\r
+ return AnyFileName\r
+\r
+ ## __GetAnyFileStatement() method\r
+ #\r
+ # Get AnyFile for capsule\r
+ #\r
+ # @param self The object pointer\r
+ # @param CapsuleObj for whom AnyFile is got\r
+ # @retval True Successfully find a Anyfile statement\r
+ # @retval False Not able to find a AnyFile statement\r
+ #\r
+ def __GetAnyFileStatement(self, CapsuleObj, FMPCapsule = False):\r
+ AnyFileName = self.__ParseRawFileStatement()\r
+ if not AnyFileName:\r
+ return False\r
\r
CapsuleAnyFile = CapsuleData.CapsuleAnyFile()\r
CapsuleAnyFile.FileName = AnyFileName\r
- CapsuleObj.CapsuleDataList.append(CapsuleAnyFile)\r
+ if FMPCapsule:\r
+ if not CapsuleObj.ImageFile:\r
+ CapsuleObj.ImageFile.append(CapsuleAnyFile)\r
+ else:\r
+ CapsuleObj.VendorCodeFile.append(CapsuleAnyFile)\r
+ else:\r
+ CapsuleObj.CapsuleDataList.append(CapsuleAnyFile)\r
return True\r
\r
## __GetAfileStatement() method\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[RULE."):\r
- if not S.startswith("[OPTIONROM."):\r
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)\r
+ self.SectionParser(S)\r
self.__UndoToken()\r
return False\r
self.__UndoToken()\r
"DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \\r
"UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \\r
"SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \\r
- "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE"):\r
+ "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE", "MM_STANDALONE", "MM_CORE_STANDALONE"):\r
raise Warning("Unknown Module type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
return self.__Token\r
\r
#\r
def __GetFileExtension(self):\r
if not self.__IsToken("."):\r
- raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)\r
+ raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)\r
\r
Ext = ""\r
if self.__GetNextToken():\r
\r
Type = self.__Token.strip().upper()\r
if Type not in ("RAW", "FREEFORM", "SEC", "PEI_CORE", "PEIM",\\r
- "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE"):\r
+ "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE", "MM_STANDALONE", "MM_CORE_STANDALONE"):\r
raise Warning("Unknown FV type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
\r
if not self.__IsToken("="):\r
\r
AlignValue = ""\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
#For FFS, Auto is default option same to ""\r
if not self.__Token == "Auto":\r
\r
SectAlignment = ""\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):\r
raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)\r
FvImageSectionObj.FvFileType = self.__Token\r
\r
if self.__GetAlignment():\r
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
FvImageSectionObj.Alignment = self.__Token\r
\r
EfiSectionObj.BuildNum = self.__Token\r
\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):\r
raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[VTF."):\r
- if not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):\r
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)\r
+ self.SectionParser(S)\r
self.__UndoToken()\r
return False\r
\r
\r
S = self.__Token.upper()\r
if S.startswith("[") and not S.startswith("[OPTIONROM."):\r
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)\r
+ self.SectionParser(S)\r
+ self.__UndoToken()\r
+ return False\r
\r
self.__UndoToken()\r
if not self.__IsToken("[OptionRom.", True):\r
self.Profile.InfList.append(ffsInf.InfFileName)\r
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
self.Profile.InfFileLineList.append(FileLineTuple)\r
+ if ffsInf.UseArch:\r
+ if ffsInf.UseArch not in self.Profile.InfDict:\r
+ self.Profile.InfDict[ffsInf.UseArch] = [ffsInf.InfFileName]\r
+ else:\r
+ self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.InfFileName)\r
+ else:\r
+ self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)\r
\r
\r
self.__GetOptRomOverrides (ffsInf)\r
\r
return False\r
\r
+ def GetAllIncludedFile (self):\r
+ global AllIncludeFileList\r
+ return AllIncludeFileList\r
+\r
if __name__ == "__main__":\r
import sys\r
try:\r