Change FvAddress.inf to FV\Ffs directory.
authorjlin16 <jlin16@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 16 Oct 2007 12:14:56 +0000 (12:14 +0000)
committerjlin16 <jlin16@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 16 Oct 2007 12:14:56 +0000 (12:14 +0000)
Generate FvAddress.inf only once.

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@826 7335b38e-4728-0410-8992-fb3ffe349368

15 files changed:
Source/Python/GenFds/CapsuleData.py
Source/Python/GenFds/CompressSection.py
Source/Python/GenFds/DataSection.py
Source/Python/GenFds/EfiSection.py
Source/Python/GenFds/FdfParser.py
Source/Python/GenFds/FfsFileStatement.py
Source/Python/GenFds/FfsInfStatement.py
Source/Python/GenFds/Fv.py
Source/Python/GenFds/GenFds.py
Source/Python/GenFds/GenFdsGlobalVariable.py
Source/Python/GenFds/GuidSection.py
Source/Python/GenFds/Section.py
Source/Python/GenFds/UiSection.py
Source/Python/GenFds/VerSection.py
Source/Python/GenFds/Vtf.py

index ba32fa9..db29737 100755 (executable)
@@ -80,5 +80,5 @@ class CapsuleFv (CapsuleData):
                 return FvFile\r
             \r
         else:\r
-            FvFile = GenFdsGlobalVariable.ReplaceWorkspaceMarco(self.FvName)\r
+            FvFile = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FvName)\r
             return FvFile\r
index 2b2264a..c8898d3 100755 (executable)
@@ -58,8 +58,8 @@ class CompressSection (CompressSectionClassObject) :
         # Generate all section\r
         #\r
         if FfsInf != None:\r
-            self.CompType = FfsInf.__ExtendMarco__(self.CompType)\r
-            self.Alignment = FfsInf.__ExtendMarco__(self.Alignment)\r
+            self.CompType = FfsInf.__ExtendMacro__(self.CompType)\r
+            self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
             \r
         SectFiles = ''\r
         Index = 0\r
index 4021fb1..a1b0995 100644 (file)
@@ -52,11 +52,11 @@ class DataSection (DataSectionClassObject):
         # Prepare the parameter of GenSection\r
         #\r
         if FfsInf != None:\r
-            self.Alignment = FfsInf.__ExtendMarco__(self.Alignemnt)\r
-            self.SecType = FfsInf.__ExtendMarco__(self.SecType)\r
-            self.SectFileName = FfsInf.__ExtendMarco__(self.SectFileName)\r
+            self.Alignment = FfsInf.__ExtendMacro__(self.Alignemnt)\r
+            self.SecType = FfsInf.__ExtendMacro__(self.SecType)\r
+            self.SectFileName = FfsInf.__ExtendMacro__(self.SectFileName)\r
         else:\r
-            self.SectFileName = GenFdsGlobalVariable.ReplaceWorkspaceMarco(self.SectFileName)\r
+            self.SectFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.SectFileName)\r
             \r
         self.SectFileName = GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)\r
         \r
index 23db6a2..18da09e 100644 (file)
@@ -52,13 +52,13 @@ class EfiSection (EfiSectionClassObject):
         """Prepare the parameter of GenSection"""\r
         if FfsInf != None :\r
             InfFileName = FfsInf.InfFileName\r
-            SectionType = FfsInf.__ExtendMarco__(self.SectionType)\r
-            Filename = FfsInf.__ExtendMarco__(self.FileName)\r
+            SectionType = FfsInf.__ExtendMacro__(self.SectionType)\r
+            Filename = FfsInf.__ExtendMacro__(self.FileName)\r
             """print 'Buile Num: %s' %self.BuildNum"""\r
-            BuildNum = FfsInf.__ExtendMarco__(self.BuildNum)\r
+            BuildNum = FfsInf.__ExtendMacro__(self.BuildNum)\r
             """print 'After extend Build Num: %s' %self.BuildNum"""\r
             \r
-            StringData = FfsInf.__ExtendMarco__(self.StringData)\r
+            StringData = FfsInf.__ExtendMacro__(self.StringData)\r
             \r
         else:\r
             SectionType = self.SectionType\r
@@ -240,7 +240,7 @@ class EfiSection (EfiSectionClassObject):
                      GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")\r
                      return [], None\r
                 else:\r
-                     raise Exception("Section with type %s could not be found for %s" % (SectionType, InfFileName))\r
+                     raise Exception("Output file for %s section could not be found for %s" % (SectionType, InfFileName))\r
             \r
             else:\r
                 """Convert the File to Section file one by one """\r
index c0fc397..8e673f1 100644 (file)
@@ -32,7 +32,6 @@ import CapsuleData
 import Rule\r
 import RuleComplexFile\r
 import RuleSimpleFile\r
-import RuleFileExtension\r
 import EfiSection\r
 import Vtf\r
 import ComponentStatement\r
@@ -735,7 +734,7 @@ class FdfParser:
         FdObj = Fd.FD()\r
         FdObj.FdUiName = self.CurrentFdName\r
         self.Profile.FdDict[self.CurrentFdName] = FdObj\r
-        Status = self.__GetCreateFile( FdObj)\r
+        Status = self.__GetCreateFile(FdObj)\r
         if not Status:\r
             raise Warning("FD name error At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
         \r
@@ -1051,7 +1050,7 @@ class FdfParser:
         if not self.__Token in ("SET", "FV", "FILE", "DATA"):\r
             self.__UndoToken()\r
             RegionObj.PcdOffset = self.__GetNextPcdName()\r
-            self.Profile.PcdDict[RegionObj.PcdOffset] = RegionObj.Offset + long(fd.BaseAddress, 0)\r
+            self.Profile.PcdDict[RegionObj.PcdOffset] = RegionObj.Offset + long(Fd.BaseAddress, 0)\r
             if self.__IsToken( "|"):\r
                 RegionObj.PcdSize = self.__GetNextPcdName()\r
                 self.Profile.PcdDict[RegionObj.PcdSize] = RegionObj.Size\r
@@ -1239,38 +1238,38 @@ class FdfParser:
                     % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], self.CurrentLineNumber, self.CurrentOffsetWithinLine)\r
             raise Warning("Unknown Keyword At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
         \r
-        fvName = self.__GetUiName()\r
-        self.CurrentFvName = fvName.upper()\r
+        FvName = self.__GetUiName()\r
+        self.CurrentFvName = FvName.upper()\r
         \r
         if not self.__IsToken( "]"):\r
             raise Warning("expected ']' At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
         \r
-        fv = Fv.FV()\r
-        fv.UiFvName = self.CurrentFvName\r
-        self.Profile.FvDict[self.CurrentFvName] = fv\r
+        FvObj = Fv.FV()\r
+        FvObj.UiFvName = self.CurrentFvName\r
+        self.Profile.FvDict[self.CurrentFvName] = FvObj\r
         \r
-        Status = self.__GetCreateFile( fv)\r
+        Status = self.__GetCreateFile(FvObj)\r
         if not Status:\r
             raise Warning("FV name error At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
 \r
-        self.__GetDefineStatements( fv)\r
+        self.__GetDefineStatements(FvObj)\r
 \r
-        self.__GetAddressStatements (fv)\r
+        self.__GetAddressStatements(FvObj)\r
         \r
-        self.__GetBlockStatement( fv)\r
+        self.__GetBlockStatement(FvObj)\r
 \r
-        self.__GetSetStatements( fv)\r
+        self.__GetSetStatements(FvObj)\r
 \r
-        self.__GetFvAlignment( fv)\r
+        self.__GetFvAlignment(FvObj)\r
 \r
-        self.__GetFvAttributes( fv)\r
+        self.__GetFvAttributes(FvObj)\r
         \r
-        self.__GetAprioriSection( fv, fv.DefineVarDict.copy())\r
-        self.__GetAprioriSection( fv, fv.DefineVarDict.copy())\r
+        self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())\r
+        self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())\r
         \r
         while True:\r
-            isInf = self.__GetInfStatement( fv, MacroDict = fv.DefineVarDict.copy())\r
-            isFile = self.__GetFileStatement( fv, MacroDict = fv.DefineVarDict.copy())\r
+            isInf = self.__GetInfStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())\r
+            isFile = self.__GetFileStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())\r
             if not isInf and not isFile:\r
                 break\r
         \r
@@ -1331,7 +1330,7 @@ class FdfParser:
             if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):\r
                 raise Warning("expected TRUE/FALSE (1/0) At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
             \r
-            fv.FvAttributeDict[name] = self.__Token\r
+            FvObj.FvAttributeDict[name] = self.__Token\r
 \r
         return\r
 \r
@@ -1800,7 +1799,7 @@ class FdfParser:
             if not self.__IsToken("{"):\r
                 raise Warning("expected '{' At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
             GuidSectionObj = GuidSection.GuidSection()\r
-            GuidSectionObj.Alignment = alignment\r
+            GuidSectionObj.Alignment = AlignValue\r
             GuidSectionObj.NameGuid = GuidValue\r
             GuidSectionObj.SectionType = "GUIDED"\r
             GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]\r
@@ -1814,7 +1813,7 @@ class FdfParser:
             \r
             if not self.__IsToken( "}"):\r
                 raise Warning("expected '}' At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
-            obj.SectionList.append(GuidSectionObj)\r
+            Obj.SectionList.append(GuidSectionObj)\r
                 \r
             return True\r
         \r
@@ -2266,7 +2265,6 @@ class FdfParser:
                 pass\r
             if self.__IsToken( "{"):\r
                 FvObj = Fv.FV()\r
-#                fv.UiFvName = fvName\r
                 self.__GetDefineStatements(FvObj)\r
                 self.__GetBlockStatement(FvObj)\r
                 self.__GetSetStatements(FvObj)\r
@@ -2530,7 +2528,7 @@ class FdfParser:
             \r
             if not self.__IsToken( "}"):\r
                 raise Warning("expected '}' At Line %d" % self.CurrentLineNumber, self.FileName, self.CurrentLineNumber)\r
-            rule.SectionList.append(GuidSectionObj)\r
+            Rule.SectionList.append(GuidSectionObj)\r
 \r
             return True\r
 \r
index 65f3cb0..2952ef7 100755 (executable)
@@ -66,7 +66,7 @@ class FileStatements (FileStatementsClassObject) :
             SectionFiles = ' -i ' + FileName\r
         \r
         elif self.FileName != None:\r
-            self.FileName = GenFdsGlobalVariable.ReplaceWorkspaceMarco(self.FileName)\r
+            self.FileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)\r
             SectionFiles = ' -i ' + GenFdsGlobalVariable.MacroExtend(self.FileName, Dict)\r
             \r
         else:\r
index 4b61a01..e38387b 100644 (file)
@@ -170,14 +170,16 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #   @retval Rule        Rule object\r
     # \r
     def __GetRule__ (self) :\r
-        CurrentArchList = self.CurrentArch\r
-        if CurrentArchList == None:\r
+        CurrentArchList = []\r
+        if self.CurrentArch == None:\r
             CurrentArchList = ['common']\r
+        else:\r
+            CurrentArchList.append(self.CurrentArch)\r
         \r
-        for currentArch in CurrentArchList:\r
+        for CurrentArch in CurrentArchList:\r
             RuleName = 'RULE'              + \\r
                        '.'                 + \\r
-                       currentArch.upper() + \\r
+                       CurrentArch.upper() + \\r
                        '.'                 + \\r
                        self.ModuleType.upper()\r
             if self.Rule != None:\r
@@ -295,7 +297,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         if self.CurrentArch != None:\r
             Arch = self.CurrentArch\r
         \r
-        OutputPath = os.path.join(GenFdsGlobalVariable.OuputDir,\r
+        OutputPath = os.path.join(GenFdsGlobalVariable.OutputDir,\r
                                   Arch ,\r
                                   ModulePath,\r
                                   FileName,\r
index 8057244..70fedc0 100644 (file)
@@ -98,7 +98,7 @@ class FV (FvClassObject):
                ' -o '                     + \\r
                FvOutputFile               + \\r
                ' -a '                     + \\r
-               self.FvAddressFileName\r
+               GenFdsGlobalVariable.FvAddressFileName\r
         #\r
         # Call GenFv Tools\r
         #\r
@@ -133,7 +133,7 @@ class FV (FvClassObject):
         #\r
         self.InfFileName = os.path.join(GenFdsGlobalVariable.FvDir,\r
                                    self.UiFvName + '.inf')\r
-        self.FvInfFile = open (self.InfFileName, 'w+')\r
+        self.FvInfFile = open (self.InfFileName, 'w')\r
         \r
         #\r
         # Add [Options]\r
@@ -199,36 +199,5 @@ class FV (FvClassObject):
             self.FvInfFile.writelines("EFI_FILE_NAME = "                   + \\r
                                        VtfDict.get(self.UiFvName)          + \\r
                                        T_CHAR_LF)\r
-        \r
 \r
-        #\r
-        # Create FV Address inf file\r
-        #\r
-        self.FvAddressFileName = os.path.join(GenFdsGlobalVariable.FvDir,\r
-                                   'FvAddress.inf')\r
-        self.FvAddressFile = open (self.FvAddressFileName, 'w+')\r
-        #\r
-        # Add [Options]\r
-        #\r
-        self.FvAddressFile.writelines("[options]" + T_CHAR_LF)\r
-        BsAddress = '0'\r
-        if 'BsBaseAddress' in GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary.keys():\r
-            BsAddressList = GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary['BsBaseAddress']\r
-            if BsAddressList != []:\r
-                BsAddress = BsAddressList[0]\r
-        \r
-        self.FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS = " + \\r
-                                       BsAddress          + \\r
-                                       T_CHAR_LF)\r
-                                       \r
-        RtAddress = '0'\r
-        if 'RtBaseAddress' in GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary.keys():\r
-            RtAddressList = GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary['RtBaseAddress']\r
-            if RtAddressList != []:\r
-                RtAddress = RtAddressList[0]\r
-                \r
-        self.FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS = " + \\r
-                                       RtAddress          + \\r
-                                       T_CHAR_LF)\r
-        \r
-        self.FvAddressFile.close()\r
+        
\ No newline at end of file
index 9ca317d..ec85e40 100644 (file)
@@ -74,7 +74,7 @@ def main():
     \r
         if (Options.filename):\r
             FdfFilename = Options.filename\r
-            FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMarco(FdfFilename)\r
+            FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)\r
         else:\r
             GenFdsGlobalVariable.ErrorLogger("You must specify an input filename")\r
             sys.exit(1)\r
@@ -102,7 +102,7 @@ def main():
     \r
         if (Options.activePlatform):\r
             ActivePlatform = Options.activePlatform\r
-            ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMarco(ActivePlatform)\r
+            ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)\r
     \r
             if ActivePlatform[0:2] == '..':\r
                 ActivePlatform = os.path.realpath(ActivePlatform)\r
@@ -144,7 +144,7 @@ def main():
         \r
         if (Options.outputDir):\r
             OutputDir = Options.outputDir\r
-            OutputDir = GenFdsGlobalVariable.ReplaceWorkspaceMarco(OutputDir)\r
+            OutputDir = GenFdsGlobalVariable.ReplaceWorkspaceMacro(OutputDir)\r
         else:\r
             OutputDir = os.path.join(GenFdsGlobalVariable.OutputDirFromDsc, GenFdsGlobalVariable.TargetName + '_' + GenFdsGlobalVariable.ToolChainTag)        \r
     \r
@@ -160,34 +160,34 @@ def main():
     \r
         """ Parse Fdf file, has to place after build Workspace as FDF may contain macros from DSC file """\r
         try:\r
-            FdfParser = FdfParser.FdfParser(FdfFilename)\r
-            FdfParser.ParseFile()\r
+            FdfParserObj = FdfParser.FdfParser(FdfFilename)\r
+            FdfParserObj.ParseFile()\r
         except FdfParser.Warning, X:\r
             EdkLogger.error(X.ToolName, BuildToolError.GENFDS_ERROR, X.message, X.FileName, X.LineNumber, RaiseError = False)    \r
             sys.exit(1)\r
             \r
-        if FdfParser.CycleReferenceCheck():\r
+        if FdfParserObj.CycleReferenceCheck():\r
             GenFdsGlobalVariable.InfLogger ("ERROR: Cycle Reference Detected in FDF file")\r
             sys.exit(1)\r
         \r
         if (Options.uiFdName) :\r
-            if Options.uiFdName.upper() in FdfParser.Profile.FdDict.keys():\r
+            if Options.uiFdName.upper() in FdfParserObj.Profile.FdDict.keys():\r
                 GenFds.currentFd = Options.uiFdName\r
             else:\r
                 GenFdsGlobalVariable.ErrorLogger("No such an FD in FDF file.")\r
                 sys.exit(1)\r
     \r
         if (Options.uiFvName) :\r
-            if Options.uiFvName.upper() in FdfParser.Profile.FvDict.keys():\r
+            if Options.uiFvName.upper() in FdfParserObj.Profile.FvDict.keys():\r
                 GenFds.currentFv = Options.uiFvName\r
             else:\r
                 GenFdsGlobalVariable.ErrorLogger("No such an FV in FDF file.")\r
                 sys.exit(1)\r
             \r
-        BuildWorkSpace.GenBuildDatabase({}, FdfParser.Profile.InfList)\r
+        BuildWorkSpace.GenBuildDatabase({}, FdfParserObj.Profile.InfList)\r
         \r
         """Call GenFds"""\r
-        GenFds.GenFd(OutputDir, FdfParser, BuildWorkSpace, ArchList)\r
+        GenFds.GenFd(OutputDir, FdfParserObj, BuildWorkSpace, ArchList)\r
         print "\nDone!\n"\r
     except Exception, X:\r
         EdkLogger.error("GenFds", BuildToolError.GENFDS_ERROR, X, RaiseError = False)\r
index 581c727..1bed986 100644 (file)
@@ -26,7 +26,7 @@ from Common import EdkLogger
 #\r
 class GenFdsGlobalVariable:\r
     FvDir = ''\r
-    OuputDir = ''\r
+    OutputDir = ''\r
     BinDir = ''\r
     # will be FvDir + os.sep + 'Ffs'\r
     FfsDir = ''\r
@@ -43,6 +43,7 @@ class GenFdsGlobalVariable:
     ArchList = None\r
     VtfDict = {}\r
     ActivePlatform = None\r
+    FvAddressFileName = ''\r
     VerboseMode = False\r
     SharpCounter = 0\r
     SharpNumberPerLine = 40\r
@@ -55,17 +56,51 @@ class GenFdsGlobalVariable:
     #   @param  ArchList            The Arch list of platform\r
     #\r
     def SetDir (OutputDir, FdfParser, WorkSpace, ArchList):\r
-        GenFdsGlobalVariable.VerboseLogger( "GenFdsGlobalVariable.OuputDir :%s" %OutputDir)\r
-        GenFdsGlobalVariable.OuputDir = os.path.normpath(OutputDir)\r
+        GenFdsGlobalVariable.VerboseLogger( "GenFdsGlobalVariable.OutputDir :%s" %OutputDir)\r
+        GenFdsGlobalVariable.OutputDir = os.path.normpath(OutputDir)\r
         GenFdsGlobalVariable.FdfParser = FdfParser\r
         GenFdsGlobalVariable.WorkSpace = WorkSpace\r
-        GenFdsGlobalVariable.FvDir = os.path.join(GenFdsGlobalVariable.OuputDir, 'Fv')\r
+        GenFdsGlobalVariable.FvDir = os.path.join(GenFdsGlobalVariable.OutputDir, 'FV')\r
+        if not os.path.exists(GenFdsGlobalVariable.FvDir) :\r
+            os.makedirs(GenFdsGlobalVariable.FvDir)\r
         GenFdsGlobalVariable.FfsDir = os.path.join(GenFdsGlobalVariable.FvDir, 'Ffs')\r
+        if not os.path.exists(GenFdsGlobalVariable.FfsDir) :\r
+            os.makedirs(GenFdsGlobalVariable.FfsDir)\r
         if ArchList != None:\r
             GenFdsGlobalVariable.ArchList = ArchList\r
-            \r
-        if not os.path.exists(GenFdsGlobalVariable.FvDir) :\r
-            os.makedirs(GenFdsGlobalVariable.FvDir)\r
+        \r
+        T_CHAR_LF = '\n'    \r
+        #\r
+        # Create FV Address inf file\r
+        #\r
+        GenFdsGlobalVariable.FvAddressFileName = os.path.join(GenFdsGlobalVariable.FfsDir, 'FvAddress.inf')\r
+        FvAddressFile = open (GenFdsGlobalVariable.FvAddressFileName, 'w')\r
+        #\r
+        # Add [Options]\r
+        #\r
+        FvAddressFile.writelines("[options]" + T_CHAR_LF)\r
+        BsAddress = '0'\r
+        if 'BsBaseAddress' in GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary.keys():\r
+            BsAddressList = GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary['BsBaseAddress']\r
+            if BsAddressList != []:\r
+                BsAddress = BsAddressList[0]\r
+        \r
+        FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS = " + \\r
+                                       BsAddress          + \\r
+                                       T_CHAR_LF)\r
+                                       \r
+        RtAddress = '0'\r
+        if 'RtBaseAddress' in GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary.keys():\r
+            RtAddressList = GenFdsGlobalVariable.WorkSpace.DscDatabase[GenFdsGlobalVariable.ActivePlatform].Defines.DefinesDictionary['RtBaseAddress']\r
+            if RtAddressList != []:\r
+                RtAddress = RtAddressList[0]\r
+                \r
+        FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS = " + \\r
+                                       RtAddress          + \\r
+                                       T_CHAR_LF)\r
+        \r
+        FvAddressFile.close()\r
+\r
     \r
     ## SetDefaultRule()\r
     #\r
index cd3ea82..f9bb8ae 100755 (executable)
@@ -56,9 +56,9 @@ class GuidSection(GuidSectionClassObject) :
         self.KeyStringList = KeyStringList\r
         \r
         if FfsInf != None:\r
-            self.Alignment = FfsInf.__ExtendMarco__(self.Alignment)\r
-            self.NameGuid = FfsInf.__ExtendMarco__(self.NameGuid)\r
-            self.SectionType = FfsInf.__ExtendMarco__(self.SectionType)\r
+            self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
+            self.NameGuid = FfsInf.__ExtendMacro__(self.NameGuid)\r
+            self.SectionType = FfsInf.__ExtendMacro__(self.SectionType)\r
             \r
         SectFile = ''\r
         Index = 0\r
index 45c10c0..292d4a6 100755 (executable)
@@ -123,15 +123,19 @@ class Section (SectionClassObject):
             raise Exception ('Inf File does not exist!')\r
         \r
         FileList = []\r
-        for File in FfsInf.BinFileList :\r
-            if File.FileType == FileType and FfsInf.CurrentArch in File.SupArchList:\r
-                if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:\r
-                    FileList.append(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FfsInf.SourceDir, File.BinaryFile))\r
+        if FileType != None:\r
+            for File in FfsInf.BinFileList:\r
+                if FfsInf.CurrentArch in File.SupArchList:\r
+                    if File.FileType == FileType:\r
+                        if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:\r
+                            FileList.append(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FfsInf.SourceDir, File.BinaryFile))\r
+                        else:\r
+                            GenFdsGlobalVariable.InfLogger ("\nBuild Target \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(File.Target, File.BinaryFile, FfsInf.TargetOverrideList, FfsInf.InfFileName))\r
+                    else:\r
+                        GenFdsGlobalVariable.InfLogger ("\nFile Type \'%s\' of File %s is not same with %s from rule in FDF" %(File.FileType, FileType))\r
                 else:\r
-                    GenFdsGlobalVariable.InfLogger ("\nBuild Target \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(File.Target, File.BinaryFile, FfsInf.TargetOverrideList, FfsInf.InfFileName))\r
-            else:\r
-                    GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.BinaryFile, File.SupArchList, FfsInf.InfFileName))\r
-        \r
+                        GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.BinaryFile, File.SupArchList, FfsInf.InfFileName))\r
+            \r
         if os.path.exists(FfsInf.EfiOutputPath):\r
             for FileName in os.listdir(FfsInf.EfiOutputPath):\r
                 Name, Ext = os.path.splitext(FileName)\r
index 6bde403..6c0ed31 100644 (file)
@@ -52,16 +52,16 @@ class UiSection (UiSectionClassObject):
         # Prepare the parameter of GenSection\r
         #\r
         if FfsInf != None:\r
-            self.Alignment = FfsInf.__ExtendMarco__(self.Alignment)\r
-            self.StringData = FfsInf.__ExtendMarco__(self.StringData)\r
-            self.FileName = FfsInf.__ExtendMarco__(self.FileName)\r
+            self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
+            self.StringData = FfsInf.__ExtendMacro__(self.StringData)\r
+            self.FileName = FfsInf.__ExtendMacro__(self.FileName)\r
             \r
         OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get('UI'))\r
                      \r
         if self.StringData != None :\r
             NameString = self.StringData\r
         elif self.FileName != None:\r
-            FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMarco(self.FileName)\r
+            FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)\r
             FileNameStr = GenFdsGlobalVariable.MacroExtend(FileNameStr, Dict)\r
             FileObj = open(FileNameStr, 'r')\r
             NameString = FileObj.read()\r
index 8b56c14..c50b472 100644 (file)
@@ -52,10 +52,10 @@ class VerSection (VerSectionClassObject):
         # Prepare the parameter of GenSection\r
         #\r
         if FfsInf != None:\r
-            self.Alignment = FfsInf.__ExtendMarco__(self.Alignment)\r
-            self.BuildNum = FfsInf.__ExtendMarco__(self.BuildNum)\r
-            self.StringData = FfsInf.__ExtendMarco__(self.StringData)\r
-            self.FileName = FfsInf.__ExtendMarco__(self.FileName)\r
+            self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
+            self.BuildNum = FfsInf.__ExtendMacro__(self.BuildNum)\r
+            self.StringData = FfsInf.__ExtendMacro__(self.StringData)\r
+            self.FileName = FfsInf.__ExtendMacro__(self.FileName)\r
             \r
         OutputFile = os.path.join(OutputPath,\r
                                   ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get('VERSION'))\r
@@ -71,7 +71,7 @@ class VerSection (VerSectionClassObject):
         if self.StringData != None:\r
              StringData = self.StringData\r
         elif self.FileName != None:\r
-            FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMarco(self.FileName)\r
+            FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)\r
             FileNameStr = GenFdsGlobalVariable.MacroExtend(FileNameStr, Dict)\r
             FileObj = open (FileNameStr, 'r')\r
             StringData = FileObj.read()\r
index a18518b..cabcb88 100755 (executable)
@@ -37,13 +37,13 @@ class Vtf (VtfClassObject):
     #   Generate VTF\r
     #\r
     #   @param  self        The object pointer\r
-    #   @param  FdAddDict   dictionary contains FV name and its base address\r
+    #   @param  FdAddressDict   dictionary contains FV name and its base address\r
     #   @retval Dict        FV and corresponding VTF file name\r
     #\r
-    def GenVtf(self, fdAddDict) :\r
+    def GenVtf(self, FdAddressDict) :\r
         self.GenBsfInf()\r
         OutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.Vtf')\r
-        BaseAddArg = self.GetBaseAddressArg(fdAddDict)\r
+        BaseAddArg = self.GetBaseAddressArg(FdAddressDict)\r
         OutputArg, VtfRawDict = self.GenOutputArg()\r
         \r
         Cmd = "GenVtf "        + \\r
@@ -114,7 +114,7 @@ class Vtf (VtfClassObject):
             \r
             BinPath = ComponentObj.CompBin\r
             if BinPath != '-':\r
-                BinPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMarco(BinPath))\r
+                BinPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(BinPath))\r
             BsfInf.writelines ("COMP_BIN"        + \\r
                                " = "             + \\r
                                BinPath + \\r
@@ -122,7 +122,7 @@ class Vtf (VtfClassObject):
             \r
             SymPath = ComponentObj.CompSym\r
             if SymPath != '-':\r
-                SymPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMarco(SymPath))\r
+                SymPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(SymPath))\r
             BsfInf.writelines ("COMP_SYM"        + \\r
                                " = "             + \\r
                                SymPath + \\r
@@ -142,12 +142,12 @@ class Vtf (VtfClassObject):
     #   @param  self        The object pointer\r
     #\r
     def GetFvList(self):\r
-        fvList = []\r
+        FvList = []\r
         for component in self.ComponentStatementList :\r
-            if component.CompLoc.upper() != 'NONE' and not (component.CompLoc.upper() in fvList):\r
-                fvList.append(component.CompLoc.upper())\r
+            if component.CompLoc.upper() != 'NONE' and not (component.CompLoc.upper() in FvList):\r
+                FvList.append(component.CompLoc.upper())\r
                 \r
-        return fvList\r
+        return FvList\r
 \r
     ## GetBaseAddressArg() method\r
     #\r