+ def SetEnv(FdfParser, WorkSpace, ArchList, GlobalData):\r
+ GenFdsGlobalVariable.ModuleFile = WorkSpace.ModuleFile\r
+ GenFdsGlobalVariable.FdfParser = FdfParser\r
+ GenFdsGlobalVariable.WorkSpace = WorkSpace.Db\r
+ GenFdsGlobalVariable.ArchList = ArchList\r
+ GenFdsGlobalVariable.ToolChainTag = GlobalData.gGlobalDefines["TOOL_CHAIN_TAG"]\r
+ GenFdsGlobalVariable.TargetName = GlobalData.gGlobalDefines["TARGET"]\r
+ GenFdsGlobalVariable.ActivePlatform = GlobalData.gActivePlatform\r
+ GenFdsGlobalVariable.EdkSourceDir = GlobalData.gGlobalDefines["EDK_SOURCE"]\r
+ GenFdsGlobalVariable.ConfDir = GlobalData.gConfDirectory\r
+ GenFdsGlobalVariable.EnableGenfdsMultiThread = GlobalData.gEnableGenfdsMultiThread\r
+ for Arch in ArchList:\r
+ GenFdsGlobalVariable.OutputDirDict[Arch] = os.path.normpath(\r
+ os.path.join(GlobalData.gWorkspace,\r
+ WorkSpace.Db.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch,GlobalData.gGlobalDefines['TARGET'],\r
+ GlobalData.gGlobalDefines['TOOLCHAIN']].OutputDirectory,\r
+ GlobalData.gGlobalDefines['TARGET'] +'_' + GlobalData.gGlobalDefines['TOOLCHAIN']))\r
+ GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = os.path.normpath(\r
+ WorkSpace.Db.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch,\r
+ GlobalData.gGlobalDefines['TARGET'], GlobalData.gGlobalDefines['TOOLCHAIN']].OutputDirectory)\r
+ GenFdsGlobalVariable.PlatformName = WorkSpace.Db.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch,\r
+ GlobalData.gGlobalDefines['TARGET'],\r
+ GlobalData.gGlobalDefines['TOOLCHAIN']].PlatformName\r
+ GenFdsGlobalVariable.FvDir = os.path.join(GenFdsGlobalVariable.OutputDirDict[ArchList[0]], DataType.TAB_FV_DIRECTORY)\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
+\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
+ for Arch in ArchList:\r
+ BsAddress = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch,\r
+ GlobalData.gGlobalDefines['TARGET'],\r
+ GlobalData.gGlobalDefines["TOOL_CHAIN_TAG"]].BsBaseAddress\r
+ if BsAddress:\r
+ break\r
+\r
+ FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS = " + \\r
+ BsAddress + \\r
+ T_CHAR_LF)\r
+\r
+ RtAddress = '0'\r
+ for Arch in ArchList:\r
+ if GenFdsGlobalVariable.WorkSpace.BuildObject[\r
+ GenFdsGlobalVariable.ActivePlatform, Arch, GlobalData.gGlobalDefines['TARGET'],\r
+ GlobalData.gGlobalDefines["TOOL_CHAIN_TAG"]].RtBaseAddress:\r
+ RtAddress = GenFdsGlobalVariable.WorkSpace.BuildObject[\r
+ GenFdsGlobalVariable.ActivePlatform, Arch, GlobalData.gGlobalDefines['TARGET'],\r
+ GlobalData.gGlobalDefines["TOOL_CHAIN_TAG"]].RtBaseAddress\r
+\r
+ FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS = " + \\r
+ RtAddress + \\r
+ T_CHAR_LF)\r
+\r
+ FvAddressFile.close()\r
+\r