Sync BaseTools Branch (version r2271) to EDKII main trunk.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Aug 2011 07:46:26 +0000 (07:46 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Aug 2011 07:46:26 +0000 (07:46 +0000)
  BaseTool Branch:
  https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/branches/Releases/BaseTools_r2100

Signed-off-by: lgao4
Reviewed-by: hchen30
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12214 6f19259b-4bc3-4df7-8a09-765794883524

186 files changed:
BaseTools/Bin/Win32/BPDG.exe
BaseTools/Bin/Win32/BootSectImage.exe
BaseTools/Bin/Win32/EfiLdrImage.exe
BaseTools/Bin/Win32/EfiRom.exe
BaseTools/Bin/Win32/Fpd2Dsc.exe
BaseTools/Bin/Win32/GenBootSector.exe
BaseTools/Bin/Win32/GenCrc32.exe
BaseTools/Bin/Win32/GenDepex.exe
BaseTools/Bin/Win32/GenFds.exe
BaseTools/Bin/Win32/GenFfs.exe
BaseTools/Bin/Win32/GenFv.exe
BaseTools/Bin/Win32/GenFw.exe
BaseTools/Bin/Win32/GenPage.exe
BaseTools/Bin/Win32/GenPatchPcdTable.exe
BaseTools/Bin/Win32/GenSec.exe
BaseTools/Bin/Win32/GenVtf.exe
BaseTools/Bin/Win32/LzmaCompress.exe
BaseTools/Bin/Win32/MigrationMsa2Inf.exe
BaseTools/Bin/Win32/PatchPcdValue.exe
BaseTools/Bin/Win32/Spd2Dec.exe
BaseTools/Bin/Win32/Split.exe
BaseTools/Bin/Win32/TargetTool.exe
BaseTools/Bin/Win32/TianoCompress.exe
BaseTools/Bin/Win32/Trim.exe
BaseTools/Bin/Win32/UPT.exe [new file with mode: 0644]
BaseTools/Bin/Win32/VfrCompile.exe
BaseTools/Bin/Win32/VolInfo.exe
BaseTools/Bin/Win32/_ctypes.pyd [new file with mode: 0644]
BaseTools/Bin/Win32/build.exe
BaseTools/BuildNotes.txt
BaseTools/Conf/Empty_Package_Information_Data_File.ini [new file with mode: 0644]
BaseTools/Conf/XMLSchema/DistributionPackage.xsd
BaseTools/Conf/build_rule.template
BaseTools/Conf/target.template
BaseTools/Conf/tools_def.template
BaseTools/Source/C/Common/ParseInf.h
BaseTools/Source/C/GenPage/GenPage.c
BaseTools/Source/C/Include/Common/MdeModuleHii.h
BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
BaseTools/Source/C/Include/Protocol/DevicePath.h [deleted file]
BaseTools/Source/C/VfrCompile/EfiVfr.h
BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
BaseTools/Source/C/VfrCompile/VfrCompiler.h
BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
BaseTools/Source/C/VfrCompile/VfrFormPkg.h
BaseTools/Source/C/VfrCompile/VfrSyntax.g
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/AutoGen/GenC.py
BaseTools/Source/Python/AutoGen/GenMake.py
BaseTools/Source/Python/Common/BuildToolError.py
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/Fv.py
BaseTools/Source/Python/GenFds/GenFds.py
BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools/Source/Python/GenFds/Region.py
BaseTools/Source/Python/GenFds/Section.py
BaseTools/Source/Python/Makefile
BaseTools/Source/Python/PackagingTool/DependencyRules.py [deleted file]
BaseTools/Source/Python/PackagingTool/InstallPkg.py [deleted file]
BaseTools/Source/Python/PackagingTool/IpiDb.py [deleted file]
BaseTools/Source/Python/PackagingTool/MkPkg.py [deleted file]
BaseTools/Source/Python/PackagingTool/PackageFile.py [deleted file]
BaseTools/Source/Python/PackagingTool/RmPkg.py [deleted file]
BaseTools/Source/Python/UPT/Core/DependencyRules.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Core/IpiDb.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Core/PackageFile.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Core/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Dll/sqlite3.dll [new file with mode: 0644]
BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/GenMetaFile/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/InstallPkg.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/CommentGenerating.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/CommentParsing.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/DataType.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/ExpressionValidate.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/GlobalData.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/Misc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/ParserValidate.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/Parsing.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/String.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/Xml/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Library/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Logger/Log.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Logger/StringTable.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Logger/ToolError.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Logger/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Makefile [new file with mode: 0644]
BaseTools/Source/Python/UPT/MkPkg.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/POM/CommonObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/POM/PackageObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/POM/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/DecObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/Parser/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Object/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/DecParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/DecParserMisc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfParserMisc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Parser/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/PomAdapter/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/RmPkg.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/UPT.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/CommonXml.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/IniToXml.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/PcdXml.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/XmlParser.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py [new file with mode: 0644]
BaseTools/Source/Python/UPT/Xml/__init__.py [new file with mode: 0644]
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools/Source/Python/build/build.py
BaseTools/UserManuals/BootSectImage_Utility_Man_Page.rtf
BaseTools/UserManuals/Build_Utility_Man_Page.rtf
BaseTools/UserManuals/EfiLdrImage_Utility_Man_Page.rtf
BaseTools/UserManuals/Fpd2Dsc_Utility_Man_Page.rtf
BaseTools/UserManuals/GenBootSector_Utility_Man_Page.rtf
BaseTools/UserManuals/GenCrc32_Utility_Man_Page.rtf
BaseTools/UserManuals/GenDepex_Utility_Man_Page.rtf
BaseTools/UserManuals/GenFds_Utility_Man_Page.rtf
BaseTools/UserManuals/GenFfs_Utility_Man_Page.rtf
BaseTools/UserManuals/GenFv_Utility_Man_Page.rtf
BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
BaseTools/UserManuals/GenPage_Utility_Man_Page.rtf
BaseTools/UserManuals/GenPatchPcdTable_Utility_Man_Page.rtf
BaseTools/UserManuals/GenSec_Utility_Man_Page.rtf
BaseTools/UserManuals/GenVtf_Utility_Man_Page.rtf
BaseTools/UserManuals/InstallPkg_Utility_Man_Page.rtf [deleted file]
BaseTools/UserManuals/Intel_UEFI_Packaging_Tool_Man_Page.rtf [new file with mode: 0644]
BaseTools/UserManuals/LzmaCompress_Utility_Man_Page.rtf
BaseTools/UserManuals/MkPkg_Utility_Man_Page.rtf [deleted file]
BaseTools/UserManuals/Msa2Inf_Utility_Man_Page.rtf
BaseTools/UserManuals/RmPkg_Utility_Man_Page.rtf [deleted file]
BaseTools/UserManuals/Spd2Dec_Utility_Man_Page.rtf
BaseTools/UserManuals/SplitFile_Utility_Man_Page.rtf
BaseTools/UserManuals/TargetTool_Utility_Man_Page.rtf
BaseTools/UserManuals/TianoCompress_Utility_Man_Page.rtf
BaseTools/UserManuals/Trim_Utility_Man_Page.rtf
BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf
BaseTools/UserManuals/VolInfo_Utility_Man_Page.rtf

index 9ae44536a67b8a12ce5731101062cdd9ca690f52..b7096d7ac96efa5f1a7ea3f141b21ba21b17d3ff 100644 (file)
Binary files a/BaseTools/Bin/Win32/BPDG.exe and b/BaseTools/Bin/Win32/BPDG.exe differ
index e5a305e772c08a2694e50e626d029b23421ebd87..7428d0e6810033ab42f331888b04b50081bf70ba 100755 (executable)
Binary files a/BaseTools/Bin/Win32/BootSectImage.exe and b/BaseTools/Bin/Win32/BootSectImage.exe differ
index 41b421777ba75e7af33662d6b8129e67f005e55b..65613a954c2df11adb08487e39a42558e1ad29f4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiLdrImage.exe and b/BaseTools/Bin/Win32/EfiLdrImage.exe differ
index d64e5e7bb9ae94ab08410433a61e0129a42ff455..335d43b6bde2750102d0126d420b9c245a822055 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiRom.exe and b/BaseTools/Bin/Win32/EfiRom.exe differ
index 4a0cd59f9476f9a41c3201e680b9757f1f75b81d..9d58d0374427c02dccacd7ee42361769317c1b80 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Fpd2Dsc.exe and b/BaseTools/Bin/Win32/Fpd2Dsc.exe differ
index 35cdca595f9f64cbb80c813e63aa01bce85649bb..3cbefe887455299ffbf22e30fa4c58c00aa27f4d 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenBootSector.exe and b/BaseTools/Bin/Win32/GenBootSector.exe differ
index 90eee87b481d54a8e0709077b651b1f811269fc4..42a1f7b03fa2a324e7096895e773b3e07d34633a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenCrc32.exe and b/BaseTools/Bin/Win32/GenCrc32.exe differ
index 4ac5a5d40691324020a24ffec65fccc6b4ac761a..e7e3ed9733fc427ca85b0a0eabeea6f75c5cc5d7 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenDepex.exe and b/BaseTools/Bin/Win32/GenDepex.exe differ
index 26eef0e07da32b4dc938abdcaf46a9d2e105c08c..303edebbf30c413584775740e717bcef2dec7b7d 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFds.exe and b/BaseTools/Bin/Win32/GenFds.exe differ
index 40d9c0362966cf03d73b98f74ac292a4cec6e751..117bb7fe288d90d072ebde5ad64a17a155078a80 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFfs.exe and b/BaseTools/Bin/Win32/GenFfs.exe differ
index fbc7a9a7ac6d4266678828c121d89e15ebd59caf..54ce84fc7a85d06fc8a4c8ee80bb92b1a8bc9d6a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFv.exe and b/BaseTools/Bin/Win32/GenFv.exe differ
index 158859d8754cc79a303746ab284bcf378e16241c..ba446ee05f0837f61510d7e57ac6e9478331cb97 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFw.exe and b/BaseTools/Bin/Win32/GenFw.exe differ
index faf2217d776bcb3a9cf198c6f4a929a416d69cac..194c9c47c7f7e4370840952c5484e6c2c7287dbc 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPage.exe and b/BaseTools/Bin/Win32/GenPage.exe differ
index b80cbddb4c05c12eb418f3a5b4754e70957834e6..74d2b44cee3b11f1129566d264e54e23a05a9664 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPatchPcdTable.exe and b/BaseTools/Bin/Win32/GenPatchPcdTable.exe differ
index fe69cb62a2d4db2d15df8151f3308dd196c22f39..20d02e58df1978308cd9f4b26003eca344254585 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenSec.exe and b/BaseTools/Bin/Win32/GenSec.exe differ
index 0893d6c680067be087fc54177036ed12a1794191..a03b2d1ae45dddcebeb9d76f61b030f203dd6671 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenVtf.exe and b/BaseTools/Bin/Win32/GenVtf.exe differ
index ff1106db3a4b7994764342969200d3feaa0f6ac0..99976acec43e05c3235bde9996a8994849a696ae 100755 (executable)
Binary files a/BaseTools/Bin/Win32/LzmaCompress.exe and b/BaseTools/Bin/Win32/LzmaCompress.exe differ
index 9a59e86b305b84e7e8284eff83b9344faf3b9c37..b14ecbb85c0715c9c5550a7204ae49c6c54a87e8 100755 (executable)
Binary files a/BaseTools/Bin/Win32/MigrationMsa2Inf.exe and b/BaseTools/Bin/Win32/MigrationMsa2Inf.exe differ
index d749d1c5a71bb336383db0d1d09b13c764b028fb..5db62dfb6ba163bdf49cd77d50ad2e7713cd81b3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/PatchPcdValue.exe and b/BaseTools/Bin/Win32/PatchPcdValue.exe differ
index 5b40d61b78e2738e64687194c6fdc4bfa3f2771b..69587ce30d8901269779176451aa2bf6fae8ec3e 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Spd2Dec.exe and b/BaseTools/Bin/Win32/Spd2Dec.exe differ
index 0c3adcc1174f7d622e3f25d0da7e1a3e5c4f6560..69d5c4698cd97b1ef868ef12fd7f5515196d08e5 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Split.exe and b/BaseTools/Bin/Win32/Split.exe differ
index 197ecee23e5e54b7d08409ea442b9d4d7857575f..739e1ad838fe28d88ab1c56f696c2e3fc77bb7d1 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TargetTool.exe and b/BaseTools/Bin/Win32/TargetTool.exe differ
index db3f96d2c72d8309fd006f3c7e93c0136924bbc8..c48ab25891c8e5f092eca05380cce48982997834 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TianoCompress.exe and b/BaseTools/Bin/Win32/TianoCompress.exe differ
index 10ef9e4865a6c951fdf8098a52efc0598f4f1803..73fc296bfe1032a0ed2345ffd4747946777dabdd 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Trim.exe and b/BaseTools/Bin/Win32/Trim.exe differ
diff --git a/BaseTools/Bin/Win32/UPT.exe b/BaseTools/Bin/Win32/UPT.exe
new file mode 100644 (file)
index 0000000..9bd9380
Binary files /dev/null and b/BaseTools/Bin/Win32/UPT.exe differ
index 6811a0fc0232ea782c69a7d4d83eaf14b662d310..f1af79ce8c59f31a7e861067a1da785128343621 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VfrCompile.exe and b/BaseTools/Bin/Win32/VfrCompile.exe differ
index e558b5f528462c355dcae693bb40db7977758892..254b933b0c189cd3fa929db8bfb1be74689d7092 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VolInfo.exe and b/BaseTools/Bin/Win32/VolInfo.exe differ
diff --git a/BaseTools/Bin/Win32/_ctypes.pyd b/BaseTools/Bin/Win32/_ctypes.pyd
new file mode 100644 (file)
index 0000000..06d1ed1
Binary files /dev/null and b/BaseTools/Bin/Win32/_ctypes.pyd differ
index 355925244399e0380db1b4cd4f643a3011b71f0d..6e7f176df29202d7ca43649632eb9a4b438113e6 100755 (executable)
Binary files a/BaseTools/Bin/Win32/build.exe and b/BaseTools/Bin/Win32/build.exe differ
index 05bbd7ca9f19f61a6d558666edf71d9c7584d542..045e8fcf87065d619e05ca0ba1f1f0a80488158d 100644 (file)
@@ -74,11 +74,11 @@ please make sure the environment variable PYTHONPATH is set to
 \r
         <buildtools_project>/BaseTools/Source/Python\r
 \r
-  There're four tools written in Python. The entrance file of each tool is listed\r
+  There're five tools written in Python. The entrance file of each tool is listed\r
 below.\r
 \r
       build               <buildtools_project>/BaseTools/Source/Python/build/build.py\r
       GenFds              <buildtools_project>/BaseTools/Source/Python/GenFds/GenFds.py\r
       Trim                <buildtools_project>/BaseTools/Source/Python/Trim/Trim.py\r
       MigrationMsa2Inf    <buildtools_project>/BaseTools/Source/Python/MigrationMsa2Inf/MigrationMsa2Inf.py\r
-\r
+      UPT                 <buildtools_project>/BaseTools/Source/Python/UPT/UPT.py\r
diff --git a/BaseTools/Conf/Empty_Package_Information_Data_File.ini b/BaseTools/Conf/Empty_Package_Information_Data_File.ini
new file mode 100644 (file)
index 0000000..fe16256
--- /dev/null
@@ -0,0 +1,9 @@
+[DistributionHeader]\r
+Name = \r
+GUID = \r
+Version = \r
+Vendor = \r
+Copyright = \r
+License = \r
+Abstract = \r
+XmlSpecification = 1.1 \r
index dfb4d382d951be4e28b8e861ac3520b9b0bd59d9..1d3c6904411fb6e02d97feffd4621c87782318bb 100644 (file)
@@ -2,7 +2,7 @@
 <!--
 Filename: DistributionPackage.xsd
 
-Copyright (c) 2008, 2011 Intel Corporation. All rights reserved.
+Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
 
 This program and the accompanying materials are licensed and made available 
 under the terms and conditions of the BSD License which may be found at 
index 528bdb985a2a0a5215d78852ef30fd0f58b0de82..ff5af1ce783928769efbe6e583d20e5a5b430c35 100644 (file)
         -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1\r
         "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
         -$(MD) ${d_path} > NUL 2>&1\r
-        "$(VFR)" $(VFR_FLAGS) --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
+        "$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
 \r
 [Object-File]\r
     <InputFile>\r
         "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}\r
 \r
     <Command.ARMGCC>\r
-        "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -) $(DLINK2_FLAGS)\r
+        "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS)\r
 \r
     <Command.RVCT>\r
         "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) --via $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)\r
         "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS)\r
 \r
     <Command.ARMGCC>\r
-        "$(DLINK)" $(DLINK_FLAGS) -( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -) $(DLINK2_FLAGS)\r
+        "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS)\r
 \r
     <Command.RVCT>\r
         "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) --via $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)\r
         $(OUTPUT_DIR)(+)${s_base}.com\r
 \r
     <Command.MSFT, Command.INTEL>\r
+        "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
+        Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
         cd $(OUTPUT_DIR)(+)${s_dir}\r
-        "$(ASM16)" /nologo /c /omf $(INC) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}\r
+        "$(ASM16)" /nologo /c /omf $(INC) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii\r
         "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,\r
 \r
     <Command.GCC>\r
       "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
       Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
       "$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii\r
-      "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -( $(DLINK_SPATH) $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj -)\r
+      "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj -\)\r
      \r
     <Command.XCODE>\r
       "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
     <OutputFile>\r
         $(DEBUG_DIR)(+)AutoGen.c\r
         $(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h\r
+        $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk\r
 \r
     <Command>\r
 \r
         -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1\r
         "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
         -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1\r
-        "$(VFR)" $(VFR_FLAGS) --create-ifr-package --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
+        "$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
 \r
 [Hii-Binary-Package.UEFI_HII]\r
     <InputFile>\r
index 3c4c50ff1ec4ef73bbf6e193d29c04d9c81a9ca7..b45a18beca7fba7df9711469ad75b7d0920fe03e 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<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
@@ -29,18 +29,20 @@ ACTIVE_PLATFORM       = Nt32Pkg/Nt32Pkg.dsc
 #                                               UserDefined; separated by a space character.\r
 #                                               If the line is missing or no value is specified, all\r
 #                                               valid targets specified in the platform description file \r
-#                                               will attempt to be built. The following line will build all\r
-#                                               platform targets.\r
+#                                               will attempt to be built. The following line will build \r
+#                                               DEBUG platform target.\r
 TARGET                = DEBUG\r
 \r
 #  TARGET_ARCH           List       Optional    What kind of architecture is the binary being target for.\r
 #                                               One, or more, of the following, IA32, IPF, X64, EBC or ARM.\r
 #                                               Multiple values can be specified on a single line, using\r
 #                                               space charaters to separate the values.  These are used\r
-#                                               during the parsing of an platform description file, \r
+#                                               during the parsing of a platform description file, \r
 #                                               restricting the build output target(s.)\r
-#                                               The Build Target ARCH is determined by a logical AND of:\r
-#                                               platform BuildOptions: <SupportedArchitectures> tag\r
+#                                               The Build Target ARCH is determined by (precedence high to low):\r
+#                                                 Command-line: -a ARCH option\r
+#                                                 target.txt: TARGET_ARCH values\r
+#                                                 DSC file: [Defines] SUPPORTED_ARCHITECTURES tag\r
 #                                               If not specified, then all valid architectures specified\r
 #                                               in the platform file, for which tools are available, will be\r
 #                                               built.\r
@@ -48,8 +50,7 @@ TARGET_ARCH           = IA32
 \r
 #  TOOL_DEFINITION_FILE  Filename  Optional   Specify the name of the filename to use for specifying\r
 #                                             the tools to use for the build.  If not specified,\r
-#                                             tools_def.txt will be used for the build.  This file\r
-#                                             MUST be located in the WORKSPACE/Conf directory.\r
+#                                             WORKSPACE/Conf/tools_def.txt will be used for the build.\r
 TOOL_CHAIN_CONF       = Conf/tools_def.txt\r
 \r
 #  TAGNAME               List      Optional   Specify the name(s) of the tools_def.txt TagName to use.\r
@@ -62,8 +63,9 @@ TOOL_CHAIN_TAG        = MYTOOLS
 #                                                 cores or CPUs. Less than 2 means disable multithread build.\r
 MAX_CONCURRENT_THREAD_NUMBER = 1\r
 \r
-# Build rules definition\r
-#\r
-#\r
+\r
+# BUILD_RULE_CONF  Filename Optional  Specify the file name to use for the build rules that are followed\r
+#                                     when generating Makefiles. If not specified, the file: \r
+#                                     WORKSPACE/Conf/build_rule.txt will be used\r
 BUILD_RULE_CONF = Conf/build_rule.txt\r
 \r
index 495f55de74f6027bfcdf25ef50a5b212f441ca75..f63fa7d7c275d8d4dddd2c1f37f3e8f44608d0bd 100644 (file)
@@ -164,7 +164,6 @@ DEFINE IPHONE_TOOLS            = /Developer/Platforms/iPhoneOS.platform/Develope
 DEFINE RVCT31_TOOLS_PATH       = c:/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium\r
 DEFINE RVCT31CYGWIN_TOOLS_PATH = /cygdrive/c/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium\r
 \r
-DEFINE SOURCERY_TOOLS        = c:/Program Files/CodeSourcery/Sourcery G++ Lite/bin\r
 DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin\r
 \r
 #\r
@@ -3437,8 +3436,8 @@ RELEASE_XCLANG_IA32_DLINK_FLAGS      = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$
 RELEASE_XCLANG_IA32_ASM_FLAGS  = -arch i386 \r
 \r
 \r
-  DEBUG_XCLANG_IA32_CC_FLAGS   = -arch i386 -c -g -O0  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
-RELEASE_XCLANG_IA32_CC_FLAGS   = -arch i386 -c    -Os  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
+  DEBUG_XCLANG_IA32_CC_FLAGS   = -arch i386 -c -g -O0  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable  -fasm-blocks  -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang\r
+RELEASE_XCLANG_IA32_CC_FLAGS   = -arch i386 -c    -Os  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable  -fasm-blocks  -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang\r
 \r
 \r
 ##################\r
@@ -3453,8 +3452,8 @@ RELEASE_XCLANG_X64_ASM_FLAGS  = -arch x86_64
 *_XCLANG_*_VFRPP_FLAGS      = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h \r
 \r
 \r
-  DEBUG_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c -g -O0  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
-RELEASE_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c    -Os  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
+  DEBUG_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c -g -O0  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang\r
+RELEASE_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c    -Os  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang\r
 *_XCLANG_*_ASLCC_FLAGS      = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic\r
 *_XCLANG_*_ASLDLINK_FLAGS   = -e _main -preload -segalign 0x20  -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 *_XCLANG_*_ASLPP_FLAGS      = -x c -E \r
@@ -3560,7 +3559,7 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 *_ARMGCC_*_*_FAMILY          = GCC\r
 *_ARMGCC_*_*_BUILDRULEFAMILY = ARMGCC\r
 \r
-*_ARMGCC_*_MAKE_PATH         = DEF(SOURCERY_TOOLS)/cs-make\r
+*_ARMGCC_*_MAKE_PATH         = make\r
 *_ARMGCC_*_MAKE_FLAGS        = --no-print-directory\r
 \r
 ##################\r
@@ -3577,16 +3576,16 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 # ARM definitions\r
 ##################\r
 \r
-*_ARMGCC_ARM_ASLCC_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc\r
-*_ARMGCC_ARM_ASLDLINK_PATH   = DEF(SOURCERY_TOOLS)/arm-none-eabi-ld\r
-*_ARMGCC_ARM_ASLPP_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc\r
+*_ARMGCC_ARM_ASLCC_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc\r
+*_ARMGCC_ARM_ASLDLINK_PATH   = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-ld\r
+*_ARMGCC_ARM_ASLPP_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc\r
 \r
-*_ARMGCC_ARM_CC_PATH         = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc\r
-*_ARMGCC_ARM_SLINK_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-ar\r
-*_ARMGCC_ARM_DLINK_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-ld\r
-*_ARMGCC_ARM_ASM_PATH        = DEF(SOURCERY_TOOLS)/arm-none-eabi-as\r
-*_ARMGCC_ARM_PP_PATH         = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc\r
-*_ARMGCC_ARM_VFRPP_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc\r
+*_ARMGCC_ARM_CC_PATH         = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc\r
+*_ARMGCC_ARM_SLINK_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-ar\r
+*_ARMGCC_ARM_DLINK_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-ld\r
+*_ARMGCC_ARM_ASM_PATH        = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-as\r
+*_ARMGCC_ARM_PP_PATH         = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc\r
+*_ARMGCC_ARM_VFRPP_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc\r
 \r
 #\r
 # Use default values, or override in DSC file\r
@@ -3640,6 +3639,12 @@ RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian
 *_*_*_ASLPP_FLAGS                  = /nologo /EP /C\r
 *_*_*_ASL_FLAGS                    =\r
 \r
+##################\r
+# GenCrc32 tool definitions\r
+##################\r
+*_*_*_CRC32_PATH          = GenCrc32\r
+*_*_*_CRC32_GUID          = FC1BCDB0-7D31-49AA-936A-A4600D9DD083\r
+\r
 ##################\r
 # LzmaCompress tool definitions\r
 ##################\r
index 88ded8760e88d9232cbfcaba057cb0f1af2b7e65..dfd180db744f1c1b1eea0c515faf985998ccd855 100644 (file)
@@ -31,7 +31,9 @@ Abstract:
 #define _MAX_PATH 500\r
 #endif\r
 \r
-\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
 //\r
 // Functions declarations\r
 //\r
@@ -227,4 +229,9 @@ Returns:
   TRUE if section found\r
 \r
 --*/\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
 #endif\r
index c72011045cfdcfb6e942cf0af7ff05b645646148..e92bcf5d9e978040df3c4906b0aadbd33ee6d58b 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -63,7 +63,7 @@ UINT32 gPageTableOffsetInFile = EFI_PAGE_BASE_OFFSET_IN_LDR;
 //\r
 // Utility Name\r
 //\r
-#define UTILITY_NAME  "GenBootSector"\r
+#define UTILITY_NAME  "GenPage"\r
 \r
 //\r
 // Utility version information\r
@@ -92,7 +92,7 @@ Returns:
 --*/\r
 {\r
   printf ("%s v%d.%d -Utility to generate the EfiLoader image containing page table.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
-  printf ("Copyright (c) 2008 - 2010 Intel Corporation. All rights reserved.\n");\r
+  printf ("Copyright (c) 2008 - 2011 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r
 VOID\r
@@ -103,14 +103,21 @@ Usage (
   Version();\r
   printf ("\nUsage: \n\\r
    GenPage\n\\r
-     -o, --output Filename containing page table\n\\r
-     [-b, --baseaddr baseaddress of page table]\n\\r
-     [-f, --offset offset in the file that page table will reside]\n\\r
-     [-v, --verbose]\n\\r
-     [--version]\n\\r
-     [-q, --quiet disable all messages except fatal errors]\n\\r
-     [-d, --debug[#]\n\\r
-     [-h, --help]\n\\r
+     -o, --output Filename\n\\r
+                        The file that contains both non-page table part and\n\\r
+                        page table\n\\r
+     [-b, --baseaddr baseaddress]\n\\r
+                        The page table location\n\\r
+     [-f, --offset offset]\n\\r
+                        The position that the page table will appear in the\n\\r
+                        output file\n\\r
+     [-v, --verbose]    Turn on verbose output with informational messages\n\\r
+                        printed\n\\r
+     [--version]        Print version and copyright of this program and exit\n\\r
+     [-q, --quiet]      Disable all messages except unrecoverable errors\n\\r
+     [-d, --debug[#]]   Enable debug messages, at level #\n\\r
+     [-h, --help]       Print copyright, version and usage of this program\n\\r
+                        and exit\n\\r
      EfiLoaderImageName\n");\r
 \r
 }\r
index 8b42061d715257c06f998569cd8ad8ac8e2f61a5..b756fef2c378ef3a16482621c00038f909ad036c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EDK II specific HII relative definition.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
 #define WIDE_CHAR           0xFFF1\r
 #define NON_BREAKING_CHAR   0xFFF2\r
 \r
-#define GLYPH_WIDTH         EFI_GLYPH_WIDTH\r
-#define GLYPH_HEIGHT        EFI_GLYPH_HEIGHT\r
-\r
-//\r
-// State defined for password statemachine \r
-//\r
+///\r
+/// State defined for password statemachine .\r
+///\r
 #define BROWSER_STATE_VALIDATE_PASSWORD  0\r
 #define BROWSER_STATE_SET_PASSWORD       1\r
 \r
-\r
-//\r
-// Tiano Implementation specific Device Path definition.\r
-//\r
-#pragma pack(1)\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH             VendorDevicePath;\r
-  UINT32                         Reserved;\r
-  UINT64                         UniqueId;\r
-} HII_VENDOR_DEVICE_PATH_NODE;\r
-#pragma pack()\r
-\r
-typedef struct {\r
-  HII_VENDOR_DEVICE_PATH_NODE    Node;\r
-  EFI_DEVICE_PATH_PROTOCOL       End;\r
-} HII_VENDOR_DEVICE_PATH;\r
-\r
-\r
-//\r
-// GUIDed opcodes defined for Tiano\r
-//\r
+///\r
+/// GUIDed opcodes defined for EDKII implementation.\r
+///\r
 #define EFI_IFR_TIANO_GUID \\r
   { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }\r
 \r
 #pragma pack(1)\r
 \r
+///\r
+/// EDKII implementation extension opcodes, new extension can be added here later.\r
+///\r
 #define EFI_IFR_EXTEND_OP_LABEL       0x0\r
 #define EFI_IFR_EXTEND_OP_BANNER      0x1\r
 #define EFI_IFR_EXTEND_OP_TIMEOUT     0x2\r
 #define EFI_IFR_EXTEND_OP_CLASS       0x3\r
 #define EFI_IFR_EXTEND_OP_SUBCLASS    0x4\r
 \r
+///\r
+/// Label opcode.\r
+///\r
 typedef struct _EFI_IFR_GUID_LABEL {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_TIANO_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_LABEL.\r
+  ///\r
   UINT8               ExtendOpCode;\r
+  ///\r
+  /// Label Number.\r
+  ///\r
   UINT16              Number;\r
 } EFI_IFR_GUID_LABEL;\r
 \r
@@ -74,20 +68,38 @@ typedef struct _EFI_IFR_GUID_LABEL {
 #define EFI_IFR_BANNER_ALIGN_CENTER   1\r
 #define EFI_IFR_BANNER_ALIGN_RIGHT    2\r
 \r
+///\r
+/// Banner opcode.\r
+///\r
 typedef struct _EFI_IFR_GUID_BANNER {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_TIANO_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
-  UINT8               ExtendOpCode; // Extended opcode is EFI_IFR_EXTEND_OP_BANNER\r
-  EFI_STRING_ID       Title;        // The string token for the banner title\r
-  UINT16              LineNumber;   // 1-based line number\r
-  UINT8               Alignment;    // left, center, or right-aligned\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_BANNER\r
+  ///\r
+  UINT8               ExtendOpCode;\r
+  EFI_STRING_ID       Title;        ///< The string token for the banner title.\r
+  UINT16              LineNumber;   ///< 1-based line number.\r
+  UINT8               Alignment;    ///< left, center, or right-aligned.\r
 } EFI_IFR_GUID_BANNER;\r
 \r
+///\r
+/// Timeout opcode.\r
+///\r
 typedef struct _EFI_IFR_GUID_TIMEOUT {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_TIANO_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_TIMEOUT.\r
+  ///\r
   UINT8               ExtendOpCode;\r
-  UINT16              TimeOut;\r
+  UINT16              TimeOut;       ///< TimeOut Value.\r
 } EFI_IFR_GUID_TIMEOUT;\r
 \r
 #define EFI_NON_DEVICE_CLASS              0x00\r
@@ -98,11 +110,20 @@ typedef struct _EFI_IFR_GUID_TIMEOUT {
 #define EFI_ON_BOARD_DEVICE_CLASS         0x10\r
 #define EFI_OTHER_DEVICE_CLASS            0x20\r
 \r
+///\r
+/// Device Class opcode.\r
+///\r
 typedef struct _EFI_IFR_GUID_CLASS {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_TIANO_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_CLASS.\r
+  ///\r
   UINT8               ExtendOpCode;\r
-  UINT16              Class;\r
+  UINT16              Class;           ///< Device Class from the above.\r
 } EFI_IFR_GUID_CLASS;\r
 \r
 #define EFI_SETUP_APPLICATION_SUBCLASS    0x00\r
@@ -110,45 +131,93 @@ typedef struct _EFI_IFR_GUID_CLASS {
 #define EFI_FRONT_PAGE_SUBCLASS           0x02\r
 #define EFI_SINGLE_USE_SUBCLASS           0x03\r
 \r
+///\r
+/// SubClass opcode\r
+///\r
 typedef struct _EFI_IFR_GUID_SUBCLASS {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_TIANO_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_SUBCLASS.\r
+  ///\r
   UINT8               ExtendOpCode;\r
-  UINT16              SubClass;\r
+  UINT16              SubClass;      ///< Sub Class type from the above.\r
 } EFI_IFR_GUID_SUBCLASS;\r
 \r
-//\r
-// GUIDed opcodes defined for Tiano\r
-//\r
+///\r
+/// GUIDed opcodes support for framework vfr.\r
+///\r
 #define EFI_IFR_FRAMEWORK_GUID \\r
   { 0x31ca5d1a, 0xd511, 0x4931, { 0xb7, 0x82, 0xae, 0x6b, 0x2b, 0x17, 0x8c, 0xd7 } }\r
 \r
+///\r
+/// Two extended opcodes are added, and new extensions can be added here later.\r
+/// One is for framework OneOf question Option Key value;\r
+/// another is for framework vareqval.\r
+///\r
 #define EFI_IFR_EXTEND_OP_OPTIONKEY   0x0\r
 #define EFI_IFR_EXTEND_OP_VAREQNAME   0x1\r
-//\r
-// Store the framework vfr option key value\r
-//\r
+\r
+///\r
+/// Store the framework vfr option key value.\r
+///\r
 typedef struct _EFI_IFR_GUID_OPTIONKEY {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_FRAMEWORK_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_OPTIONKEY.\r
+  ///\r
   UINT8               ExtendOpCode;\r
+  ///\r
+  /// OneOf Questiond ID binded by OneOf Option.\r
+  ///\r
   EFI_QUESTION_ID     QuestionId;\r
+  ///\r
+  /// The OneOf Option Value.\r
+  ///\r
   EFI_IFR_TYPE_VALUE  OptionValue;\r
-  EFI_QUESTION_ID     KeyValue;\r
+  ///\r
+  /// The Framework OneOf Option Key Value.\r
+  ///\r
+  UINT16              KeyValue;\r
 } EFI_IFR_GUID_OPTIONKEY;\r
 \r
-//\r
-// Store the framework vfr vareqval name number\r
-//\r
+///\r
+/// Store the framework vfr vareqval name number.\r
+///\r
 typedef struct _EFI_IFR_GUID_VAREQNAME {\r
   EFI_IFR_OP_HEADER   Header;\r
+  ///\r
+  /// EFI_IFR_FRAMEWORK_GUID.\r
+  ///\r
   EFI_GUID            Guid;\r
+  ///\r
+  /// EFI_IFR_EXTEND_OP_VAREQNAME.\r
+  ///\r
   UINT8               ExtendOpCode;\r
+  ///\r
+  /// Question ID of the Numeric Opcode created.\r
+  ///\r
   EFI_QUESTION_ID     QuestionId;\r
-  EFI_STRING_ID       NameId;\r
+  ///\r
+  /// For vareqval (0x100), NameId is 0x100.\r
+  /// This value will convert to a Unicode String following this rule;\r
+  ///            sprintf(StringBuffer, "%d", NameId) .\r
+  /// The the Unicode String will be used as a EFI Variable Name.\r
+  ///\r
+  UINT16              NameId;\r
 } EFI_IFR_GUID_VAREQNAME;\r
 \r
 #pragma pack()\r
 \r
+extern EFI_GUID gEfiIfrTianoGuid;\r
+extern EFI_GUID gEfiIfrFrameworkGuid;\r
+\r
 #endif\r
 \r
index 61fc19161899a39280e4940c672c6b12ef0fa20e..1cabc959d8bc58a92a747bdaf7af641f7e3bd34c 100644 (file)
@@ -575,6 +575,13 @@ typedef struct {
   UINT8  Day;\r
 } EFI_HII_DATE;\r
 \r
+typedef struct {\r
+  EFI_QUESTION_ID QuestionId;\r
+  EFI_FORM_ID     FormId;\r
+  EFI_GUID        FormSetGuid;\r
+  EFI_STRING_ID   DevicePath;\r
+} EFI_HII_REF;\r
+\r
 typedef union {\r
   UINT8           u8;\r
   UINT16          u16;\r
@@ -584,6 +591,7 @@ typedef union {
   EFI_HII_TIME    time;\r
   EFI_HII_DATE    date;\r
   EFI_STRING_ID   string;\r
+  EFI_HII_REF     ref;\r
 } EFI_IFR_TYPE_VALUE;\r
 \r
 #define EFI_IFR_FORM_OP                0x01\r
@@ -681,6 +689,8 @@ typedef union {
 #define EFI_IFR_CATENATE_OP            0x5E\r
 #define EFI_IFR_GUID_OP                0x5F\r
 #define EFI_IFR_SECURITY_OP            0x60\r
+#define EFI_IFR_MODAL_TAG_OP           0x61\r
+#define EFI_IFR_REFRESH_ID_OP          0x62\r
 \r
 \r
 typedef struct _EFI_IFR_OP_HEADER {\r
@@ -739,6 +749,8 @@ typedef struct _EFI_IFR_VARSTORE_EFI {
   EFI_VARSTORE_ID          VarStoreId;\r
   EFI_GUID                 Guid;\r
   UINT32                   Attributes;\r
+  UINT16                   Size;\r
+  UINT8                    Name[1];\r
 } EFI_IFR_VARSTORE_EFI;\r
 \r
 typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {\r
@@ -771,6 +783,10 @@ typedef struct _EFI_IFR_IMAGE {
   EFI_IMAGE_ID             Id;\r
 } EFI_IFR_IMAGE;\r
 \r
+typedef struct _EFI_IFR_MODAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_MODAL;\r
+\r
 typedef struct _EFI_IFR_LOCKED {\r
   EFI_IFR_OP_HEADER        Header;\r
 } EFI_IFR_LOCKED;\r
@@ -844,6 +860,11 @@ typedef struct _EFI_IFR_REF4 {
   EFI_STRING_ID            DevicePath;\r
 } EFI_IFR_REF4;\r
 \r
+typedef struct _EFI_IFR_REF5 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+} EFI_IFR_REF5;\r
+\r
 typedef struct _EFI_IFR_RESET_BUTTON {\r
   EFI_IFR_OP_HEADER        Header;\r
   EFI_IFR_STATEMENT_HEADER Statement;\r
@@ -993,6 +1014,11 @@ typedef struct _EFI_IFR_REFRESH {
   UINT8                    RefreshInterval;\r
 } EFI_IFR_REFRESH;\r
 \r
+typedef struct _EFI_IFR_REFRESH_ID {\r
+  EFI_IFR_OP_HEADER Header;\r
+  EFI_GUID          RefreshEventGroupId;\r
+} EFI_IFR_REFRESH_ID;\r
+\r
 typedef struct _EFI_IFR_VARSTORE_DEVICE {\r
   EFI_IFR_OP_HEADER        Header;\r
   EFI_STRING_ID            DevicePath;\r
@@ -1018,6 +1044,7 @@ typedef struct _EFI_IFR_ONE_OF_OPTION {
 #define EFI_IFR_TYPE_UNDEFINED         0x09\r
 #define EFI_IFR_TYPE_ACTION            0x0A\r
 #define EFI_IFR_TYPE_BUFFER            0x0B\r
+#define EFI_IFR_TYPE_REF               0x0C\r
 \r
 #define EFI_IFR_OPTION_DEFAULT         0x10\r
 #define EFI_IFR_OPTION_DEFAULT_MFG     0x20\r
diff --git a/BaseTools/Source/C/Include/Protocol/DevicePath.h b/BaseTools/Source/C/Include/Protocol/DevicePath.h
deleted file mode 100644 (file)
index 9fc8cb1..0000000
+++ /dev/null
@@ -1,548 +0,0 @@
-/** @file\r
-  The device path protocol as defined in UEFI 2.0.\r
-\r
-  The device path represents a programatic path to a device. It's the view\r
-  from a software point of view. It also must persist from boot to boot, so \r
-  it can not contain things like PCI bus numbers that change from boot to boot.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-\r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  distribution.  The full text of the license may be found at:\r
-    http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  File Name: DevicePath.h\r
-\r
-**/\r
-\r
-#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__\r
-#define __EFI_DEVICE_PATH_PROTOCOL_H__\r
-\r
-#include <Guid/PcAnsi.h>\r
-\r
-//\r
-// Device Path protocol\r
-//\r
-#define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
-  { \\r
-    0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
-  }\r
-\r
-//\r
-// Protocol GUID defined in EFI1.1.\r
-// \r
-\r
-//\r
-// Device Path information\r
-//\r
-#define DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH_PROTOCOL_GUID\r
-\r
-#pragma pack(1)\r
-\r
-typedef struct {\r
-  UINT8 Type;\r
-  UINT8 SubType;\r
-  UINT8 Length[2];\r
-} EFI_DEVICE_PATH_PROTOCOL;\r
-\r
-//\r
-// For backward-compatible with EFI1.1.\r
-// \r
-typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;\r
-\r
-//\r
-// Hardware Device Paths\r
-//\r
-#define HARDWARE_DEVICE_PATH      0x01\r
-\r
-#define HW_PCI_DP                 0x01\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT8                           Function;\r
-  UINT8                           Device;\r
-} PCI_DEVICE_PATH;\r
-\r
-#define HW_PCCARD_DP              0x02\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT8                           FunctionNumber;\r
-} PCCARD_DEVICE_PATH;\r
-\r
-#define HW_MEMMAP_DP              0x03\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          MemoryType;\r
-  EFI_PHYSICAL_ADDRESS            StartingAddress;\r
-  EFI_PHYSICAL_ADDRESS            EndingAddress;\r
-} MEMMAP_DEVICE_PATH;\r
-\r
-#define HW_VENDOR_DP              0x04\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_GUID                        Guid;\r
-} VENDOR_DEVICE_PATH;\r
-\r
-#define HW_CONTROLLER_DP          0x05\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          ControllerNumber;\r
-} CONTROLLER_DEVICE_PATH;\r
-\r
-//\r
-// ACPI Device Paths\r
-//\r
-#define ACPI_DEVICE_PATH          0x02\r
-\r
-#define ACPI_DP                   0x01\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          HID;\r
-  UINT32                          UID;\r
-} ACPI_HID_DEVICE_PATH;\r
-\r
-#define ACPI_EXTENDED_DP          0x02\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          HID;\r
-  UINT32                          UID;\r
-  UINT32                          CID;\r
-  //\r
-  // Optional variable length _HIDSTR\r
-  // Optional variable length _UIDSTR\r
-  //\r
-} ACPI_EXTENDED_HID_DEVICE_PATH;\r
-\r
-//\r
-//  EISA ID Macro\r
-//  EISA ID Definition 32-bits\r
-//   bits[15:0] - three character compressed ASCII EISA ID.\r
-//   bits[31:16] - binary number\r
-//    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'\r
-//\r
-#define PNP_EISA_ID_CONST         0x41d0\r
-#define EISA_ID(_Name, _Num)      ((UINT32) ((_Name) | (_Num) << 16))\r
-#define EISA_PNP_ID(_PNPId)       (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
-#define EFI_PNP_ID(_PNPId)        (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
-\r
-#define PNP_EISA_ID_MASK          0xffff\r
-#define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)\r
-\r
-\r
-#define ACPI_ADR_DP               0x03\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          ADR;\r
-} ACPI_ADR_DEVICE_PATH;\r
-\r
-\r
-//\r
-// Messaging Device Paths\r
-//\r
-#define MESSAGING_DEVICE_PATH     0x03\r
-\r
-#define MSG_ATAPI_DP              0x01\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT8                           PrimarySecondary;\r
-  UINT8                           SlaveMaster;\r
-  UINT16                          Lun;\r
-} ATAPI_DEVICE_PATH;\r
-\r
-#define MSG_SCSI_DP               0x02\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT16                          Pun;\r
-  UINT16                          Lun;\r
-} SCSI_DEVICE_PATH;\r
-\r
-#define MSG_FIBRECHANNEL_DP       0x03\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          Reserved;\r
-  UINT64                          WWN;\r
-  UINT64                          Lun;\r
-} FIBRECHANNEL_DEVICE_PATH;\r
-\r
-#define MSG_1394_DP               0x04\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          Reserved;\r
-  UINT64                          Guid;\r
-} F1394_DEVICE_PATH;\r
-\r
-#define MSG_USB_DP                0x05\r
-typedef struct {\r
-    EFI_DEVICE_PATH_PROTOCOL      Header;\r
-    UINT8                         ParentPortNumber;\r
-    UINT8                         InterfaceNumber;\r
-} USB_DEVICE_PATH;\r
-\r
-#define MSG_USB_CLASS_DP          0x0f\r
-typedef struct {\r
-    EFI_DEVICE_PATH_PROTOCOL      Header;\r
-    UINT16                        VendorId;\r
-    UINT16                        ProductId;\r
-    UINT8                         DeviceClass;\r
-    UINT8                         DeviceSubClass;\r
-    UINT8                         DeviceProtocol;\r
-} USB_CLASS_DEVICE_PATH;\r
-\r
-#define MSG_USB_WWID_DP           0x10\r
-typedef struct {\r
-    EFI_DEVICE_PATH_PROTOCOL      Header;\r
-    UINT16                        InterfaceNumber;\r
-    UINT16                        VendorId;\r
-    UINT16                        ProductId;\r
-    // CHAR16                     SerialNumber[...];\r
-} USB_WWID_DEVICE_PATH;\r
-\r
-\r
-#define MSG_DEVICE_LOGICAL_UNIT_DP  0x11\r
-typedef struct {\r
-    EFI_DEVICE_PATH_PROTOCOL      Header;\r
-    UINT8                         Lun;\r
-} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
-\r
-#define MSG_SATA_DP               0x12\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT16                          HBAPortNumber;\r
-  UINT16                          PortMultiplierPortNumber;\r
-  UINT16                          Lun;\r
-} SATA_DEVICE_PATH;\r
-\r
-#define MSG_I2O_DP                0x06\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          Tid;\r
-} I2O_DEVICE_PATH;\r
-\r
-#define MSG_MAC_ADDR_DP           0x0b\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_MAC_ADDRESS                 MacAddress;\r
-  UINT8                           IfType;\r
-} MAC_ADDR_DEVICE_PATH;\r
-\r
-#define MSG_IPv4_DP               0x0c\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_IPv4_ADDRESS                LocalIpAddress;\r
-  EFI_IPv4_ADDRESS                RemoteIpAddress;\r
-  UINT16                          LocalPort;\r
-  UINT16                          RemotePort;\r
-  UINT16                          Protocol;\r
-  BOOLEAN                         StaticIpAddress;\r
-} IPv4_DEVICE_PATH;\r
-\r
-#define MSG_IPv6_DP               0x0d\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_IPv6_ADDRESS                LocalIpAddress;\r
-  EFI_IPv6_ADDRESS                RemoteIpAddress;\r
-  UINT16                          LocalPort;\r
-  UINT16                          RemotePort;\r
-  UINT16                          Protocol;\r
-  BOOLEAN                         StaticIpAddress;\r
-} IPv6_DEVICE_PATH;\r
-\r
-#define MSG_INFINIBAND_DP         0x09\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          ResourceFlags;\r
-  UINT8                           PortGid[16];\r
-  UINT64                          ServiceId;\r
-  UINT64                          TargetPortId;\r
-  UINT64                          DeviceId;\r
-} INFINIBAND_DEVICE_PATH;\r
-\r
-#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01\r
-#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT  0x02\r
-#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL           0x04\r
-#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL           0x08\r
-#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL           0x10\r
-\r
-#define MSG_UART_DP               0x0e\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          Reserved;\r
-  UINT64                          BaudRate;\r
-  UINT8                           DataBits;\r
-  UINT8                           Parity;\r
-  UINT8                           StopBits;\r
-} UART_DEVICE_PATH;\r
-\r
-//\r
-// Use VENDOR_DEVICE_PATH struct\r
-//\r
-#define MSG_VENDOR_DP             0x0a\r
-typedef VENDOR_DEVICE_PATH        VENDOR_DEFINED_DEVICE_PATH;\r
-\r
-#define DEVICE_PATH_MESSAGING_PC_ANSI     EFI_PC_ANSI_GUID\r
-#define DEVICE_PATH_MESSAGING_VT_100      EFI_VT_100_GUID\r
-#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
-#define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID\r
-\r
-#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL   EFI_UART_DEVICE_PATH_GUID\r
-\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_GUID                        Guid;\r
-  UINT32                          FlowControlMap;\r
-} UART_FLOW_CONTROL_DEVICE_PATH;\r
-\r
-#define DEVICE_PATH_MESSAGING_SAS                 EFI_SAS_DEVICE_PATH_GUID\r
-\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_GUID                        Guid;\r
-  UINT32                          Reserved;\r
-  UINT64                          SasAddress;\r
-  UINT64                          Lun;\r
-  UINT16                          DeviceTopology;\r
-  UINT16                          RelativeTargetPort;\r
-} SAS_DEVICE_PATH;\r
-\r
-#define MSG_ISCSI_DP              0x13\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT16                          NetworkProtocol;\r
-  UINT16                          LoginOption;\r
-  UINT64                          Lun;\r
-  UINT16                          TargetPortalGroupTag;\r
-  // CHAR8                        iSCSI Target Name\r
-} ISCSI_DEVICE_PATH;\r
-\r
-#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000\r
-#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C   0x0002\r
-#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST               0x0000\r
-#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C     0x0008\r
-#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP              0x0000\r
-#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON               0x1000\r
-#define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000\r
-#define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000\r
-\r
-//\r
-// Media Device Path\r
-//\r
-#define MEDIA_DEVICE_PATH         0x04\r
-\r
-#define MEDIA_HARDDRIVE_DP        0x01\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          PartitionNumber;\r
-  UINT64                          PartitionStart;\r
-  UINT64                          PartitionSize;\r
-  UINT8                           Signature[16];\r
-  UINT8                           MBRType;\r
-  UINT8                           SignatureType;\r
-} HARDDRIVE_DEVICE_PATH;\r
-\r
-#define MBR_TYPE_PCAT             0x01\r
-#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
-\r
-#define SIGNATURE_TYPE_MBR        0x01\r
-#define SIGNATURE_TYPE_GUID       0x02\r
-\r
-#define MEDIA_CDROM_DP            0x02\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT32                          BootEntry;\r
-  UINT64                          PartitionStart;\r
-  UINT64                          PartitionSize;\r
-} CDROM_DEVICE_PATH;\r
-\r
-//\r
-// Use VENDOR_DEVICE_PATH struct\r
-//\r
-#define MEDIA_VENDOR_DP           0x03\r
-\r
-#define MEDIA_FILEPATH_DP         0x04\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  CHAR16                          PathName[1];\r
-} FILEPATH_DEVICE_PATH;\r
-\r
-#define SIZE_OF_FILEPATH_DEVICE_PATH  EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)\r
-\r
-#define MEDIA_PROTOCOL_DP         0x05\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_GUID                        Protocol;\r
-} MEDIA_PROTOCOL_DEVICE_PATH;\r
-\r
-\r
-#define MEDIA_PIWG_FW_VOL_DP      0x7\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_GUID                        FvName;\r
-} MEDIA_FW_VOL_DEVICE_PATH;\r
-\r
-\r
-#define MEDIA_PIWG_FW_FILE_DP     0x6\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  EFI_GUID                        FvFileName;\r
-} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
-\r
-//\r
-// BBS Device Path\r
-//\r
-#define BBS_DEVICE_PATH           0x05\r
-#define BBS_BBS_DP                0x01\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT16                          DeviceType;\r
-  UINT16                          StatusFlag;\r
-  CHAR8                           String[1];\r
-} BBS_BBS_DEVICE_PATH;\r
-\r
-//\r
-// DeviceType definitions - from BBS specification\r
-//\r
-#define BBS_TYPE_FLOPPY           0x01\r
-#define BBS_TYPE_HARDDRIVE        0x02\r
-#define BBS_TYPE_CDROM            0x03\r
-#define BBS_TYPE_PCMCIA           0x04\r
-#define BBS_TYPE_USB              0x05\r
-#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
-#define BBS_TYPE_BEV              0x80\r
-#define BBS_TYPE_UNKNOWN          0xFF\r
-\r
-\r
-//\r
-// Union of all possible Device Paths and pointers to Device Paths\r
-//\r
-\r
-typedef union {\r
-  EFI_DEVICE_PATH_PROTOCOL             DevPath;\r
-  PCI_DEVICE_PATH                      Pci;\r
-  PCCARD_DEVICE_PATH                   PcCard;\r
-  MEMMAP_DEVICE_PATH                   MemMap;\r
-  VENDOR_DEVICE_PATH                   Vendor;\r
-\r
-  CONTROLLER_DEVICE_PATH               Controller;\r
-  ACPI_HID_DEVICE_PATH                 Acpi;\r
-\r
-  ATAPI_DEVICE_PATH                    Atapi;\r
-  SCSI_DEVICE_PATH                     Scsi;\r
-  ISCSI_DEVICE_PATH                    Iscsi;\r
-  FIBRECHANNEL_DEVICE_PATH             FibreChannel;\r
-\r
-  F1394_DEVICE_PATH                    F1394;\r
-  USB_DEVICE_PATH                      Usb;\r
-  SATA_DEVICE_PATH                     Sata;\r
-  USB_CLASS_DEVICE_PATH                UsbClass;\r
-  I2O_DEVICE_PATH                      I2O;\r
-  MAC_ADDR_DEVICE_PATH                 MacAddr;\r
-  IPv4_DEVICE_PATH                     Ipv4;\r
-  IPv6_DEVICE_PATH                     Ipv6;\r
-  INFINIBAND_DEVICE_PATH               InfiniBand;\r
-  UART_DEVICE_PATH                     Uart;\r
-\r
-  HARDDRIVE_DEVICE_PATH                HardDrive;\r
-  CDROM_DEVICE_PATH                    CD;\r
-\r
-  FILEPATH_DEVICE_PATH                 FilePath;\r
-  MEDIA_PROTOCOL_DEVICE_PATH           MediaProtocol;\r
-\r
-  BBS_BBS_DEVICE_PATH                  Bbs;\r
-} EFI_DEV_PATH;\r
-\r
-\r
-\r
-typedef union {\r
-  EFI_DEVICE_PATH_PROTOCOL             *DevPath;\r
-  PCI_DEVICE_PATH                      *Pci;\r
-  PCCARD_DEVICE_PATH                   *PcCard;\r
-  MEMMAP_DEVICE_PATH                   *MemMap;\r
-  VENDOR_DEVICE_PATH                   *Vendor;\r
-\r
-  CONTROLLER_DEVICE_PATH               *Controller;\r
-  ACPI_HID_DEVICE_PATH                 *Acpi;\r
-  ACPI_EXTENDED_HID_DEVICE_PATH        *ExtendedAcpi;\r
-\r
-  ATAPI_DEVICE_PATH                    *Atapi;\r
-  SCSI_DEVICE_PATH                     *Scsi;\r
-  FIBRECHANNEL_DEVICE_PATH             *FibreChannel;\r
-\r
-  F1394_DEVICE_PATH                    *F1394;\r
-  USB_DEVICE_PATH                      *Usb;\r
-  SATA_DEVICE_PATH                     *Sata;\r
-  USB_CLASS_DEVICE_PATH                *UsbClass;\r
-  I2O_DEVICE_PATH                      *I2O;\r
-  MAC_ADDR_DEVICE_PATH                 *MacAddr;\r
-  IPv4_DEVICE_PATH                     *Ipv4;\r
-  IPv6_DEVICE_PATH                     *Ipv6;\r
-  INFINIBAND_DEVICE_PATH               *InfiniBand;\r
-  UART_DEVICE_PATH                     *Uart;\r
-\r
-  HARDDRIVE_DEVICE_PATH                *HardDrive;\r
-  CDROM_DEVICE_PATH                    *CD;\r
-\r
-  FILEPATH_DEVICE_PATH                 *FilePath;\r
-  MEDIA_PROTOCOL_DEVICE_PATH           *MediaProtocol;\r
-\r
-  BBS_BBS_DEVICE_PATH                  *Bbs;\r
-  UINT8                                *Raw;\r
-} EFI_DEV_PATH_PTR;\r
-\r
-#pragma pack()\r
-                                             \r
-#define EFI_DP_TYPE_MASK                     0x7F\r
-#define EFI_DP_TYPE_UNPACKED                 0x80\r
-#define END_DEVICE_PATH_TYPE                 0x7f\r
-                                             \r
-#define EFI_END_ENTIRE_DEVICE_PATH           0xff\r
-#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE   0xff\r
-#define EFI_END_INSTANCE_DEVICE_PATH         0x01\r
-#define END_ENTIRE_DEVICE_PATH_SUBTYPE       EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE\r
-#define END_INSTANCE_DEVICE_PATH_SUBTYPE     EFI_END_INSTANCE_DEVICE_PATH\r
-                                             \r
-#define EFI_END_DEVICE_PATH_LENGTH           (sizeof (EFI_DEVICE_PATH_PROTOCOL))\r
-#define END_DEVICE_PATH_LENGTH               EFI_END_DEVICE_PATH_LENGTH\r
-                                             \r
-#define DP_IS_END_TYPE(a)                    \r
-#define DP_IS_END_SUBTYPE(a)                 (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
-#define DevicePathSubType(a)                 ((a)->SubType)\r
-#define IsDevicePathUnpacked(a)              ((a)->Type & EFI_DP_TYPE_UNPACKED)\r
-                                             \r
-#define EfiDevicePathNodeLength(a)           (((a)->Length[0]) | ((a)->Length[1] << 8))\r
-#define DevicePathNodeLength(a)              (EfiDevicePathNodeLength(a))\r
-#define EfiNextDevicePathNode(a)             ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))\r
-#define NextDevicePathNode(a)                (EfiNextDevicePathNode(a)) \r
-                                             \r
-#define EfiDevicePathType(a)                 (((a)->Type) & EFI_DP_TYPE_MASK)\r
-#define DevicePathType(a)                    (EfiDevicePathType(a))\r
-#define EfiIsDevicePathEndType(a)            (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)\r
-#define IsDevicePathEndType(a)               (EfiIsDevicePathEndType(a)) \r
-                                             \r
-                                             \r
-#define EfiIsDevicePathEndSubType(a)         ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
-#define IsDevicePathEndSubType(a)            (EfiIsDevicePathEndSubType(a))\r
-#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)\r
-                                             \r
-#define EfiIsDevicePathEnd(a)                (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))\r
-#define IsDevicePathEnd(a)                   (EfiIsDevicePathEnd(a))\r
-#define EfiIsDevicePathEndInstance(a)        (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))\r
-\r
-\r
-#define SetDevicePathNodeLength(a,l) {                           \\r
-          (a)->Length[0] = (UINT8) (l);                          \\r
-          (a)->Length[1] = (UINT8) ((l) >> 8);                   \\r
-          }\r
-\r
-#define SetDevicePathEndNode(a)  {                               \\r
-          (a)->Type = END_DEVICE_PATH_TYPE;                      \\r
-          (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;         \\r
-          (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL);     \\r
-          (a)->Length[1] = 0;                                    \\r
-          }\r
-\r
-extern EFI_GUID gEfiDevicePathProtocolGuid;\r
-\r
-#endif\r
index 406a12491d5f68536996fffbea6eeaf1c7d072f3..aad9417156091d3954bccf2023a3f2450da72556 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -23,7 +23,6 @@ Abstract:
 #define _EFIVFR_H_\r
 \r
 #include "Common/UefiBaseTypes.h"\r
-#include "Protocol/DevicePath.h"\r
 #include "Common/UefiInternalFormRepresentation.h"\r
 #include "Common/MdeModuleHii.h"\r
 \r
@@ -43,6 +42,7 @@ typedef enum {
   QUESTION_NORMAL,\r
   QUESTION_DATE,\r
   QUESTION_TIME,\r
+  QUESTION_REF,\r
 } EFI_QUESION_TYPE;\r
 \r
 typedef enum {\r
index 5985a7ad5db5017b0a79c0a3c35890c007498de1..926561760a5b8e7d92790dd1e1bdad81b27645fc 100644 (file)
@@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 PACKAGE_DATA  gCBuffer;\r
 PACKAGE_DATA  gRBuffer;\r
+CVfrStringDB  gCVfrStringDB;\r
 \r
 VOID \r
 CVfrCompiler::DebugError (\r
@@ -62,7 +63,9 @@ CVfrCompiler::OptionInitialization (
   )\r
 {\r
   INT32         Index;\r
-  \r
+  EFI_STATUS    Status;\r
+\r
+  Status = EFI_SUCCESS;\r
   SetUtilityName ((CHAR8*) PROGRAM_NAME);\r
 \r
   mOptions.VfrFileName[0]                = '\0';\r
@@ -78,6 +81,8 @@ CVfrCompiler::OptionInitialization (
   mOptions.SkipCPreprocessor             = TRUE;\r
   mOptions.CPreprocessorOptions          = NULL;\r
   mOptions.CompatibleMode                = FALSE;\r
+  mOptions.HasOverrideClassGuid          = FALSE;\r
+  memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));\r
   \r
   if (Argc == 1) {\r
     Usage ();\r
@@ -132,6 +137,22 @@ CVfrCompiler::OptionInitialization (
       AppendCPreprocessorOptions (Argv[Index]);\r
     } else if (stricmp(Argv[Index], "-c") == 0 || stricmp(Argv[Index], "--compatible-framework") == 0) {\r
       mOptions.CompatibleMode = TRUE;\r
+    } else if (stricmp(Argv[Index], "-s") == 0|| stricmp(Argv[Index], "--string-db") == 0) {\r
+      Index++;\r
+      if ((Index >= Argc) || (Argv[Index][0] == '-')) {\r
+        DebugError (NULL, 0, 1001, "Missing option", "-s missing input string file name");\r
+        goto Fail;\r
+      }\r
+      gCVfrStringDB.SetStringFileName(Argv[Index]);\r
+      DebugMsg (NULL, 0, 9, (CHAR8 *) "Input string file path", Argv[Index]);\r
+    } else if ((stricmp (Argv[Index], "-g") == 0) || (stricmp (Argv[Index], "--guid") == 0)) {\r
+      Index++;\r
+      Status = StringToGuid (Argv[Index], &mOptions.OverrideClassGuid);\r
+      if (EFI_ERROR (Status)) {\r
+        DebugError (NULL, 0, 1000, "Invalid format:", "%s", Argv[Index]);\r
+        goto Fail;\r
+      }\r
+      mOptions.HasOverrideClassGuid = TRUE;\r
     } else {\r
       DebugError (NULL, 0, 1000, "Unknown option", "unrecognized option %s", Argv[Index]);\r
       goto Fail;\r
@@ -399,6 +420,11 @@ CVfrCompiler::Usage (
     "                 do not preprocessing input file",\r
     "  -c, --compatible-framework",\r
     "                 compatible framework vfr file",\r
+    "  -s, --string-db",\r
+    "                 input uni string package file",\r
+    "  -g, --guid",\r
+    "                 override class guid input",\r
+    "                 format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",\r
     NULL\r
     };\r
   for (Index = 0; Help[Index] != NULL; Index++) {\r
@@ -472,7 +498,7 @@ Fail:
   delete PreProcessCmd;\r
 }\r
 \r
-extern UINT8 VfrParserStart (IN FILE *, IN BOOLEAN);\r
+extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *);\r
 \r
 VOID\r
 CVfrCompiler::Compile (\r
@@ -481,6 +507,7 @@ CVfrCompiler::Compile (
 {\r
   FILE  *pInFile    = NULL;\r
   CHAR8 *InFileName = NULL;\r
+  INPUT_INFO_TO_SYNTAX InputInfo;\r
 \r
   if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {\r
     goto Fail;\r
@@ -495,7 +522,14 @@ CVfrCompiler::Compile (
     goto Fail;\r
   }\r
 \r
-  if (VfrParserStart (pInFile, mOptions.CompatibleMode) != 0) {\r
+  InputInfo.CompatibleMode = mOptions.CompatibleMode;\r
+  if (mOptions.HasOverrideClassGuid) {\r
+    InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;\r
+  } else {\r
+    InputInfo.OverrideClassGuid = NULL;\r
+  }\r
+\r
+  if (VfrParserStart (pInFile, &InputInfo) != 0) {\r
     goto Fail;\r
   }\r
 \r
index 7525bb5603c992f870c3d7e7cf7b5bd2a91e8c45..1c83e87f5f5cf315726ff70d45248d809ab18d24 100644 (file)
@@ -20,10 +20,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "EfiVfr.h"\r
 #include "VfrFormPkg.h"\r
 #include "VfrUtilityLib.h"\r
+#include "ParseInf.h"\r
 \r
 #define PROGRAM_NAME                       "VfrCompile"\r
-#define VFR_COMPILER_VERSION               " 1.95 (UEFI 2.1)"\r
-#define VFR_COMPILER_UPDATE_TIME           " updated on 2011/02/25"\r
+#define VFR_COMPILER_VERSION               " 2.00 (UEFI 2.3.1)"\r
+#define VFR_COMPILER_UPDATE_TIME           " updated on 2011/07/15"\r
 //\r
 // This is how we invoke the C preprocessor on the VFR source file\r
 // to resolve #defines, #includes, etc. To make C source files\r
@@ -54,6 +55,8 @@ typedef struct {
   bool    SkipCPreprocessor;\r
   CHAR8   *CPreprocessorOptions;\r
   BOOLEAN CompatibleMode;\r
+  BOOLEAN HasOverrideClassGuid;\r
+  EFI_GUID OverrideClassGuid;\r
 } OPTIONS;\r
 \r
 typedef enum {\r
index 571af91b0a93c70072d2b8bfdb63fe08c4ea3f86..6401e71f4df9fdb3ced69565033e6955c6d254b6 100644 (file)
@@ -1305,6 +1305,8 @@ static struct {
   { sizeof (EFI_IFR_CATENATE), 0 },            // EFI_IFR_CATENATE_OP\r
   { sizeof (EFI_IFR_GUID), 0 },                // EFI_IFR_GUID_OP\r
   { sizeof (EFI_IFR_SECURITY), 0 },            // EFI_IFR_SECURITY_OP - 0x60\r
+  { sizeof (EFI_IFR_MODAL), 0},                // EFI_IFR_MODAL_OP - 0x61\r
+  { sizeof (EFI_IFR_REFRESH_ID), 0},           // EFI_IFR_REFRESH_ID_OP - 0x62\r
 };\r
 \r
 #ifdef CIFROBJ_DEUBG\r
@@ -1327,7 +1329,7 @@ static struct {
   "EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2",          "EFI_IFR_CONDITIONAL",   "EFI_IFR_QUESTION_REF3",   "EFI_IFR_ZERO",          "EFI_IFR_ONE",\r
   "EFI_IFR_ONES",       "EFI_IFR_UNDEFINED",            "EFI_IFR_LENGTH",        "EFI_IFR_DUP",             "EFI_IFR_THIS",          "EFI_IFR_SPAN",\r
   "EFI_IFR_VALUE",      "EFI_IFR_DEFAULT",              "EFI_IFR_DEFAULTSTORE",  "EFI_IFR_FORM_MAP",        "EFI_IFR_CATENATE",      "EFI_IFR_GUID",\r
-  "EFI_IFR_SECURITY",\r
+  "EFI_IFR_SECURITY",   "EFI_IFR_MODAL",                "EFI_IFR_REFRESH_ID",\r
 };\r
 \r
 VOID\r
index 4cdd1cc5db55c52dcef4a6455aab1423d06530fc..f908718c029bfbf2d7f72b4d717cfb880a67fe76 100644 (file)
@@ -96,6 +96,11 @@ struct SBufferNode {
   struct SBufferNode *mNext;\r
 };\r
 \r
+typedef struct {\r
+  BOOLEAN  CompatibleMode;\r
+  EFI_GUID *OverrideClassGuid;\r
+} INPUT_INFO_TO_SYNTAX;\r
+\r
 class CFormPkg {\r
 private:\r
   UINT32              mBufferSize;\r
@@ -144,7 +149,8 @@ public:
     );\r
 };\r
 \r
-extern CFormPkg gCFormPkg;\r
+extern CFormPkg       gCFormPkg;\r
+extern CVfrStringDB   gCVfrStringDB;\r
 \r
 struct SIfrRecord {\r
   UINT32     mLineNo;\r
@@ -233,6 +239,15 @@ public:
       return FALSE;\r
     }\r
   }\r
+\r
+  inline bool ShrinkObjBin (IN UINT8 Size) {\r
+    if ((mDelayEmit == TRUE) && (mObjBinLen > Size)) {\r
+      mObjBinLen -= Size;\r
+      return TRUE;\r
+    } else {\r
+      return FALSE;\r
+    }\r
+  }\r
 };\r
 \r
 /*\r
@@ -254,7 +269,7 @@ public:
 \r
   VOID DecLength (UINT8 Size) {\r
     if (mHeader->Length >= Size) {\r
-      mHeader -= Size;\r
+      mHeader->Length -= Size;\r
     }\r
   }\r
 \r
@@ -755,10 +770,12 @@ private:
   EFI_IFR_VARSTORE_EFI *mVarStoreEfi;\r
 \r
 public:\r
-  CIfrVarStoreEfi () : CIfrObj (EFI_IFR_VARSTORE_EFI_OP, (CHAR8 **)&mVarStoreEfi), \r
+  CIfrVarStoreEfi () : CIfrObj (EFI_IFR_VARSTORE_EFI_OP, (CHAR8 **)&mVarStoreEfi, sizeof (EFI_IFR_VARSTORE_EFI), TRUE),\r
                       CIfrOpHeader (EFI_IFR_VARSTORE_EFI_OP, &mVarStoreEfi->Header) {\r
     mVarStoreEfi->VarStoreId = EFI_VAROFFSET_INVALID;\r
+    mVarStoreEfi->Size       = 0;\r
     memset (&mVarStoreEfi->Guid, 0, sizeof (EFI_GUID));\r
+    mVarStoreEfi->Name[0]    = '\0';\r
   }\r
 \r
   VOID SetGuid (IN EFI_GUID *Guid) {\r
@@ -772,6 +789,36 @@ public:
   VOID SetAttributes (IN UINT32 Attributes) {\r
     mVarStoreEfi->Attributes = Attributes;\r
   }\r
+  VOID SetSize (IN UINT16 Size) {\r
+    mVarStoreEfi->Size = Size;\r
+  }\r
+\r
+  VOID SetName (IN CHAR8 *Name) {\r
+    UINT8 Len;\r
+\r
+    if (Name != NULL) {\r
+      Len = (UINT8) strlen (Name);\r
+      if (Len != 0) {\r
+        if (ExpendObjBin (Len) == TRUE) {\r
+          IncLength (Len);\r
+          strcpy ((CHAR8 *)(mVarStoreEfi->Name), Name);\r
+        }\r
+      }\r
+    }\r
+  }\r
+\r
+  VOID SetBinaryLength (IN UINT16 Size) {\r
+    UINT16 Len;\r
+\r
+    Len = sizeof (EFI_IFR_VARSTORE_EFI);\r
+    if (Size > Len) {\r
+      ExpendObjBin(Size - Len);\r
+      IncLength(Size - Len);\r
+    } else {\r
+      ShrinkObjBin(Len - Size);\r
+      DecLength(Len - Size);\r
+    }\r
+  }\r
 };\r
 \r
 class CIfrVarStoreNameValue : public CIfrObj, public CIfrOpHeader {\r
@@ -809,6 +856,17 @@ public:
   }\r
 };\r
 \r
+class CIfrModal : public CIfrObj, public CIfrOpHeader {\r
+private:\r
+  EFI_IFR_MODAL *mModal;\r
+\r
+public:\r
+  CIfrModal () : CIfrObj (EFI_IFR_MODAL_TAG_OP, (CHAR8 **)&mModal),\r
+                 CIfrOpHeader (EFI_IFR_MODAL_TAG_OP, &mModal->Header) {\r
+  }\r
+};\r
+\r
+\r
 class CIfrLocked : public CIfrObj, public CIfrOpHeader {\r
 private:\r
   EFI_IFR_LOCKED *mLocked;\r
@@ -1043,8 +1101,8 @@ private:
   EFI_IFR_REF4 *mRef4;\r
 \r
 public:\r
-  CIfrRef4 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef4, sizeof(EFI_IFR_REF3)),\r
-               CIfrOpHeader (EFI_IFR_REF_OP, &mRef4->Header, sizeof (EFI_IFR_REF3)), \r
+  CIfrRef4 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef4, sizeof(EFI_IFR_REF4)),\r
+               CIfrOpHeader (EFI_IFR_REF_OP, &mRef4->Header, sizeof(EFI_IFR_REF4)), \r
                CIfrQuestionHeader (&mRef4->Question) {\r
     mRef4->FormId     = 0;\r
     mRef4->QuestionId = EFI_QUESTION_ID_INVALID;\r
@@ -1069,6 +1127,17 @@ public:
   }\r
 };\r
 \r
+class CIfrRef5 : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {\r
+private:\r
+  EFI_IFR_REF5 *mRef5;\r
+\r
+public:\r
+  CIfrRef5 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef5, sizeof (EFI_IFR_REF5)),\r
+              CIfrOpHeader (EFI_IFR_REF_OP, &mRef5->Header, sizeof (EFI_IFR_REF5)), \r
+              CIfrQuestionHeader (&mRef5->Question) {\r
+  }\r
+};\r
+\r
 class CIfrResetButton : public CIfrObj, public CIfrOpHeader, public CIfrStatementHeader {\r
 private:\r
   EFI_IFR_RESET_BUTTON *mResetButton;\r
@@ -1481,6 +1550,21 @@ public:
   }\r
 };\r
 \r
+class CIfrRefreshId : public CIfrObj, public CIfrOpHeader {\r
+private:\r
+  EFI_IFR_REFRESH_ID *mRefreshId;\r
+\r
+public:\r
+  CIfrRefreshId () : CIfrObj (EFI_IFR_REFRESH_ID_OP, (CHAR8 **)&mRefreshId),\r
+      CIfrOpHeader (EFI_IFR_REFRESH_ID_OP, &mRefreshId->Header) {\r
+    memset (&mRefreshId->RefreshEventGroupId, 0, sizeof (EFI_GUID));\r
+  }\r
+\r
+  VOID SetRefreshEventGroutId (IN EFI_GUID *RefreshEventGroupId) {\r
+    memcpy (&mRefreshId->RefreshEventGroupId, RefreshEventGroupId, sizeof (EFI_GUID));\r
+  }\r
+};\r
+\r
 class CIfrVarStoreDevice : public CIfrObj, public CIfrOpHeader {\r
 private:\r
   EFI_IFR_VARSTORE_DEVICE *mVarStoreDevice;\r
index 02a7b5c1f4382752f44efb6b64afcd56e0fbcfb8..081c67d715dd35930b79673fd66da355ab715a13 100644 (file)
@@ -51,11 +51,12 @@ public:
 UINT8\r
 VfrParserStart (\r
   IN FILE *File,\r
-  IN BOOLEAN CompatibleMode\r
+  IN INPUT_INFO_TO_SYNTAX *InputInfo\r
   )\r
 {\r
   ParserBlackBox<CVfrDLGLexer, EfiVfrParser, ANTLRToken> VfrParser(File);\r
-  VfrParser.parser()->SetCompatibleMode (CompatibleMode);\r
+  VfrParser.parser()->SetCompatibleMode (InputInfo->CompatibleMode);\r
+  VfrParser.parser()->SetOverrideClassGuid (InputInfo->OverrideClassGuid);\r
   return VfrParser.parser()->vfrProgram();\r
 }\r
 >>\r
@@ -237,6 +238,7 @@ VfrParserStart (
 #token EndGuidOp("endguidop")                   "endguidop"\r
 #token DataType("datatype")                     "datatype"\r
 #token Data("data")                             "data"\r
+#token Modal("modal")                           "modal"\r
 \r
 //\r
 // Define the class and subclass tokens\r
@@ -340,6 +342,7 @@ vfrDataStructFields :
      dataStructFieldString |\r
      dataStructFieldDate   |\r
      dataStructFieldTime   |\r
+     dataStructFieldRef    |\r
      dataStructFieldUser\r
   )*\r
   ;\r
@@ -426,6 +429,16 @@ dataStructFieldTime :
   ";"                                               << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>\r
   ;\r
 \r
+dataStructFieldRef :\r
+  << UINT32 ArrayNum = 0; >>\r
+  D:"EFI_HII_REF"\r
+  N:StringIdentifier\r
+  {\r
+    OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
+  }\r
+  ";"                                               << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>\r
+  ;\r
+\r
 dataStructFieldUser :\r
   << UINT32 ArrayNum = 0; >>\r
   T:StringIdentifier\r
@@ -497,19 +510,42 @@ vfrFormSetDefinition :
                   ","\r
   }\r
                                                     <<\r
+                                                      if (mOverrideClassGuid != NULL && ClassGuidNum >= 3) {\r
+                                                        _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 3 class guids, can't add extra class guid!");\r
+                                                      }\r
                                                       switch (ClassGuidNum) {\r
                                                       case 0:\r
-                                                        FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));\r
+                                                        if (mOverrideClassGuid != NULL) {\r
+                                                          ClassGuidNum = 2;\r
+                                                        } else {\r
+                                                          ClassGuidNum = 1;\r
+                                                        }\r
+                                                        FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));\r
                                                         FSObj->SetClassGuid(&DefaultClassGuid);\r
+                                                        if (mOverrideClassGuid != NULL) {\r
+                                                          FSObj->SetClassGuid(mOverrideClassGuid);\r
+                                                        }                                                        \r
                                                         break;\r
                                                       case 1:\r
+                                                        if (mOverrideClassGuid != NULL) {\r
+                                                          ClassGuidNum ++;\r
+                                                        }                                                        \r
                                                         FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));\r
                                                         FSObj->SetClassGuid(&ClassGuid1);\r
+                                                        if (mOverrideClassGuid != NULL) {\r
+                                                          FSObj->SetClassGuid(mOverrideClassGuid);\r
+                                                        }                                                        \r
                                                         break;\r
                                                       case 2:\r
+                                                        if (mOverrideClassGuid != NULL) {\r
+                                                          ClassGuidNum ++;\r
+                                                        }                                                        \r
                                                         FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));\r
                                                         FSObj->SetClassGuid(&ClassGuid1);\r
                                                         FSObj->SetClassGuid(&ClassGuid2);\r
+                                                        if (mOverrideClassGuid != NULL) {\r
+                                                          FSObj->SetClassGuid(mOverrideClassGuid);\r
+                                                        }    \r
                                                         break;\r
                                                       case 3:\r
                                                         FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));\r
@@ -602,7 +638,9 @@ vfrStatementExtension:
                                                       << TypeName = D->getText(); LineNum = D->getLine(); IsStruct = TRUE;>>\r
       | T:"EFI_HII_TIME" {OpenBracket AN8:Number CloseBracket <<ArrayNum = _STOU32(AN8->getText());>>}\r
                                                       << TypeName = T->getText(); LineNum = T->getLine(); IsStruct = TRUE;>>\r
-      | TN:StringIdentifier {OpenBracket AN9:Number CloseBracket <<ArrayNum = _STOU32(AN9->getText());>>}\r
+      | R:"EFI_HII_REF" {OpenBracket AN9:Number CloseBracket <<ArrayNum = _STOU32(AN9->getText());>>}\r
+                                                      << TypeName = R->getText(); LineNum = R->getLine(); IsStruct = TRUE;>>                                                \r
+      | TN:StringIdentifier {OpenBracket AN10:Number CloseBracket <<ArrayNum = _STOU32(AN10->getText());>>}\r
                                                       << TypeName = TN->getText(); LineNum = TN->getLine(); IsStruct = TRUE;>>\r
     )\r
                                                       <<\r
@@ -794,6 +832,7 @@ vfrStatementVarStoreLinear :
     | U64:"UINT64" ","                              << TypeName = U64->getText(); LineNum = U64->getLine(); >>\r
     | D:"EFI_HII_DATE" ","                          << TypeName = D->getText(); LineNum = D->getLine(); >>\r
     | T:"EFI_HII_TIME" ","                          << TypeName = T->getText(); LineNum = T->getLine(); >>\r
+    | R:"EFI_HII_REF" ","                           << TypeName = R->getText(); LineNum = R->getLine(); >>\r
   )\r
   { Key "=" FID:Number ","                          << // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR\r
                                                        if (mCompatibleMode) {\r
@@ -838,22 +877,102 @@ vfrStatementVarStoreLinear :
 \r
 vfrStatementVarStoreEfi :\r
   <<\r
+     BOOLEAN         IsUEFI23EfiVarstore = TRUE;\r
      EFI_GUID        Guid;\r
      CIfrVarStoreEfi VSEObj;\r
-     EFI_VARSTORE_ID VarStoreId;\r
+     EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID;\r
      UINT32          Attr = 0;\r
+     UINT32          Size;\r
+     CHAR8           *TypeName;\r
+     UINT32          LineNum;\r
+     CHAR8           *StoreName = NULL;\r
   >>\r
   E:Efivarstore                                     << VSEObj.SetLineNo(E->getLine()); >>\r
-  SN:StringIdentifier ","\r
+  (\r
+      TN:StringIdentifier ","                       << TypeName = TN->getText(); LineNum = TN->getLine(); >>\r
+    | U8:"UINT8" ","                                << TypeName = U8->getText(); LineNum = U8->getLine(); >>\r
+    | U16:"UINT16" ","                              << TypeName = U16->getText(); LineNum = U16->getLine(); >>\r
+    | C16:"CHAR16" ","                              << TypeName = (CHAR8 *) "UINT16"; LineNum = C16->getLine(); >>\r
+    | U32:"UINT32" ","                              << TypeName = U32->getText(); LineNum = U32->getLine(); >>\r
+    | U64:"UINT64" ","                              << TypeName = U64->getText(); LineNum = U64->getLine(); >>\r
+    | D:"EFI_HII_DATE" ","                          << TypeName = D->getText(); LineNum = D->getLine(); >>\r
+    | T:"EFI_HII_TIME" ","                          << TypeName = T->getText(); LineNum = T->getLine(); >>\r
+    | R:"EFI_HII_REF" ","                           << TypeName = R->getText(); LineNum = R->getLine(); >>    \r
+  )\r
+  {\r
+    VarId "=" ID:Number ","                         <<\r
+                                                       _PCATCH(\r
+                                                         (INTN)(VarStoreId = _STOU16(ID->getText())) != 0,\r
+                                                         (INTN)TRUE,\r
+                                                         ID,\r
+                                                         "varid 0 is not allowed."\r
+                                                         );\r
+                                                    >>\r
+  }\r
   Attribute "=" vfrVarStoreEfiAttr[Attr] ( "\|" vfrVarStoreEfiAttr[Attr] )* ","\r
                                                     << VSEObj.SetAttributes (Attr); >>\r
-  Name "=" "STRING_TOKEN" "\(" VN:Number "\)" ","\r
-  VarSize "=" N:Number ","\r
-  Uuid "=" guidDefinition[Guid]                     << mCVfrDataStorage.DeclareEfiVarStore (SN->getText(), &Guid, _STOSID(VN->getText()), _STOU32(N->getText())); >>\r
-                                                    <<\r
-                                                       VSEObj.SetGuid (&Guid);\r
-                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
+\r
+  (\r
+    Name    "=" SN:StringIdentifier ","             << StoreName = SN->getText();   >>\r
+   |\r
+    Name    "=" "STRING_TOKEN" "\(" VN:Number "\)" ","  \r
+    VarSize "=" N:Number ","                        << \r
+                                                       IsUEFI23EfiVarstore = FALSE;\r
+                                                       StoreName = gCVfrStringDB.GetVarStoreNameFormStringId(_STOSID(VN->getText()));\r
+                                                       if (StoreName == NULL) {\r
+                                                         _PCATCH (VFR_RETURN_UNSUPPORTED, VN->getLine(), "Can't get varstore name for this StringId!");\r
+                                                       }\r
+                                                       Size = _STOU32(N->getText());\r
+                                                       switch (Size) {\r
+                                                       case 1:\r
+                                                        TypeName = (CHAR8 *) "UINT8";\r
+                                                        break;\r
+                                                       case 2:\r
+                                                        TypeName = (CHAR8 *) "UINT16";\r
+                                                        break;\r
+                                                       case 4:\r
+                                                        TypeName = (CHAR8 *) "UINT32";\r
+                                                        break;\r
+                                                       case 8:\r
+                                                        TypeName = (CHAR8 *) "UINT64";\r
+                                                        break; \r
+                                                       default:\r
+                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, N);\r
+                                                        break;\r
+                                                       }\r
+                                                    >>\r
+  )\r
+\r
+  Uuid "=" guidDefinition[Guid]                     << \r
+                                                       if (IsUEFI23EfiVarstore) {\r
+                                                       _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (\r
+                                                                                  StoreName,\r
+                                                                                  &Guid,\r
+                                                                                  &gCVfrVarDataTypeDB,\r
+                                                                                  TypeName,\r
+                                                                                  VarStoreId\r
+                                                                                  ), LineNum);                                                        \r
+                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId), SN);\r
+                                                         _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);\r
+                                                       } else {\r
+                                                        _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (\r
+                                                                                  TN->getText(),\r
+                                                                                  &Guid,\r
+                                                                                  &gCVfrVarDataTypeDB,\r
+                                                                                  TypeName,\r
+                                                                                  VarStoreId\r
+                                                                                  ), LineNum);                                                      \r
+                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId(TN->getText(), &VarStoreId), VN);\r
+                                                         _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), N->getLine());\r
+                                                       }\r
+                                                       VSEObj.SetGuid (&Guid);                                                       \r
                                                        VSEObj.SetVarStoreId (VarStoreId);\r
+                                                       \r
+                                                       VSEObj.SetSize ((UINT16) Size);\r
+                                                       VSEObj.SetName (StoreName);\r
+                                                       if (IsUEFI23EfiVarstore == FALSE && StoreName != NULL) {\r
+                                                         delete StoreName; \r
+                                                       }\r
                                                     >>\r
   ";"\r
   ;\r
@@ -978,39 +1097,31 @@ vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_
                                                        case QUESTION_TIME:\r
                                                          mCVfrQuestionDB.RegisterNewTimeQuestion (QName, VarIdStr, QId);\r
                                                          break;\r
+                                                       case QUESTION_REF:\r
+                                                         //\r
+                                                         // VarIdStr != NULL stand for question with storagae.\r
+                                                         //\r
+                                                         if (VarIdStr != NULL) {\r
+                                                           mCVfrQuestionDB.RegisterRefQuestion (QName, VarIdStr, QId);\r
+                                                         } else {\r
+                                                           mCVfrQuestionDB.RegisterQuestion (QName, NULL, QId);\r
+                                                         }\r
+                                                         break;\r
                                                        default:\r
                                                        _PCATCH(VFR_RETURN_FATAL_ERROR);\r
                                                        }\r
                                                        $QHObj.SetQuestionId (QId);\r
-                                                       $QHObj.SetVarStoreInfo (&Info);\r
+                                                       if (VarIdStr != NULL) {\r
+                                                        $QHObj.SetVarStoreInfo (&Info);\r
+                                                       }\r
                                                     >>\r
   vfrStatementHeader[&$QHObj]\r
-                                                    << _SAVE_CURRQEST_VARINFO (Info); >>\r
-                                                    << if (VarIdStr != NULL) delete VarIdStr; >>\r
-  ;\r
-\r
-vfrQuestionHeaderWithNoStorage[CIfrQuestionHeader *QHObj] :\r
-  <<\r
-     EFI_QUESTION_ID   QId = EFI_QUESTION_ID_INVALID;\r
-     CHAR8             *QName = NULL;\r
-  >>\r
-  {\r
-    Name "=" QN:StringIdentifier ","                <<\r
-                                                       QName = QN->getText();\r
-                                                       _PCATCH(mCVfrQuestionDB.FindQuestion (QName), VFR_RETURN_UNDEFINED, QN, "has already been used please used anther name");\r
-                                                    >>\r
-  }\r
-  {\r
-    QuestionId "=" ID:Number ","                    <<\r
-                                                       QId = _STOQID(ID->getText());\r
-                                                       _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "redefined quesiont ID");\r
-                                                    >>\r
-  }\r
-                                                    <<\r
-                                                       mCVfrQuestionDB.RegisterQuestion (QName, NULL, QId);\r
-                                                       $QHObj->SetQuestionId (QId);\r
+                                                    << \r
+                                                       if (VarIdStr != NULL) {\r
+                                                         delete VarIdStr; \r
+                                                         _SAVE_CURRQEST_VARINFO (Info);\r
+                                                       }\r
                                                     >>\r
-  vfrStatementHeader[$QHObj]\r
   ;\r
 \r
 questionheaderFlagsField[UINT8 & Flags] :\r
@@ -1060,6 +1171,8 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                          _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1);\r
                                                          _PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);\r
                                                        }\r
+\r
+                                                       QuestVarIdStr = VarIdStr;\r
                                                     >>\r
   )\r
   |\r
@@ -1194,6 +1307,9 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr,
   ;\r
 \r
 vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :\r
+  <<\r
+    EFI_GUID Guid;\r
+  >>\r
     N1:Number                                       <<\r
                                                        switch ($Type) {\r
                                                        case EFI_IFR_TYPE_NUM_SIZE_8 :\r
@@ -1216,6 +1332,7 @@ vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
                                                        break;\r
                                                        case EFI_IFR_TYPE_TIME :\r
                                                        case EFI_IFR_TYPE_DATE :\r
+                                                       case EFI_IFR_TYPE_REF  :\r
                                                        default :\r
                                                        break;\r
                                                        }\r
@@ -1227,6 +1344,8 @@ vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
   | Z:Zero                                          << $Value.u8     = _STOU8(Z->getText()); >>\r
   | HOUR:Number ":" MINUTE:Number ":" SECOND:Number << $Value.time   = _STOT(HOUR->getText(), MINUTE->getText(), SECOND->getText()); >>\r
   | YEAR:Number "/" MONTH:Number "/" DAY:Number     << $Value.date   = _STOD(YEAR->getText(), MONTH->getText(), DAY->getText()); >>\r
+  | QI:Number";" FI:Number";" guidDefinition[Guid] ";" "STRING_TOKEN" "\(" DP:Number "\)" \r
+                                                    << $Value.ref    = _STOR(QI->getText(), FI->getText(), &Guid, DP->getText()); >>\r
   | "STRING_TOKEN" "\(" S1:Number "\)"              << $Value.string = _STOSID(S1->getText()); >>\r
   ;\r
 \r
@@ -1251,7 +1370,8 @@ vfrFormDefinition :
     vfrStatementBanner                       |\r
     // Just for framework vfr compatibility\r
     vfrStatementInvalid                      |\r
-    vfrStatementExtension\r
+    vfrStatementExtension                    |\r
+    vfrStatementModal\r
   )*\r
   E:EndForm                                         <<\r
                                                       if (mCompatibleMode) {\r
@@ -1310,7 +1430,8 @@ vfrFormMapDefinition :
     vfrStatementConditional                  |\r
     vfrStatementLabel                        |\r
     vfrStatementBanner                       |\r
-    vfrStatementExtension\r
+    vfrStatementExtension                    |\r
+    vfrStatementModal\r
   )*\r
   E:EndForm                                         << CRT_END_OP (E); >>\r
   ";"\r
@@ -1516,7 +1637,7 @@ vfrStatementCrossReference :
 \r
 vfrStatementGoto :\r
   <<\r
-     UINT8               RefType = 1;\r
+     UINT8               RefType = 5;\r
      EFI_STRING_ID       DevPath = EFI_STRING_ID_INVALID;\r
      EFI_GUID            FSId = {0,};\r
      EFI_FORM_ID         FId;\r
@@ -1527,9 +1648,10 @@ vfrStatementGoto :
      CIfrRef2            *R2Obj = NULL;\r
      CIfrRef3            *R3Obj = NULL;\r
      CIfrRef4            *R4Obj = NULL;\r
+     CIfrRef5            *R5Obj = NULL;\r
   >>\r
   G:Goto\r
-  (\r
+  {\r
     (\r
       DevicePath "=" "STRING_TOKEN" "\(" P:Number "\)" ","\r
       FormSetGuid "=" guidDefinition[FSId] ","\r
@@ -1569,9 +1691,16 @@ vfrStatementGoto :
                                                           FId = _STOFID(F4->getText());\r
                                                        >>\r
     )\r
-  )\r
+  }\r
                                                        <<\r
                                                           switch (RefType) {\r
+                                                          case 5:\r
+                                                            {\r
+                                                              R5Obj = new CIfrRef5;\r
+                                                              QHObj = R5Obj;\r
+                                                              R5Obj->SetLineNo(G->getLine());\r
+                                                              break;\r
+                                                            }\r
                                                           case 4:\r
                                                             {\r
                                                               R4Obj = new CIfrRef4;\r
@@ -1613,13 +1742,13 @@ vfrStatementGoto :
                                                           default: break;\r
                                                           }\r
                                                        >>\r
-  vfrQuestionHeaderWithNoStorage[QHObj]\r
+  vfrQuestionHeader[*QHObj, QUESTION_REF]\r
   { "," vfrStatementStatTagList }\r
   { "," F:FLAGS  "=" vfrGotoFlags[QHObj, F->getLine()] }\r
   {\r
     "," Key "=" KN:Number                              << AssignQuestionKey (*QHObj, KN); >>\r
   }\r
-  ";"                                                  << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} >>\r
+  ";"                                                  << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} if (R5Obj != NULL) {delete R5Obj;}>>\r
   ;\r
 \r
 vfrGotoFlags [CIfrQuestionHeader *QHObj, UINT32 LineNum] :\r
@@ -1792,7 +1921,7 @@ checkboxFlagsField[UINT8 & LFlags, UINT8 & HFlags] :
 vfrStatementAction :\r
   << CIfrAction AObj; >>\r
   L:Action                                             << AObj.SetLineNo(L->getLine()); >>\r
-  vfrQuestionHeaderWithNoStorage[&AObj] ","\r
+  vfrQuestionHeader[AObj] ","\r
   { F:FLAGS "=" vfrActionFlags[AObj, F->getLine()] "," }\r
   Config "=" "STRING_TOKEN" "\(" S:Number "\)" ","     << AObj.SetQuestionConfig (_STOSID(S->getText())); >>\r
   vfrStatementQuestionTagList\r
@@ -2339,7 +2468,8 @@ vfrStatementQuestionTag :
   vfrStatementDisableIfQuest    |\r
   vfrStatementRefresh           |\r
   vfrStatementVarstoreDevice    |\r
-  vfrStatementExtension\r
+  vfrStatementExtension         |\r
+  vfrStatementRefreshEvent\r
   ;\r
 \r
 vfrStatementQuestionTagList :\r
@@ -2490,6 +2620,11 @@ vfrLockedTag :
   L:Locked                                             << LObj.SetLineNo(L->getLine()); >>\r
   ;\r
 \r
+vfrModalTag :\r
+  << CIfrModal MObj; >>\r
+  L:Modal                                             << MObj.SetLineNo(L->getLine()); >>\r
+  ;\r
+\r
 vfrStatementStatTag :\r
   vfrImageTag  |\r
   vfrLockedTag\r
@@ -2504,6 +2639,11 @@ vfrStatementImage :
   ";"\r
   ;\r
 \r
+vfrStatementModal :\r
+  vfrModalTag\r
+  ";"\r
+  ;\r
+\r
 vfrStatementLocked :\r
   vfrLockedTag\r
   ";"\r
@@ -2543,6 +2683,15 @@ vfrStatementRefresh :
   Interval "=" I:Number                                << RObj.SetRefreshInterval (_STOU8(I->getText())); >>\r
   ;\r
 \r
+vfrStatementRefreshEvent :\r
+  <<\r
+    CIfrRefreshId RiObj;\r
+    EFI_GUID      Guid;\r
+  >>\r
+  L:RefreshGuid                                        << RiObj.SetLineNo(L->getLine()); >>\r
+  "="  guidDefinition[Guid] ","                        << RiObj.SetRefreshEventGroutId (&Guid);  >>\r
+  ;\r
+\r
 vfrStatementVarstoreDevice :\r
   << CIfrVarStoreDevice VDObj; >>\r
   L:VarstoreDevice                                     << VDObj.SetLineNo(L->getLine()); >>\r
@@ -2811,6 +2960,7 @@ vfrStatementInvalidSaveRestoreDefaults :
 #token QuestionRefVal("questionrefval")         "questionrefval"\r
 #token StringRefVal("stringrefval")             "stringrefval"\r
 #token Map("map")                               "map"\r
+#token RefreshGuid("refreshguid")               "refreshguid"\r
 \r
 //\r
 // Root expression extension function called by other function.\r
@@ -3687,6 +3837,7 @@ private:
 \r
 \r
   EFI_VARSTORE_INFO   mCurrQestVarInfo;\r
+  EFI_GUID            *mOverrideClassGuid;\r
 \r
 //\r
 // For framework vfr compatibility\r
@@ -3720,6 +3871,7 @@ public:
   UINT64              _STOU64 (IN CHAR8 *);\r
   EFI_HII_DATE        _STOD   (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *);\r
   EFI_HII_TIME        _STOT   (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *);\r
+  EFI_HII_REF         _STOR   (IN CHAR8 *, IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *);\r
 \r
   EFI_STRING_ID       _STOSID (IN CHAR8 *);\r
   EFI_FORM_ID         _STOFID (IN CHAR8 *);\r
@@ -3737,6 +3889,7 @@ public:
   VOID                IdEqValDoSpecial      (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN EFI_COMPARE_TYPE);\r
   VOID                IdEqIdDoSpecial       (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_COMPARE_TYPE);\r
   VOID                IdEqListDoSpecial     (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN UINT16 *);\r
+  VOID                SetOverrideClassGuid  (IN EFI_GUID *);\r
 //\r
 // For framework vfr compatibility\r
 //\r
@@ -4158,6 +4311,25 @@ EfiVfrParser::_STRCAT (
   *Dest = NewStr;\r
 }\r
 \r
+EFI_HII_REF\r
+EfiVfrParser::_STOR (\r
+  IN CHAR8    *QuestionId,\r
+  IN CHAR8    *FormId,\r
+  IN EFI_GUID *FormSetGuid,\r
+  IN CHAR8    *DevicePath\r
+  )\r
+{\r
+  EFI_HII_REF Ref;\r
+  UINT32      Index;\r
+\r
+  memcpy (&Ref.FormSetGuid, FormSetGuid, sizeof (EFI_GUID));\r
+  Ref.QuestionId  = _STOQID (QuestionId);\r
+  Ref.FormId      = _STOFID (FormId);\r
+  Ref.DevicePath  = _STOSID (DevicePath);\r
+\r
+  return Ref;\r
+}\r
+\r
 //\r
 // framework vfr to default declare varstore for each structure\r
 //\r
@@ -4225,6 +4397,9 @@ EfiVfrParser::_DeclareDefaultFrameworkVarStore (
       VSEObj.SetAttributes (0x00000002); //hardcode EFI_VARIABLE_BOOTSERVICE_ACCESS attribute\r
       VSEObj.SetGuid (&pNode->mGuid);\r
       VSEObj.SetVarStoreId (pNode->mVarStoreId);\r
+      // Generate old efi varstore storage structure for compatiable with old "VarEqVal" opcode,\r
+      // which is 3 bytes less than new structure define in UEFI Spec 2.3.1.\r
+      VSEObj.SetBinaryLength (sizeof (EFI_IFR_VARSTORE_EFI) - 3);\r
 #ifdef VFREXP_DEBUG\r
       printf ("undefined Efi VarStoreName is %s and Id is 0x%x\n", pNode->mVarStoreName, pNode->mVarStoreId);\r
 #endif\r
@@ -4523,6 +4698,12 @@ EfiVfrParser::IdEqListDoSpecial (
   }\r
 }\r
 \r
+VOID \r
+EfiVfrParser::SetOverrideClassGuid (IN EFI_GUID *OverrideClassGuid)\r
+{\r
+  mOverrideClassGuid = OverrideClassGuid;\r
+}\r
+\r
 //\r
 // For framework vfr compatibility\r
 //\r
index b839a0ab0e6a7d8ed98f97b22f5a4275429e3337..c3a729eabfb8d3a9c13b6f901d3fc9319318f2c2 100644 (file)
@@ -468,6 +468,7 @@ static struct {
   {"EFI_HII_DATE",  EFI_IFR_TYPE_DATE,        sizeof (EFI_HII_DATE), sizeof (UINT16)},\r
   {"EFI_STRING_ID", EFI_IFR_TYPE_STRING,      sizeof (EFI_STRING_ID),sizeof (EFI_STRING_ID)},\r
   {"EFI_HII_TIME",  EFI_IFR_TYPE_TIME,        sizeof (EFI_HII_TIME), sizeof (UINT8)},\r
+  {"EFI_HII_REF",   EFI_IFR_TYPE_REF,         sizeof (EFI_HII_REF),  sizeof (EFI_GUID)},\r
   {NULL,            EFI_IFR_TYPE_OTHER,       0,                     0}\r
 };\r
 \r
@@ -635,7 +636,7 @@ CVfrVarDataTypeDB::ExtractFieldNameAndArrary (
 \r
 EFI_VFR_RETURN_CODE\r
 CVfrVarDataTypeDB::GetTypeField (\r
-  IN  CHAR8          *FName,\r
+  IN  CONST CHAR8   *FName,\r
   IN  SVfrDataType  *Type,\r
   OUT SVfrDataField *&Field\r
   )\r
@@ -647,6 +648,20 @@ CVfrVarDataTypeDB::GetTypeField (
   }\r
 \r
   for (pField = Type->mMembers; pField != NULL; pField = pField->mNext) {\r
+    //\r
+    // For type EFI_IFR_TYPE_TIME, because field name is not correctly wrote,\r
+    // add code to adjust it.\r
+    //\r
+    if (Type->mType == EFI_IFR_TYPE_TIME) {\r
+      if (strcmp (FName, "Hour") == 0) {\r
+        FName = "Hours";\r
+      } else if (strcmp (FName, "Minute") == 0) {\r
+        FName = "Minuts";\r
+      } else if (strcmp (FName, "Second") == 0) {\r
+        FName = "Seconds";\r
+      }\r
+    }\r
+\r
     if (strcmp (pField->mFieldName, FName) == 0) {\r
       Field = pField;\r
       return VFR_RETURN_SUCCESS;\r
@@ -789,6 +804,37 @@ CVfrVarDataTypeDB::InternalTypesListInit (
         pSecondsField->mArrayNum = 0;\r
 \r
         New->mMembers            = pHoursField;\r
+      } else if (strcmp (gInternalTypesTable[Index].mTypeName, "EFI_HII_REF") == 0) {\r
+        SVfrDataField *pQuestionIdField   = new SVfrDataField;\r
+        SVfrDataField *pFormIdField       = new SVfrDataField;\r
+        SVfrDataField *pFormSetGuidField  = new SVfrDataField;\r
+        SVfrDataField *pDevicePathField   = new SVfrDataField;\r
+\r
+        strcpy (pQuestionIdField->mFieldName, "QuestionId");\r
+        GetDataType ((CHAR8 *)"UINT16", &pQuestionIdField->mFieldType);\r
+        pQuestionIdField->mOffset     = 0;\r
+        pQuestionIdField->mNext       = pFormIdField;\r
+        pQuestionIdField->mArrayNum   = 0;\r
+\r
+        strcpy (pFormIdField->mFieldName, "FormId");\r
+        GetDataType ((CHAR8 *)"UINT16", &pFormIdField->mFieldType);\r
+        pFormIdField->mOffset   = 2;\r
+        pFormIdField->mNext     = pFormSetGuidField;\r
+        pFormIdField->mArrayNum = 0;\r
+\r
+        strcpy (pFormSetGuidField->mFieldName, "FormSetGuid");\r
+        GetDataType ((CHAR8 *)"EFI_GUID", &pFormSetGuidField->mFieldType);\r
+        pFormSetGuidField->mOffset   = 4;\r
+        pFormSetGuidField->mNext     = pDevicePathField;\r
+        pFormSetGuidField->mArrayNum = 0;\r
+\r
+        strcpy (pDevicePathField->mFieldName, "DevicePath");\r
+        GetDataType ((CHAR8 *)"EFI_STRING_ID", &pDevicePathField->mFieldType);\r
+        pDevicePathField->mOffset   = 20;\r
+        pDevicePathField->mNext     = NULL;\r
+        pDevicePathField->mArrayNum = 0;\r
+\r
+        New->mMembers            = pQuestionIdField;\r
       } else {\r
         New->mMembers            = NULL;\r
       }\r
@@ -2770,6 +2816,100 @@ Err:
   }\r
 }\r
 \r
+VOID \r
+CVfrQuestionDB::RegisterRefQuestion (\r
+  IN     CHAR8           *Name,\r
+  IN     CHAR8           *BaseVarId,\r
+  IN OUT EFI_QUESTION_ID &QuestionId\r
+  )\r
+{\r
+  SVfrQuestionNode     *pNode[4] = {NULL, };\r
+  UINT32               Len;\r
+  CHAR8                *VarIdStr[4] = {NULL, };\r
+  CHAR8                 Index;\r
+\r
+  if (BaseVarId == NULL) {\r
+    return;\r
+  }\r
+\r
+  Len = strlen (BaseVarId);\r
+\r
+  VarIdStr[0] = new CHAR8[Len + strlen (".QuestionId") + 1];\r
+  if (VarIdStr[0] != NULL) {\r
+    strcpy (VarIdStr[0], BaseVarId);\r
+    strcat (VarIdStr[0], ".QuestionId");\r
+  }\r
+  VarIdStr[1] = new CHAR8[Len + strlen (".FormId") + 1];\r
+  if (VarIdStr[1] != NULL) {\r
+    strcpy (VarIdStr[1], BaseVarId);\r
+    strcat (VarIdStr[1], ".FormId");\r
+  }\r
+  VarIdStr[2] = new CHAR8[Len + strlen (".FormSetGuid") + 1];\r
+  if (VarIdStr[2] != NULL) {\r
+    strcpy (VarIdStr[2], BaseVarId);\r
+    strcat (VarIdStr[2], ".FormSetGuid");\r
+  }\r
+  VarIdStr[3] = new CHAR8[Len + strlen (".DevicePath") + 1];\r
+  if (VarIdStr[3] != NULL) {\r
+    strcpy (VarIdStr[3], BaseVarId);\r
+    strcat (VarIdStr[3], ".DevicePath");\r
+  }\r
+\r
+  if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0])) == NULL) {\r
+    goto Err;\r
+  }\r
+  if ((pNode[1] = new SVfrQuestionNode (Name, VarIdStr[1])) == NULL) {\r
+    goto Err;\r
+  }\r
+  if ((pNode[2] = new SVfrQuestionNode (Name, VarIdStr[2])) == NULL) {\r
+    goto Err;\r
+  }\r
+  if ((pNode[3] = new SVfrQuestionNode (Name, VarIdStr[3])) == NULL) {\r
+    goto Err;\r
+  }\r
+\r
+  if (QuestionId == EFI_QUESTION_ID_INVALID) {\r
+    QuestionId = GetFreeQuestionId ();\r
+  } else {\r
+    if (ChekQuestionIdFree (QuestionId) == FALSE) {\r
+      goto Err;\r
+    }\r
+    MarkQuestionIdUsed (QuestionId);\r
+  }\r
+\r
+  pNode[0]->mQuestionId = QuestionId;\r
+  pNode[1]->mQuestionId = QuestionId;\r
+  pNode[2]->mQuestionId = QuestionId;\r
+  pNode[3]->mQuestionId = QuestionId;  \r
+  pNode[0]->mQtype      = QUESTION_REF;\r
+  pNode[1]->mQtype      = QUESTION_REF;\r
+  pNode[2]->mQtype      = QUESTION_REF;\r
+  pNode[3]->mQtype      = QUESTION_REF;  \r
+  pNode[0]->mNext       = pNode[1];\r
+  pNode[1]->mNext       = pNode[2];\r
+  pNode[2]->mNext       = pNode[3];\r
+  pNode[3]->mNext       = mQuestionList;  \r
+  mQuestionList         = pNode[0];\r
+\r
+  gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));\r
+  gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));\r
+  gCFormPkg.DoPendingAssign (VarIdStr[2], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));\r
+  gCFormPkg.DoPendingAssign (VarIdStr[3], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));\r
+\r
+  return;\r
+\r
+  Err:\r
+  for (Index = 0; Index < 4; Index++) {\r
+    if (pNode[Index] != NULL) {\r
+      delete pNode[Index];\r
+    }\r
+\r
+    if (VarIdStr[Index] != NULL) {\r
+      delete VarIdStr[Index];\r
+    }\r
+  }\r
+}\r
+\r
 EFI_VFR_RETURN_CODE\r
 CVfrQuestionDB::UpdateQuestionId (\r
   IN EFI_QUESTION_ID   QId,\r
@@ -2894,6 +3034,402 @@ CVfrQuestionDB::FindQuestion (
   return VFR_RETURN_UNDEFINED;\r
 }\r
 \r
+CVfrStringDB::CVfrStringDB ()\r
+{\r
+  mStringFileName = NULL;\r
+}\r
+\r
+CVfrStringDB::~CVfrStringDB ()\r
+{\r
+  if (mStringFileName != NULL) {\r
+    delete mStringFileName;\r
+  }\r
+  mStringFileName = NULL;\r
+}\r
+\r
+\r
+VOID \r
+CVfrStringDB::SetStringFileName(IN CHAR8 *StringFileName)\r
+{\r
+  UINT32 FileLen = 0;\r
+\r
+  if (StringFileName == NULL) {\r
+    return;\r
+  }\r
+\r
+  FileLen = strlen (StringFileName) + 1;\r
+  mStringFileName = new CHAR8[FileLen];\r
+  if (mStringFileName == NULL) {\r
+    return;\r
+  }\r
+\r
+  strcpy (mStringFileName, StringFileName);\r
+  mStringFileName[FileLen - 1] = '\0';\r
+}\r
+\r
+CHAR8 *\r
+CVfrStringDB::GetVarStoreNameFormStringId (\r
+  IN EFI_STRING_ID StringId\r
+  )\r
+{\r
+  FILE        *pInFile    = NULL;\r
+  UINT32      NameOffset;\r
+  UINT32      Length;\r
+  UINT8       *StringPtr;\r
+  CHAR8       *StringName;\r
+  CHAR16      *UnicodeString;\r
+  CHAR8       *VarStoreName = NULL;\r
+  CHAR8       *DestTmp;\r
+  UINT8       *Current;\r
+  EFI_STATUS  Status;\r
+  CHAR8       LineBuf[EFI_IFR_MAX_LENGTH];\r
+  UINT8       BlockType;\r
+  EFI_HII_STRING_PACKAGE_HDR *PkgHeader;\r
+  \r
+  if (mStringFileName == '\0' ) {\r
+    return NULL;\r
+  }\r
+\r
+  if ((pInFile = fopen (mStringFileName, "rb")) == NULL) {\r
+    return NULL;\r
+  }\r
+\r
+  //\r
+  // Get file length.\r
+  //\r
+  fseek (pInFile, 0, SEEK_END);\r
+  Length = ftell (pInFile);\r
+  fseek (pInFile, 0, SEEK_SET);\r
+\r
+  //\r
+  // Get file data.\r
+  //\r
+  StringPtr = new UINT8[Length];\r
+  if (StringPtr == NULL) {\r
+    fclose (pInFile);\r
+    return NULL;\r
+  }\r
+  fread ((char *)StringPtr, sizeof (UINT8), Length, pInFile);\r
+  fclose (pInFile);\r
+\r
+  PkgHeader = (EFI_HII_STRING_PACKAGE_HDR *) StringPtr;\r
+  //\r
+  // Check the String package.\r
+  //\r
+  if (PkgHeader->Header.Type != EFI_HII_PACKAGE_STRINGS) {\r
+    delete StringPtr;\r
+    return NULL;\r
+  }\r
+\r
+  //\r
+  // Search the language, only search the "en-US".\r
+  //\r
+  Current = StringPtr;\r
+  while (strcmp (PkgHeader->Language, "en-US") != 0) {\r
+    Current += PkgHeader->Header.Length;\r
+    PkgHeader = (EFI_HII_STRING_PACKAGE_HDR *) Current;\r
+    //\r
+    // If can't find "en-US" string package, just return the first string package.\r
+    //\r
+    if (Current - StringPtr >= Length) {\r
+      Current = StringPtr;\r
+      break;\r
+    }\r
+  }\r
+\r
+  Current += PkgHeader->HdrSize;\r
+  //\r
+  // Find the string block according the stringId.\r
+  //\r
+  Status = FindStringBlock(Current, StringId, &NameOffset, &BlockType);\r
+  if (Status != EFI_SUCCESS) {\r
+    delete StringPtr;\r
+    return NULL;\r
+  }\r
+\r
+  //\r
+  // Get varstore name according the string type.\r
+  //\r
+  switch (BlockType) {\r
+  case EFI_HII_SIBT_STRING_SCSU:\r
+  case EFI_HII_SIBT_STRING_SCSU_FONT:\r
+  case EFI_HII_SIBT_STRINGS_SCSU:\r
+  case EFI_HII_SIBT_STRINGS_SCSU_FONT:\r
+    StringName = (CHAR8*)(Current + NameOffset);\r
+    VarStoreName = new CHAR8[strlen(StringName) + 1];\r
+    strcpy (VarStoreName, StringName);\r
+    break;\r
+  case EFI_HII_SIBT_STRING_UCS2:\r
+  case EFI_HII_SIBT_STRING_UCS2_FONT:\r
+  case EFI_HII_SIBT_STRINGS_UCS2:\r
+  case EFI_HII_SIBT_STRINGS_UCS2_FONT:\r
+    UnicodeString = (CHAR16*)(Current + NameOffset);\r
+    Length = GetUnicodeStringTextSize ((UINT8*)UnicodeString) ;\r
+    DestTmp = new CHAR8[Length / 2 + 1];\r
+    VarStoreName = DestTmp;\r
+    while (*UnicodeString != '\0') {\r
+      *(DestTmp++) = (CHAR8) *(UnicodeString++);\r
+    }\r
+    *DestTmp = '\0';\r
+    break;\r
+  default:\r
+    break;\r
+  }\r
+\r
+  delete StringPtr;\r
+\r
+  return VarStoreName;\r
+}\r
+\r
+EFI_STATUS\r
+CVfrStringDB::FindStringBlock (\r
+  IN  UINT8                           *StringData,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  OUT UINT32                          *StringTextOffset,\r
+  OUT UINT8                           *BlockType\r
+  )\r
+{\r
+  UINT8                                *BlockHdr;\r
+  EFI_STRING_ID                        CurrentStringId;\r
+  UINT32                               BlockSize;\r
+  UINT32                               Index;\r
+  UINT8                                *StringTextPtr;\r
+  UINT32                               Offset;\r
+  UINT16                               StringCount;\r
+  UINT16                               SkipCount;\r
+  UINT8                                Length8;\r
+  EFI_HII_SIBT_EXT2_BLOCK              Ext2;\r
+  UINT32                               Length32;\r
+  UINT32                               StringSize;\r
+\r
+  CurrentStringId = 1;\r
+\r
+  //\r
+  // Parse the string blocks to get the string text and font.\r
+  //\r
+  BlockHdr  = StringData;\r
+  BlockSize = 0;\r
+  Offset    = 0;\r
+  while (*BlockHdr != EFI_HII_SIBT_END) {\r
+    switch (*BlockHdr) {\r
+    case EFI_HII_SIBT_STRING_SCSU:\r
+      Offset = sizeof (EFI_HII_STRING_BLOCK);\r
+      StringTextPtr = BlockHdr + Offset;\r
+      BlockSize += Offset + strlen ((CHAR8 *) StringTextPtr) + 1;\r
+      CurrentStringId++;\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRING_SCSU_FONT:\r
+      Offset = sizeof (EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK) - sizeof (UINT8);\r
+      StringTextPtr = BlockHdr + Offset;\r
+      BlockSize += Offset + strlen ((CHAR8 *) StringTextPtr) + 1;\r
+      CurrentStringId++;\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRINGS_SCSU:\r
+      memcpy (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));\r
+      StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8);\r
+      BlockSize += StringTextPtr - BlockHdr;\r
+\r
+      for (Index = 0; Index < StringCount; Index++) {\r
+        BlockSize += strlen ((CHAR8 *) StringTextPtr) + 1;\r
+        if (CurrentStringId == StringId) {\r
+          *BlockType        = *BlockHdr;\r
+          *StringTextOffset = StringTextPtr - StringData;\r
+          return EFI_SUCCESS;\r
+        }\r
+        StringTextPtr = StringTextPtr + strlen ((CHAR8 *) StringTextPtr) + 1;\r
+        CurrentStringId++;\r
+      }\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRINGS_SCSU_FONT:\r
+      memcpy (\r
+        &StringCount,\r
+        BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+        sizeof (UINT16)\r
+        );\r
+      StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8);\r
+      BlockSize += StringTextPtr - BlockHdr;\r
+\r
+      for (Index = 0; Index < StringCount; Index++) {\r
+        BlockSize += strlen ((CHAR8 *) StringTextPtr) + 1;\r
+        if (CurrentStringId == StringId) {\r
+          *BlockType        = *BlockHdr;\r
+          *StringTextOffset = StringTextPtr - StringData;\r
+          return EFI_SUCCESS;\r
+        }\r
+        StringTextPtr = StringTextPtr + strlen ((CHAR8 *) StringTextPtr) + 1;\r
+        CurrentStringId++;\r
+      }\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRING_UCS2:\r
+      Offset        = sizeof (EFI_HII_STRING_BLOCK);\r
+      StringTextPtr = BlockHdr + Offset;\r
+      //\r
+      // Use StringSize to store the size of the specified string, including the NULL\r
+      // terminator.\r
+      //\r
+      StringSize = GetUnicodeStringTextSize (StringTextPtr);\r
+      BlockSize += Offset + StringSize;\r
+      CurrentStringId++;\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRING_UCS2_FONT:\r
+      Offset = sizeof (EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK)  - sizeof (CHAR16);\r
+      StringTextPtr = BlockHdr + Offset;\r
+      //\r
+      // Use StrSize to store the size of the specified string, including the NULL\r
+      // terminator.\r
+      //\r
+      StringSize = GetUnicodeStringTextSize (StringTextPtr);\r
+      BlockSize += Offset + StringSize;\r
+      CurrentStringId++;\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRINGS_UCS2:\r
+      Offset = sizeof (EFI_HII_SIBT_STRINGS_UCS2_BLOCK) - sizeof (CHAR16);\r
+      StringTextPtr = BlockHdr + Offset;\r
+      BlockSize += Offset;\r
+      memcpy (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));\r
+      for (Index = 0; Index < StringCount; Index++) {\r
+        StringSize = GetUnicodeStringTextSize (StringTextPtr);\r
+        BlockSize += StringSize;\r
+        if (CurrentStringId == StringId) {\r
+          *BlockType        = *BlockHdr;\r
+          *StringTextOffset = StringTextPtr - StringData;\r
+          return EFI_SUCCESS;\r
+        }\r
+        StringTextPtr = StringTextPtr + StringSize;\r
+        CurrentStringId++;\r
+      }\r
+      break;\r
+\r
+    case EFI_HII_SIBT_STRINGS_UCS2_FONT:\r
+      Offset = sizeof (EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK) - sizeof (CHAR16);\r
+      StringTextPtr = BlockHdr + Offset;\r
+      BlockSize += Offset;\r
+      memcpy (\r
+        &StringCount,\r
+        BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+        sizeof (UINT16)\r
+        );\r
+      for (Index = 0; Index < StringCount; Index++) {\r
+        StringSize = GetUnicodeStringTextSize (StringTextPtr);\r
+        BlockSize += StringSize;\r
+        if (CurrentStringId == StringId) {\r
+          *BlockType        = *BlockHdr;\r
+          *StringTextOffset = StringTextPtr - StringData;\r
+          return EFI_SUCCESS;\r
+        }\r
+        StringTextPtr = StringTextPtr + StringSize;\r
+        CurrentStringId++;\r
+      }\r
+      break;\r
+\r
+    case EFI_HII_SIBT_DUPLICATE:\r
+      if (CurrentStringId == StringId) {\r
+        //\r
+        // Incoming StringId is an id of a duplicate string block.\r
+        // Update the StringId to be the previous string block.\r
+        // Go back to the header of string block to search.\r
+        //\r
+        memcpy (\r
+          &StringId,\r
+          BlockHdr + sizeof (EFI_HII_STRING_BLOCK),\r
+          sizeof (EFI_STRING_ID)\r
+          );\r
+        CurrentStringId = 1;\r
+        BlockSize       = 0;\r
+      } else {\r
+        BlockSize       += sizeof (EFI_HII_SIBT_DUPLICATE_BLOCK);\r
+        CurrentStringId++;\r
+      }\r
+      break;\r
+\r
+    case EFI_HII_SIBT_SKIP1:\r
+      SkipCount = (UINT16) (*(BlockHdr + sizeof (EFI_HII_STRING_BLOCK)));\r
+      CurrentStringId = (UINT16) (CurrentStringId + SkipCount);\r
+      BlockSize       +=  sizeof (EFI_HII_SIBT_SKIP1_BLOCK);\r
+      break;\r
+\r
+    case EFI_HII_SIBT_SKIP2:\r
+      memcpy (&SkipCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));\r
+      CurrentStringId = (UINT16) (CurrentStringId + SkipCount);\r
+      BlockSize       +=  sizeof (EFI_HII_SIBT_SKIP2_BLOCK);\r
+      break;\r
+\r
+    case EFI_HII_SIBT_EXT1:\r
+      memcpy (\r
+        &Length8,\r
+        BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+        sizeof (UINT8)\r
+        );\r
+      BlockSize += Length8;\r
+      break;\r
+\r
+    case EFI_HII_SIBT_EXT2:\r
+      memcpy (&Ext2, BlockHdr, sizeof (EFI_HII_SIBT_EXT2_BLOCK));\r
+      BlockSize += Ext2.Length;\r
+      break;\r
+\r
+    case EFI_HII_SIBT_EXT4:\r
+      memcpy (\r
+        &Length32,\r
+        BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+        sizeof (UINT32)\r
+        );\r
+\r
+      BlockSize += Length32;\r
+      break;\r
+\r
+    default:\r
+      break;\r
+    }\r
+\r
+    if (StringId > 0 && StringId != (EFI_STRING_ID)(-1)) {\r
+      *StringTextOffset = BlockHdr - StringData + Offset;\r
+      *BlockType        = *BlockHdr;\r
+\r
+      if (StringId == CurrentStringId - 1) {\r
+        //\r
+        // if only one skip item, return EFI_NOT_FOUND.\r
+        //\r
+        if(*BlockType == EFI_HII_SIBT_SKIP2 || *BlockType == EFI_HII_SIBT_SKIP1) {\r
+          return EFI_NOT_FOUND;\r
+        } else {\r
+          return EFI_SUCCESS;\r
+        }\r
+      }\r
+\r
+      if (StringId < CurrentStringId - 1) {\r
+        return EFI_NOT_FOUND;\r
+      }\r
+    }\r
+    BlockHdr  = StringData + BlockSize;\r
+  }\r
+\r
+  return EFI_NOT_FOUND;\r
+}\r
+\r
+UINT32\r
+CVfrStringDB::GetUnicodeStringTextSize (\r
+  IN  UINT8            *StringSrc\r
+  )\r
+{\r
+  UINT32 StringSize;\r
+  CHAR16 *StringPtr;\r
+\r
+  StringSize = sizeof (CHAR16);\r
+  StringPtr  = (UINT16*)StringSrc;\r
+  while (*StringPtr++ != L'\0') {\r
+    StringSize += sizeof (CHAR16);\r
+  }\r
+\r
+  return StringSize;\r
+}\r
+\r
 BOOLEAN  VfrCompatibleMode = FALSE;\r
 \r
 CVfrVarDataTypeDB gCVfrVarDataTypeDB;\r
index b921115b0a5aeccdc2aca21f2a79152bd05876b1..9facce81499a91c7d9c761ab465d95578c051089 100644 (file)
@@ -175,7 +175,7 @@ private:
   VOID RegisterNewType (IN SVfrDataType *);\r
 \r
   EFI_VFR_RETURN_CODE ExtractStructTypeName (IN CHAR8 *&, OUT CHAR8 *);\r
-  EFI_VFR_RETURN_CODE GetTypeField (IN CHAR8 *, IN SVfrDataType *, IN SVfrDataField *&);\r
+  EFI_VFR_RETURN_CODE GetTypeField (IN CONST CHAR8 *, IN SVfrDataType *, IN SVfrDataField *&);\r
   EFI_VFR_RETURN_CODE GetFieldOffset (IN SVfrDataField *, IN UINT32, OUT UINT32 &);\r
   UINT8               GetFieldWidth (IN SVfrDataField *);\r
   UINT32              GetFieldSize (IN SVfrDataField *, IN UINT32);\r
@@ -359,6 +359,7 @@ public:
   VOID                RegisterNewDateQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);\r
   VOID                RegisterOldTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);\r
   VOID                RegisterNewTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);\r
+  VOID                RegisterRefQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);  \r
   EFI_VFR_RETURN_CODE UpdateQuestionId (IN EFI_QUESTION_ID, IN EFI_QUESTION_ID);\r
   VOID                GetQuestionId (IN CHAR8 *, IN CHAR8 *, OUT EFI_QUESTION_ID &, OUT UINT32 &, OUT EFI_QUESION_TYPE *QType = NULL);\r
   EFI_VFR_RETURN_CODE FindQuestion (IN EFI_QUESTION_ID);\r
@@ -423,4 +424,33 @@ public:
   UINT8 GetRuleId (IN CHAR8 *);\r
 };\r
 \r
+class CVfrStringDB {\r
+private:\r
+  CHAR8   *mStringFileName;\r
+\r
+  EFI_STATUS FindStringBlock (\r
+    IN  UINT8            *StringData,\r
+    IN  EFI_STRING_ID    StringId,\r
+    OUT UINT32           *StringTextOffset,\r
+    OUT UINT8            *BlockType\r
+    );\r
+\r
+  UINT32 GetUnicodeStringTextSize (\r
+    IN  UINT8            *StringSrc\r
+    );\r
+\r
+public:\r
+  CVfrStringDB ();\r
+  ~CVfrStringDB ();\r
+\r
+  VOID SetStringFileName (\r
+    IN CHAR8 *StringFileName\r
+    );\r
+\r
+  CHAR8 * GetVarStoreNameFormStringId (\r
+    IN EFI_STRING_ID StringId\r
+    );\r
+\r
+};\r
+\r
 #endif\r
index 4e2b2e47d201474096b82b84c1930825ed7a280e..ff1c4fd82c362ab6d72341bf7a9e596250042128 100644 (file)
@@ -169,10 +169,17 @@ class WorkspaceAutoGen(AutoGen):
     #   @param  FlashDefinitionFile     File of flash definition\r
     #   @param  Fds                     FD list to be generated\r
     #   @param  Fvs                     FV list to be generated\r
+    #   @param  Caps                    Capsule list to be generated\r
     #   @param  SkuId                   SKU id from command line\r
     #\r
     def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,\r
-              BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=[], Fvs=[], SkuId='', UniFlag=None):\r
+              BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=None, Fvs=None, Caps=None, SkuId='', UniFlag=None):\r
+        if Fds is None:\r
+            Fds = []\r
+        if Fvs is None:\r
+            Fvs = []\r
+        if Caps is None:\r
+            Caps = []\r
         self.MetaFile       = ActivePlatform.MetaFile\r
         self.WorkspaceDir   = WorkspaceDir\r
         self.Platform       = ActivePlatform\r
@@ -188,6 +195,7 @@ class WorkspaceAutoGen(AutoGen):
         self.FdfFile        = FlashDefinitionFile\r
         self.FdTargetList   = Fds\r
         self.FvTargetList   = Fvs\r
+        self.CapTargetList  = Caps\r
         self.AutoGenObjectList = []\r
 \r
         # there's many relative directory operations, so ...\r
@@ -228,6 +236,11 @@ class WorkspaceAutoGen(AutoGen):
         #\r
         self._CheckAllPcdsTokenValueConflict()\r
         \r
+        #\r
+        # Check PCD type and definition between DSC and DEC\r
+        #\r
+        self._CheckPcdDefineAndType()\r
+        \r
         self._BuildDir = None\r
         self._FvDir = None\r
         self._MakeFileDir = None\r
@@ -235,6 +248,56 @@ class WorkspaceAutoGen(AutoGen):
 \r
         return True\r
 \r
+    def _CheckPcdDefineAndType(self):\r
+        PcdTypeList = [\r
+            "FixedAtBuild", "PatchableInModule", "FeatureFlag",\r
+            "Dynamic", #"DynamicHii", "DynamicVpd",\r
+            "DynamicEx", # "DynamicExHii", "DynamicExVpd"\r
+        ]\r
+\r
+        # This dict store PCDs which are not used by any modules with specified arches\r
+        UnusedPcd = sdict()\r
+        for Pa in self.AutoGenObjectList:\r
+            # Key of DSC's Pcds dictionary is PcdCName, TokenSpaceGuid\r
+            for Pcd in Pa.Platform.Pcds:\r
+                PcdType = Pa.Platform.Pcds[Pcd].Type\r
+                \r
+                # If no PCD type, this PCD comes from FDF \r
+                if not PcdType:\r
+                    continue\r
+                \r
+                # Try to remove Hii and Vpd suffix\r
+                if PcdType.startswith("DynamicEx"):\r
+                    PcdType = "DynamicEx"\r
+                elif PcdType.startswith("Dynamic"):\r
+                    PcdType = "Dynamic"\r
+    \r
+                for Package in Pa.PackageList:\r
+                    # Key of DEC's Pcds dictionary is PcdCName, TokenSpaceGuid, PcdType\r
+                    if (Pcd[0], Pcd[1], PcdType) in Package.Pcds:\r
+                        break\r
+                    for Type in PcdTypeList:\r
+                        if (Pcd[0], Pcd[1], Type) in Package.Pcds:\r
+                            EdkLogger.error(\r
+                                'build',\r
+                                FORMAT_INVALID,\r
+                                "Type [%s] of PCD [%s.%s] in DSC file doesn't match the type [%s] defined in DEC file." \\r
+                                % (Pa.Platform.Pcds[Pcd].Type, Pcd[1], Pcd[0], Type),\r
+                                ExtraData=None\r
+                            )\r
+                            return\r
+                else:\r
+                    UnusedPcd.setdefault(Pcd, []).append(Pa.Arch)\r
+\r
+        for Pcd in UnusedPcd:\r
+            EdkLogger.warn(\r
+                'build',\r
+                "The PCD was not specified by any INF module in the platform for the given architecture.\n"\r
+                "\tPCD: [%s.%s]\n\tPlatform: [%s]\n\tArch: %s"\r
+                % (Pcd[1], Pcd[0], os.path.basename(str(self.MetaFile)), str(UnusedPcd[Pcd])),\r
+                ExtraData=None\r
+            )\r
+\r
     def __repr__(self):\r
         return "%s [%s]" % (self.MetaFile, ", ".join(self.ArchList))\r
 \r
@@ -2125,9 +2188,8 @@ class ModuleAutoGen(AutoGen):
     #\r
     def _GetAutoGenFileList(self):\r
         UniStringAutoGenC = True\r
-        UniStringBinBuffer = None\r
+        UniStringBinBuffer = StringIO()\r
         if self.BuildType == 'UEFI_HII':\r
-            UniStringBinBuffer = StringIO()\r
             UniStringAutoGenC = False\r
         if self._AutoGenFileList == None:\r
             self._AutoGenFileList = {}\r
index e6e884762340451ab492d01bbf2328ee4235094d..4430c94e0bdae3b2a5c59f59ae3b0bbc11b687f7 100644 (file)
@@ -1951,6 +1951,9 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH):
         if Info.ModuleType in gModuleTypeHeaderFile \
            and gModuleTypeHeaderFile[Info.ModuleType][0] != gBasicHeaderFile:
             AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.ModuleType][0])
+        if 'PcdLib' in Info.Module.LibraryClasses:
+            AutoGenH.Append("#include <Library/PcdLib.h>\n")
+
         AutoGenH.Append('\nextern GUID  gEfiCallerIdGuid;\n\n')
 
         if Info.IsLibrary:
index 6396c612ad1cf4a1e1a17141c72a4831bd142fe2..41a46fc69ddd4d6205284e5ea352f58fed7383e6 100644 (file)
@@ -1253,7 +1253,7 @@ ${END}\t@cd $(BUILD_DIR)
 #
 fds: init
 \t-@cd $(FV_DIR)
-${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list} ${extra_options}${END}${BEGIN} -r ${fd} ${END}${BEGIN} -i ${fv} ${END}${BEGIN} -D ${macro} ${END}
+${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list} ${extra_options}${END}${BEGIN} -r ${fd} ${END}${BEGIN} -i ${fv} ${END}${BEGIN} -C ${cap} ${END}${BEGIN} -D ${macro} ${END}
 
 #
 # run command for emulator platform only
@@ -1365,6 +1365,7 @@ ${END}\t@cd $(BUILD_DIR)\n
             "active_platform"           : str(PlatformInfo),
             "fd"                        : PlatformInfo.FdTargetList,
             "fv"                        : PlatformInfo.FvTargetList,
+            "cap"                       : PlatformInfo.CapTargetList,
             "extra_options"             : ExtraOption,
             "macro"                     : MacroList,
         }
index b5dc3712e0a40b7137a5d932608f0074bfca39e6..4d4e07bd709c4b123762c682b4a06a6a146bf9cb 100644 (file)
@@ -68,6 +68,8 @@ IO_UNKNOWN_ERROR = 0x6FFF
 
 COMMAND_FAILURE = 0x7000
 
+PERMISSION_FAILURE = 0x8000
+
 CODE_ERROR = 0xC0DE
 
 AUTOGEN_ERROR = 0xF000
index 7498d9e1eea50d5f59f8aa4399b065001fc6a84b..0540636988a674873d317d518e7bf9acda63ebfb 100644 (file)
@@ -252,7 +252,15 @@ def SaveFileOnChange(File, Content, IsBinaryFile=True):
         except:
             EdkLogger.error(None, FILE_OPEN_FAILURE, ExtraData=File)
 
-    CreateDirectory(os.path.dirname(File))
+    DirName = os.path.dirname(File)
+    if not CreateDirectory(DirName):
+        EdkLogger.error(None, FILE_CREATE_FAILURE, "Could not create directory %s" % DirName)
+    else:
+        if DirName == '':
+            DirName = os.getcwd()
+        if not os.access(DirName, os.W_OK):
+            EdkLogger.error(None, PERMISSION_FAILURE, "Do not have write permission on directory %s" % DirName)
+
     try:
         if GlobalData.gIsWindows:
             try:
@@ -267,8 +275,8 @@ def SaveFileOnChange(File, Content, IsBinaryFile=True):
             Fd = open(File, "wb")
             Fd.write(Content)
             Fd.close()
-    except:
-        EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData=File)
+    except IOError, X:
+        EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData='IOError %s'%X)
 
     return True
 
index 733935afe9bdf3fb1d17e3c806dbfe2b6d79131b..5cdbe8888964ef2e42922917c8fbbd9bae0e6e98 100644 (file)
@@ -1926,6 +1926,8 @@ class FdfParser:
             pass\r
 \r
         self.__GetSetStatements(FvObj)\r
+        \r
+        self.__GetFvBaseAddress(FvObj)\r
 \r
         self.__GetFvAlignment(FvObj)\r
 \r
@@ -1979,6 +1981,34 @@ class FdfParser:
             raise Warning("Unknown alignment value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
         Obj.FvAlignment = self.__Token\r
         return True\r
+    \r
+    ## __GetFvBaseAddress() method\r
+    #\r
+    #   Get BaseAddress for FV\r
+    #\r
+    #   @param  self        The object pointer\r
+    #   @param  Obj         for whom FvBaseAddress is got\r
+    #   @retval True        Successfully find a FvBaseAddress statement\r
+    #   @retval False       Not able to find a FvBaseAddress statement\r
+    #\r
+    def __GetFvBaseAddress(self, Obj):\r
+\r
+        if not self.__IsKeyword("FvBaseAddress"):\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 FV base address value", self.FileName, self.CurrentLineNumber)\r
+\r
+        IsValidBaseAddrValue = re.compile('^0[x|X][0-9a-fA-F]+')\r
+\r
+        if not IsValidBaseAddrValue.match(self.__Token.upper()):\r
+            raise Warning("Unknown alignment value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
+        Obj.FvBaseAddress = self.__Token\r
+        return True    \r
+    \r
 \r
     ## __GetFvAttributes() method\r
     #\r
index 2b556135d211543081b74b9ecfb232ef5779ce9e..742b2162fe3ff49caf11444323b7546e503014b5 100644 (file)
@@ -53,7 +53,19 @@ class FfsInfStatement(FfsInfStatementClassObject):
         self.InDsc = True\r
         self.OptRomDefs = {}\r
         self.PiSpecVersion = '0x00000000'\r
-        \r
+        self.InfModule = None\r
+        self.FinalBuildTargetList = []\r
+\r
+    ## GetFinalBuildTargetList() method\r
+    #\r
+    #    Get final build target list\r
+    def GetFinalBuildTargetList(self):\r
+        if not self.InfModule or not self.CurrentArch:\r
+            return []\r
+        if not self.FinalBuildTargetList:\r
+            self.FinalBuildTargetList = GenFdsGlobalVariable.GetModuleCodaTargetList(self.InfModule, self.CurrentArch)\r
+        return self.FinalBuildTargetList\r
+\r
     ## __InfParse() method\r
     #\r
     #   Parse inf file to get module information\r
@@ -128,6 +140,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
 \r
         if Inf._Defs != None and len(Inf._Defs) > 0:\r
             self.OptRomDefs.update(Inf._Defs)\r
+        \r
+        self.InfModule = Inf\r
             \r
         GenFdsGlobalVariable.VerboseLogger( "BaseName : %s" %self.BaseName)\r
         GenFdsGlobalVariable.VerboseLogger("ModuleGuid : %s" %self.ModuleGuid)\r
index 7b6305b48eb9f20e73f6fb8889285a8c794fdf43..773b0efbe81f073a5c687b334db207dec705f4fd 100644 (file)
@@ -46,6 +46,7 @@ class FV (FvClassObject):
         self.InfFileName = None\r
         self.FvAddressFileName = None\r
         self.CapsuleName = None\r
+        self.FvBaseAddress = None\r
 \r
     ## AddToBuffer()\r
     #\r
@@ -84,7 +85,10 @@ class FV (FvClassObject):
                                GenFdsGlobalVariable.ErrorLogger("Capsule %s in FD region can't contain a FV %s in FD region." % (self.CapsuleName, self.UiFvName.upper()))\r
 \r
         GenFdsGlobalVariable.InfLogger( "\nGenerating %s FV" %self.UiFvName)\r
-\r
+        \r
+        if self.FvBaseAddress != None:\r
+            BaseAddress = self.FvBaseAddress \r
+        \r
         self.__InitializeInf__(BaseAddress, BlockSize, BlockNum, ErasePloarity, VtfDict)\r
         #\r
         # First Process the Apriori section\r
index 04af6e2c67650fdb4185f14fd087dfbd3b3284a0..9088a876e4c9d889753622e1b6224a7b94732cb1 100644 (file)
@@ -239,6 +239,13 @@ def main():
                 EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
                                 "No such an FV in FDF file: %s" % Options.uiFvName)
 
+        if (Options.uiCapName) :
+            if Options.uiCapName.upper() in FdfParserObj.Profile.CapsuleDict.keys():
+                GenFds.OnlyGenerateThisCap = Options.uiCapName
+            else:
+                EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
+                                "No such a Capsule in FDF file: %s" % Options.uiCapName)
+
         """Modify images from build output if the feature of loading driver at fixed address is on."""
         if GenFdsGlobalVariable.FixedLoadAddress:
             GenFds.PreprocessImage(BuildWorkSpace, GenFdsGlobalVariable.ActivePlatform)
@@ -302,7 +309,8 @@ def myOptionParser():
     Parser.add_option("-o", "--outputDir", type="string", dest="outputDir", help="Name of Build Output directory",
                       action="callback", callback=SingleCheckCallback)
     Parser.add_option("-r", "--rom_image", dest="uiFdName", help="Build the image using the [FD] section named by FdUiName.")
-    Parser.add_option("-i", "--FvImage", dest="uiFvName", help="Buld the FV image using the [FV] section named by UiFvName")
+    Parser.add_option("-i", "--FvImage", dest="uiFvName", help="Build the FV image using the [FV] section named by UiFvName")
+    Parser.add_option("-C", "--CapsuleImage", dest="uiCapName", help="Build the Capsule image using the [Capsule] section named by UiCapName")
     Parser.add_option("-b", "--buildtarget", type="choice", choices=['DEBUG','RELEASE'], dest="BuildTarget", help="Build TARGET is one of list: DEBUG, RELEASE.",
                       action="callback", callback=SingleCheckCallback)
     Parser.add_option("-t", "--tagname", type="string", dest="ToolChain", help="Using the tools: TOOL_CHAIN_TAG name to build the platform.",
@@ -325,6 +333,7 @@ class GenFds :
     ImageBinDict = {}
     OnlyGenerateThisFd = None
     OnlyGenerateThisFv = None
+    OnlyGenerateThisCap = None
 
     ## GenFd()
     #
@@ -337,11 +346,18 @@ class GenFds :
         GenFdsGlobalVariable.SetDir ('', FdfParser, WorkSpace, ArchList)
 
         GenFdsGlobalVariable.VerboseLogger(" Generate all Fd images and their required FV and Capsule images!")
+        if GenFds.OnlyGenerateThisCap != None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
+            CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.get(GenFds.OnlyGenerateThisCap.upper())
+            if CapsuleObj != None:
+                CapsuleObj.GenCapsule()
+                return
+
         if GenFds.OnlyGenerateThisFd != None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
             FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(GenFds.OnlyGenerateThisFd.upper())
             if FdObj != None:
                 FdObj.GenFd()
-        elif GenFds.OnlyGenerateThisFd == None:
+                return
+        elif GenFds.OnlyGenerateThisFd == None and GenFds.OnlyGenerateThisFv == None:
             for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
                 FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]
                 FdObj.GenFd()
@@ -361,7 +377,7 @@ class GenFds :
                 FvObj.AddToBuffer(Buffer)
                 Buffer.close()
         
-        if GenFds.OnlyGenerateThisFv == None and GenFds.OnlyGenerateThisFd == None:
+        if GenFds.OnlyGenerateThisFv == None and GenFds.OnlyGenerateThisFd == None and GenFds.OnlyGenerateThisCap == None:
             if GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict != {}:
                 GenFdsGlobalVariable.VerboseLogger("\n Generate other Capsule images!")
                 for CapsuleName in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
index e9eace9c39553994d01b651c22c9feb1a1e6e40c..3abaef2023223586c37506c00f45a02341b2e318 100644 (file)
@@ -25,6 +25,12 @@ from Common.BuildToolError import *
 from Common import EdkLogger
 from Common.Misc import SaveFileOnChange
 
+from Common.TargetTxtClassObject import TargetTxtClassObject
+from Common.ToolDefClassObject import ToolDefClassObject
+from AutoGen.BuildEngine import BuildRule
+import Common.DataType as DataType
+from Common.Misc import PathClass
+
 ## Global variables
 #
 #
@@ -55,8 +61,191 @@ class GenFdsGlobalVariable:
     FdfFileTimeStamp = 0
     FixedLoadAddress = False
     PlatformName = ''
+    
+    BuildRuleFamily = "MSFT"
+    ToolChainFamily = "MSFT"
+    __BuildRuleDatabase = None
 
     SectionHeader = struct.Struct("3B 1B")
+    
+    ## LoadBuildRule
+    #
+    @staticmethod
+    def __LoadBuildRule():
+        if GenFdsGlobalVariable.__BuildRuleDatabase:
+            return GenFdsGlobalVariable.__BuildRuleDatabase
+        BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
+        TargetTxt = TargetTxtClassObject()
+        if os.path.isfile(BuildConfigurationFile) == True:
+            TargetTxt.LoadTargetTxtFile(BuildConfigurationFile)
+            if DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF in TargetTxt.TargetTxtDictionary:
+                BuildRuleFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF]
+            if BuildRuleFile in [None, '']:
+                BuildRuleFile = 'Conf/build_rule.txt'
+            GenFdsGlobalVariable.__BuildRuleDatabase = BuildRule(BuildRuleFile)
+            ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
+            if ToolDefinitionFile == '':
+                ToolDefinitionFile = "Conf/tools_def.txt"
+            if os.path.isfile(ToolDefinitionFile):
+                ToolDef = ToolDefClassObject()
+                ToolDef.LoadToolDefFile(ToolDefinitionFile)
+                ToolDefinition = ToolDef.ToolsDefTxtDatabase
+                if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition \
+                   and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \
+                   and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]:
+                    GenFdsGlobalVariable.BuildRuleFamily = ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]
+                    
+                if DataType.TAB_TOD_DEFINES_FAMILY in ToolDefinition \
+                   and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY] \
+                   and ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]:
+                    GenFdsGlobalVariable.ToolChainFamily = ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]
+        return GenFdsGlobalVariable.__BuildRuleDatabase
+
+    ## GetBuildRules
+    #    @param Inf: object of InfBuildData
+    #    @param Arch: current arch
+    #
+    @staticmethod
+    def GetBuildRules(Inf, Arch):
+        if not Arch:
+            Arch = 'COMMON'
+
+        if not Arch in GenFdsGlobalVariable.OutputDirDict:
+            return {}
+
+        BuildRuleDatabase = GenFdsGlobalVariable.__LoadBuildRule()
+        if not BuildRuleDatabase:
+            return {}
+
+        PathClassObj = PathClass(str(Inf.MetaFile).lstrip(GenFdsGlobalVariable.WorkSpaceDir),
+                                 GenFdsGlobalVariable.WorkSpaceDir)
+        Macro = {}
+        Macro["WORKSPACE"             ] = GenFdsGlobalVariable.WorkSpaceDir
+        Macro["MODULE_NAME"           ] = Inf.BaseName
+        Macro["MODULE_GUID"           ] = Inf.Guid
+        Macro["MODULE_VERSION"        ] = Inf.Version
+        Macro["MODULE_TYPE"           ] = Inf.ModuleType
+        Macro["MODULE_FILE"           ] = str(PathClassObj)
+        Macro["MODULE_FILE_BASE_NAME" ] = PathClassObj.BaseName
+        Macro["MODULE_RELATIVE_DIR"   ] = PathClassObj.SubDir
+        Macro["MODULE_DIR"            ] = PathClassObj.SubDir
+
+        Macro["BASE_NAME"             ] = Inf.BaseName
+
+        Macro["ARCH"                  ] = Arch
+        Macro["TOOLCHAIN"             ] = GenFdsGlobalVariable.ToolChainTag
+        Macro["TOOLCHAIN_TAG"         ] = GenFdsGlobalVariable.ToolChainTag
+        Macro["TARGET"                ] = GenFdsGlobalVariable.TargetName
+
+        Macro["BUILD_DIR"             ] = GenFdsGlobalVariable.OutputDirDict[Arch]
+        Macro["BIN_DIR"               ] = os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch], Arch)
+        Macro["LIB_DIR"               ] = os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch], Arch)
+        BuildDir = os.path.join(
+            GenFdsGlobalVariable.OutputDirDict[Arch],
+            Arch,
+            PathClassObj.SubDir,
+            PathClassObj.BaseName
+        )
+        Macro["MODULE_BUILD_DIR"      ] = BuildDir
+        Macro["OUTPUT_DIR"            ] = os.path.join(BuildDir, "OUTPUT")
+        Macro["DEBUG_DIR"             ] = os.path.join(BuildDir, "DEBUG")
+
+        BuildRules = {}
+        for Type in BuildRuleDatabase.FileTypeList:
+            #first try getting build rule by BuildRuleFamily
+            RuleObject = BuildRuleDatabase[Type, Inf.BuildType, Arch, GenFdsGlobalVariable.BuildRuleFamily]
+            if not RuleObject:
+                # build type is always module type, but ...
+                if Inf.ModuleType != Inf.BuildType:
+                    RuleObject = BuildRuleDatabase[Type, Inf.ModuleType, Arch, GenFdsGlobalVariable.BuildRuleFamily]
+            #second try getting build rule by ToolChainFamily
+            if not RuleObject:
+                RuleObject = BuildRuleDatabase[Type, Inf.BuildType, Arch, GenFdsGlobalVariable.ToolChainFamily]
+                if not RuleObject:
+                    # build type is always module type, but ...
+                    if Inf.ModuleType != Inf.BuildType:
+                        RuleObject = BuildRuleDatabase[Type, Inf.ModuleType, Arch, GenFdsGlobalVariable.ToolChainFamily]
+            if not RuleObject:
+                continue
+            RuleObject = RuleObject.Instantiate(Macro)
+            BuildRules[Type] = RuleObject
+            for Ext in RuleObject.SourceFileExtList:
+                BuildRules[Ext] = RuleObject
+        return BuildRules
+
+    ## GetModuleCodaTargetList
+    #
+    #    @param Inf: object of InfBuildData
+    #    @param Arch: current arch
+    #
+    @staticmethod
+    def GetModuleCodaTargetList(Inf, Arch):
+        BuildRules = GenFdsGlobalVariable.GetBuildRules(Inf, Arch)
+        if not BuildRules:
+            return []
+
+        TargetList = set()
+        FileList = []
+        for File in Inf.Sources:
+            if File.TagName in ("", "*", GenFdsGlobalVariable.ToolChainTag) and \
+                File.ToolChainFamily in ("", "*", GenFdsGlobalVariable.ToolChainFamily):
+                FileList.append((File, DataType.TAB_UNKNOWN_FILE))
+        
+        for File in Inf.Binaries:
+            if File.Target in ['COMMON', '*', GenFdsGlobalVariable.TargetName]:
+                FileList.append((File, File.Type))
+
+        for File, FileType in FileList:
+            LastTarget = None
+            RuleChain = []
+            SourceList = [File]
+            Index = 0
+            while Index < len(SourceList):
+                Source = SourceList[Index]
+                Index = Index + 1
+    
+                if File.IsBinary and File == Source and Inf.Binaries != None and File in Inf.Binaries:
+                    # Skip all files that are not binary libraries
+                    if not Inf.LibraryClass:
+                        continue            
+                    RuleObject = BuildRules[DataType.TAB_DEFAULT_BINARY_FILE]
+                elif FileType in BuildRules:
+                    RuleObject = BuildRules[FileType]
+                elif Source.Ext in BuildRules:
+                    RuleObject = BuildRules[Source.Ext]
+                else:
+                    # stop at no more rules
+                    if LastTarget:
+                        TargetList.add(str(LastTarget))
+                    break
+    
+                FileType = RuleObject.SourceFileType
+    
+                # stop at STATIC_LIBRARY for library
+                if Inf.LibraryClass and FileType == DataType.TAB_STATIC_LIBRARY:
+                    if LastTarget:
+                        TargetList.add(str(LastTarget))
+                    break
+    
+                Target = RuleObject.Apply(Source)
+                if not Target:
+                    if LastTarget:
+                        TargetList.add(str(LastTarget))
+                    break
+                elif not Target.Outputs:
+                    # Only do build for target with outputs
+                    TargetList.add(str(Target))
+    
+                # to avoid cyclic rule
+                if FileType in RuleChain:
+                    break
+    
+                RuleChain.append(FileType)
+                SourceList.extend(Target.Outputs)
+                LastTarget = Target
+                FileType = DataType.TAB_UNKNOWN_FILE
+
+        return list(TargetList)
 
     ## SetDir()
     #
@@ -459,17 +648,21 @@ class GenFdsGlobalVariable:
 
         PcdValue = ''
         for Platform in GenFdsGlobalVariable.WorkSpace.PlatformList:
-            PcdDict = Platform.Pcds
-            for Key in PcdDict:
-                PcdObj = PcdDict[Key]
-                if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):
-                    if PcdObj.Type != 'FixedAtBuild':
-                        EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
-                    if PcdObj.DatumType != 'VOID*':
-                        EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
-                        
-                    PcdValue = PcdObj.DefaultValue
-                    return PcdValue
+            #
+            # Only process platform which match current build option.
+            #
+            if Platform.MetaFile == GenFdsGlobalVariable.ActivePlatform:            
+                PcdDict = Platform.Pcds
+                for Key in PcdDict:
+                    PcdObj = PcdDict[Key]
+                    if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):
+                        if PcdObj.Type != 'FixedAtBuild':
+                            EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
+                        if PcdObj.DatumType != 'VOID*':
+                            EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
+                            
+                        PcdValue = PcdObj.DefaultValue
+                        return PcdValue
 
         for Package in GenFdsGlobalVariable.WorkSpace.PackageList:
             PcdDict = Package.Pcds
index bfa65c805484c9f40569128d264612309b8121d8..7879a9e29cdb63f88bbbb318ca194415014fec63 100644 (file)
@@ -216,7 +216,7 @@ class Region(RegionClassObject):
                                     "Size of File (%s) is larger than Region Size 0x%X specified." \\r
                                     % (RegionData, Size))\r
                 GenFdsGlobalVariable.InfLogger('   Region File Name = %s'%RegionData)\r
-                BinFile = open (RegionData, 'r+b')\r
+                BinFile = open (RegionData, 'rb')\r
                 Buffer.write(BinFile.read())\r
                 BinFile.close()\r
                 Size = Size - FileLength\r
index a6d3c6319da6da184a99805575cdcd5058e91916..d26f464ab97be7e4fecefb0e68bf8c25686fda63 100644 (file)
@@ -139,14 +139,10 @@ class Section (SectionClassObject):
                 else:\r
                     GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))\r
 \r
-        if Suffix != None and os.path.exists(FfsInf.EfiOutputPath):\r
-            # Update to search files with suffix in all sub-dirs.\r
-            Tuple = os.walk(FfsInf.EfiOutputPath)\r
-            for Dirpath, Dirnames, Filenames in Tuple:\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in (Suffix):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        FileList.append(FullName)\r
+        if Suffix != None:\r
+            for File in FfsInf.GetFinalBuildTargetList():\r
+                if os.path.splitext(File)[1] in (Suffix):\r
+                    FileList.append(File)\r
 \r
         #Process the file lists is alphabetical for a same section type\r
         if len (FileList) > 1:\r
index b3efe538d9598ba9dcedfe50bcde9b0ae89570e2..b34b56db07f4ac55fc0cbd619c7b8a0a7466f06a 100644 (file)
 \r
 FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe\r
 \r
-MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1\r
+MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii\r
 \r
 BIN_DIR=$(EDK_TOOLS_PATH)\Bin\Win32\r
 \r
-\r
-APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe $(BIN_DIR)\MigrationMsa2Inf.exe $(BIN_DIR)\Fpd2Dsc.exe $(BIN_DIR)\TargetTool.exe $(BIN_DIR)\spd2dec.exe $(BIN_DIR)\GenDepex.exe $(BIN_DIR)\GenPatchPcdTable.exe $(BIN_DIR)\PatchPcdValue.exe $(BIN_DIR)\BPDG.exe\r
+APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe $(BIN_DIR)\MigrationMsa2Inf.exe $(BIN_DIR)\Fpd2Dsc.exe $(BIN_DIR)\TargetTool.exe $(BIN_DIR)\spd2dec.exe $(BIN_DIR)\GenDepex.exe $(BIN_DIR)\GenPatchPcdTable.exe $(BIN_DIR)\PatchPcdValue.exe $(BIN_DIR)\BPDG.exe $(BIN_DIR)\UPT.exe\r
 \r
 COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \\r
               $(BASE_TOOLS_PATH)\Source\Python\Common\Database.py \\r
@@ -103,7 +102,10 @@ $(BIN_DIR)\PatchPcdValue.exe: $(BASE_TOOLS_PATH)\Source\Python\PatchPcdValue\Pat
 \r
 $(BIN_DIR)\BPDG.exe: $(BASE_TOOLS_PATH)\Source\Python\BPDG\BPDG.py $(COMMON_PYTHON)\r
   @pushd . & @cd BPDG & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) BPDG.py & @popd\r
-  \r
+\r
+$(BIN_DIR)\UPT.exe: $(BASE_TOOLS_PATH)\Source\Python\UPT\UPT.py $(BASE_TOOLS_PATH)\Source\Python\UPT\UPT.py\r
+  @pushd . & @cd UPT & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) UPT.py & @popd\r
+\r
 clean:\r
 cleanall:  \r
   @del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll\r
diff --git a/BaseTools/Source/Python/PackagingTool/DependencyRules.py b/BaseTools/Source/Python/PackagingTool/DependencyRules.py
deleted file mode 100644 (file)
index 741736e..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-## @file\r
-# This file is for installed package information database operations\r
-#\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-##\r
-# Import Modules\r
-#\r
-import sqlite3\r
-import os\r
-\r
-import Common.EdkLogger as EdkLogger\r
-import IpiDb\r
-\r
-(DEPEX_CHECK_SUCCESS, DEPEX_CHECK_MODULE_NOT_FOUND, \\r
-DEPEX_CHECK_PACKAGE_NOT_FOUND, DEPEX_CHECK_DP_NOT_FOUND) = (0, 1, 2, 3)\r
-\r
-## IpiDb\r
-#\r
-# This class represents the installed package information database\r
-# Add/Remove/Get installed distribution package information here.\r
-# \r
-# \r
-# @param object:      Inherited from object class\r
-# @param DbPath:      A string for the path of the database\r
-#\r
-# @var Conn:          Connection of the database\r
-# @var Cur:           Cursor of the connection\r
-#\r
-class DependencyRules(object):\r
-    def __init__(self, Db):\r
-        self.IpiDb = Db\r
-    \r
-    ## Check whether a module exists in current workspace.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    #\r
-    def CheckModuleExists(self, Guid, Version, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        EdkLogger.verbose("\nCheck module exists in workspace started ...")\r
-        ModuleList = []\r
-        ModuleList = self.IpiDb.GetModInPackage(Guid, Version)\r
-        ModuleList.extend(self.IpiDb.GetStandaloneModule(Guid, Version))\r
-        EdkLogger.verbose("Check module exists in workspace ... DONE!")\r
-        if len(ModuleList) > 0:\r
-            return True\r
-        else:\r
-            ReturnCode = DEPEX_CHECK_MODULE_NOT_FOUND\r
-            return False\r
-        \r
-\r
-    ## Check whether a module depex satisfied by current workspace.\r
-    #\r
-    # @param ModuleObj:  \r
-    # @param DpObj:\r
-    #\r
-    def CheckModuleDepexSatisfied(self, ModuleObj, DpObj = None, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        EdkLogger.verbose("\nCheck module depex met by workspace started ...")\r
-        for Dep in ModuleObj.PackageDependencies:\r
-            Exist = self.CheckPackageExists(Dep.PackageGuid, Dep.PackageVersion, ReturnCode)\r
-            if not Exist:\r
-                if DpObj == None:\r
-                    ReturnCode = DEPEX_CHECK_PACKAGE_NOT_FOUND\r
-                    return False\r
-                for GuidVerPair in DpObj.PackageSurfaceArea.keys():\r
-                    if Dep.PackageGuid == GuidVerPair[0]:\r
-                        if Dep.PackageVersion == None or len(Dep.PackageVersion) == 0:\r
-                            break\r
-                        if Dep.PackageVersion == GuidVerPair[1]:\r
-                            break\r
-                        else:\r
-                            ReturnCode = DEPEX_CHECK_PACKAGE_NOT_FOUND\r
-                            return False\r
-                else:\r
-                    ReturnCode = DEPEX_CHECK_PACKAGE_NOT_FOUND\r
-                    return False\r
-        return True\r
-        \r
-        EdkLogger.verbose("Check module depex met by workspace ... DONE!")\r
-    \r
-    ## Check whether a package exists in current workspace.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    #\r
-    def CheckPackageExists(self, Guid, Version, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        EdkLogger.verbose("\nCheck package exists in workspace started ...")\r
-        PkgList = []\r
-        PkgList = self.IpiDb.GetPackage(Guid, Version)\r
-        if len(PkgList) > 0:\r
-            return True\r
-        else:\r
-            ReturnCode = DEPEX_CHECK_PACKAGE_NOT_FOUND\r
-            return False\r
-        \r
-        EdkLogger.verbose("Check package exists in workspace ... DONE!")\r
-        \r
-    ## Check whether a package depex satisfied by current workspace.\r
-    #\r
-    # @param ModuleObj:  \r
-    # @param DpObj:\r
-    #\r
-    def CheckPackageDepexSatisfied(self, PkgObj, DpObj = None, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        \r
-        for ModKey in PkgObj.Modules.keys():\r
-            ModObj = PkgObj.Modules[ModKey]\r
-            if self.CheckModuleDepexSatisfied(ModObj, DpObj, ReturnCode):\r
-                continue\r
-            else:\r
-                return False\r
-        return True\r
-        \r
-    ## Check whether a DP exists in current workspace.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    #\r
-    def CheckDpExists(self, Guid, Version, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        EdkLogger.verbose("\nCheck DP exists in workspace started ...")\r
-        DpList = []\r
-        DpList = self.IpiDb.GetDp(Guid, Version)\r
-        if len(DpList) > 0:\r
-            return True\r
-        else:\r
-            ReturnCode = DEPEX_CHECK_DP_NOT_FOUND\r
-            return False\r
-        \r
-        EdkLogger.verbose("Check DP exists in workspace ... DONE!")\r
-        \r
-    ## Check whether a DP depex satisfied by current workspace.\r
-    #\r
-    # @param ModuleObj:  \r
-    # @param DpObj:\r
-    #\r
-    def CheckDpDepexSatisfied(self, DpObj, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        \r
-        for PkgKey in DpObj.PackageSurfaceArea.keys():\r
-            PkgObj = DpObj.PackageSurfaceArea[PkgKey]\r
-            if self.CheckPackageDepexSatisfied(PkgObj, DpObj, ReturnCode):\r
-                continue\r
-            else:\r
-                return False\r
-            \r
-        for ModKey in DpObj.ModuleSurfaceArea.keys():\r
-            ModObj = PkgObj.ModuleSurfaceArea[ModKey]\r
-            if self.CheckModuleDepexSatisfied(ModObj, DpObj, ReturnCode):\r
-                continue\r
-            else:\r
-                return False\r
-        \r
-        return True\r
-    \r
-    ## Check whether a DP depex satisfied by current workspace.\r
-    #\r
-    # @param ModuleObj:  \r
-    # @param DpObj:\r
-    #\r
-    def CheckDpDepexForRemove(self, DpGuid, DpVersion, ReturnCode = DEPEX_CHECK_SUCCESS):\r
-        \r
-        # Get mod list that is dependent on pkg installed from this DP.\r
-        ModList = self.IpiDb.GetDpDependentModuleList(DpGuid, DpVersion)\r
-        \r
-        if len(ModList) > 0:\r
-            return False\r
-        \r
-        return True\r
-##\r
-#\r
-# This acts like the main() function for the script, unless it is 'import'ed into another\r
-# script.\r
-#\r
-if __name__ == '__main__':\r
-    EdkLogger.Initialize()\r
-    EdkLogger.SetLevel(EdkLogger.DEBUG_0)\r
-\r
-\r
-    
\ No newline at end of file
diff --git a/BaseTools/Source/Python/PackagingTool/InstallPkg.py b/BaseTools/Source/Python/PackagingTool/InstallPkg.py
deleted file mode 100644 (file)
index 8e4d45d..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-## @file\r
-# Install distribution package.\r
-#\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-##\r
-# Import Modules\r
-#\r
-import os\r
-import sys\r
-import glob\r
-import shutil\r
-import traceback\r
-import platform\r
-from optparse import OptionParser\r
-\r
-import Common.EdkLogger as EdkLogger\r
-from Common.BuildToolError import *\r
-from Common.Misc import *\r
-from Common.XmlParser import *\r
-from Common.InfClassObjectLight import Inf\r
-from Common.DecClassObjectLight import Dec\r
-\r
-from PackageFile import *\r
-from IpiDb import *\r
-from DependencyRules import *\r
-import md5\r
-\r
-# Version and Copyright\r
-VersionNumber = "0.1"\r
-__version__ = "%prog Version " + VersionNumber\r
-__copyright__ = "Copyright (c) 2008, Intel Corporation  All rights reserved."\r
-\r
-## Check environment variables\r
-#\r
-#  Check environment variables that must be set for build. Currently they are\r
-#\r
-#   WORKSPACE           The directory all packages/platforms start from\r
-#   EDK_TOOLS_PATH      The directory contains all tools needed by the build\r
-#   PATH                $(EDK_TOOLS_PATH)/Bin/<sys> must be set in PATH\r
-#\r
-#   If any of above environment variable is not set or has error, the build\r
-#   will be broken.\r
-#\r
-def CheckEnvVariable():\r
-    # check WORKSPACE\r
-    if "WORKSPACE" not in os.environ:\r
-        EdkLogger.error("InstallPkg", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",\r
-                        ExtraData="WORKSPACE")\r
-\r
-    WorkspaceDir = os.path.normpath(os.environ["WORKSPACE"])\r
-    if not os.path.exists(WorkspaceDir):\r
-        EdkLogger.error("InstallPkg", FILE_NOT_FOUND, "WORKSPACE doesn't exist", ExtraData="%s" % WorkspaceDir)\r
-    elif ' ' in WorkspaceDir:\r
-        EdkLogger.error("InstallPkg", FORMAT_NOT_SUPPORTED, "No space is allowed in WORKSPACE path", \r
-                        ExtraData=WorkspaceDir)\r
-    os.environ["WORKSPACE"] = WorkspaceDir\r
-\r
-## Parse command line options\r
-#\r
-# Using standard Python module optparse to parse command line option of this tool.\r
-#\r
-#   @retval Opt   A optparse.Values object containing the parsed options\r
-#   @retval Args  Target of build command\r
-#\r
-def MyOptionParser():\r
-    UsageString = "%prog -i <distribution_package> [-t] [-f] [-q | -v] [-h]"\r
-\r
-    Parser = OptionParser(description=__copyright__,version=__version__,prog="InstallPkg",usage=UsageString)\r
-\r
-    Parser.add_option("-?", action="help", help="show this help message and exit")\r
-\r
-    Parser.add_option("-i", "--distribution-package", action="store", type="string", dest="PackageFile",\r
-            help="The distribution package to be installed")\r
-\r
-    Parser.add_option("-t", "--install-tools", action="store_true", type=None, dest="Tools",\r
-            help="Specify it to install tools or ignore the tools of the distribution package.")\r
-    \r
-    Parser.add_option("-f", "--misc-files", action="store_true", type=None, dest="MiscFiles",\r
-            help="Specify it to install misc file or ignore the misc files of the distribution package.")\r
-\r
-    Parser.add_option("-q", "--quiet", action="store_const", dest="LogLevel", const=EdkLogger.QUIET,\r
-            help="Disable all messages except FATAL ERRORS.")\r
-\r
-    Parser.add_option("-v", "--verbose", action="store_const", dest="LogLevel", const=EdkLogger.VERBOSE,\r
-            help="Turn on verbose output")\r
-\r
-    Parser.add_option("-d", "--debug", action="store", type="int", dest="LogLevel",\r
-            help="Enable debug messages at specified level.")\r
-\r
-    Parser.set_defaults(LogLevel=EdkLogger.INFO)\r
-\r
-    (Opt, Args)=Parser.parse_args()\r
-\r
-    return Opt\r
-\r
-def InstallNewPackage(WorkspaceDir, Path):\r
-    FullPath = os.path.normpath(os.path.join(WorkspaceDir, Path))\r
-    if os.path.exists(FullPath):\r
-        print "Directory [%s] already exists, please select another location, press [Enter] with no input to quit:" %Path\r
-        Input = sys.stdin.readline()\r
-        Input = Input.replace('\r', '').replace('\n', '')\r
-        if Input == '':\r
-            EdkLogger.error("InstallPkg", UNKNOWN_ERROR, "User interrupt")\r
-        Input = Input.replace('\r', '').replace('\n', '')\r
-        return InstallNewPackage(WorkspaceDir, Input)\r
-    else:\r
-        return Path\r
-\r
-def InstallNewFile(WorkspaceDir, File):\r
-    FullPath = os.path.normpath(os.path.join(WorkspaceDir, File))\r
-    if os.path.exists(FullPath):\r
-        print "File [%s] already exists, please select another path, press [Enter] with no input to quit:" %File\r
-        Input = sys.stdin.readline()\r
-        Input = Input.replace('\r', '').replace('\n', '')\r
-        if Input == '':\r
-            EdkLogger.error("InstallPkg", UNKNOWN_ERROR, "User interrupt")\r
-        Input = Input.replace('\r', '').replace('\n', '')\r
-        return InstallNewFile(WorkspaceDir, Input)\r
-    else:\r
-        return File\r
-\r
-## Tool entrance method\r
-#\r
-# This method mainly dispatch specific methods per the command line options.\r
-# If no error found, return zero value so the caller of this tool can know\r
-# if it's executed successfully or not.\r
-#\r
-#   @retval 0     Tool was successful\r
-#   @retval 1     Tool failed\r
-#\r
-def Main():\r
-    EdkLogger.Initialize()\r
-    Options = None\r
-    DistFileName = 'dist.pkg'\r
-    ContentFileName = 'content.zip'\r
-    DistFile, ContentZipFile, UnpackDir = None, None, None\r
-    \r
-    Options = MyOptionParser()\r
-    try:\r
-        if Options.LogLevel < EdkLogger.DEBUG_9:\r
-            EdkLogger.SetLevel(Options.LogLevel + 1)\r
-        else:\r
-            EdkLogger.SetLevel(Options.LogLevel)\r
-\r
-        CheckEnvVariable()\r
-        WorkspaceDir = os.environ["WORKSPACE"]\r
-        if not Options.PackageFile:\r
-            EdkLogger.error("InstallPkg", OPTION_NOT_SUPPORTED, ExtraData="Must specify one distribution package")\r
-\r
-        # unzip dist.pkg file\r
-        EdkLogger.quiet("Unzipping and parsing distribution package XML file ... ")\r
-        DistFile = PackageFile(Options.PackageFile)\r
-        UnpackDir = os.path.normpath(os.path.join(WorkspaceDir, ".tmp"))\r
-        DistPkgFile = DistFile.UnpackFile(DistFileName, os.path.normpath(os.path.join(UnpackDir, DistFileName)))\r
-        if not DistPkgFile:\r
-            EdkLogger.error("InstallPkg", FILE_NOT_FOUND, "File [%s] is broken in distribution package" %DistFileName)\r
-        \r
-        # Generate distpkg\r
-        DistPkgObj = DistributionPackageXml()\r
-        DistPkg = DistPkgObj.FromXml(DistPkgFile)\r
-\r
-        # prepare check dependency\r
-        Db = IpiDatabase(os.path.normpath(os.path.join(WorkspaceDir, "Conf/DistributionPackageDatabase.db")))\r
-        Db.InitDatabase()\r
-        Dep = DependencyRules(Db)\r
-        \r
-        # Check distribution package exist\r
-        if Dep.CheckDpExists(DistPkg.Header.Guid, DistPkg.Header.Version):\r
-            EdkLogger.error("InstallPkg", UNKNOWN_ERROR, "This distribution package has been installed", ExtraData=DistPkg.Header.Name)\r
-        \r
-        # unzip contents.zip file\r
-        ContentFile = DistFile.UnpackFile(ContentFileName, os.path.normpath(os.path.join(UnpackDir, ContentFileName)))\r
-        ContentZipFile = PackageFile(ContentFile)\r
-        if not ContentFile:\r
-            EdkLogger.error("InstallPkg", FILE_NOT_FOUND, "File [%s] is broken in distribution package" %ContentFileName)\r
-        \r
-        # verify MD5 signature\r
-        Md5Sigature = md5.new(open(ContentFile).read())\r
-        if DistPkg.Header.Signature != Md5Sigature.hexdigest():\r
-            EdkLogger.error("InstallPkg", FILE_CHECKSUM_FAILURE, ExtraData=ContentFile)\r
-        \r
-        # Check package exist and install\r
-        for Guid,Version,Path in DistPkg.PackageSurfaceArea:\r
-            PackagePath = os.path.dirname(Path)\r
-            NewPackagePath = PackagePath\r
-            Package = DistPkg.PackageSurfaceArea[Guid,Version,Path]\r
-            EdkLogger.info("Installing package ... %s" % Package.PackageHeader.Name)\r
-            if Dep.CheckPackageExists(Guid, Version):\r
-                EdkLogger.quiet("Package [%s] has been installed" %Path)\r
-            NewPackagePath = InstallNewPackage(WorkspaceDir, PackagePath)\r
-            Package.FileList = []\r
-            for Item in Package.MiscFiles.Files:\r
-                FromFile = os.path.join(PackagePath, Item.Filename)\r
-                ToFile = os.path.normpath(os.path.join(WorkspaceDir, NewPackagePath, Item.Filename))\r
-                ContentZipFile.UnpackFile(FromFile, ToFile)\r
-                Package.FileList.append(ToFile)\r
-            \r
-            # Update package\r
-            Package.PackageHeader.CombinePath = Package.PackageHeader.CombinePath.replace(PackagePath, NewPackagePath, 1)\r
-            # Update modules of package\r
-            Module = None\r
-            for ModuleGuid, ModuleVersion, ModulePath in Package.Modules:\r
-                Module = Package.Modules[ModuleGuid, ModuleVersion, ModulePath]\r
-                NewModulePath = ModulePath.replace(PackagePath, NewPackagePath, 1)\r
-                del Package.Modules[ModuleGuid, ModuleVersion, ModulePath]\r
-                Package.Modules[ModuleGuid, ModuleVersion, NewModulePath] = Module\r
-            del DistPkg.PackageSurfaceArea[Guid,Version,Path]\r
-            DistPkg.PackageSurfaceArea[Guid,Version,Package.PackageHeader.CombinePath] = Package\r
-\r
-#            SaveFileOnChange(os.path.join(Options.InstallDir, ModulePath, Module.Header.Name, ".inf"), Inf.ModuleToInf(Module), False)\r
-#            EdkLogger.info("Installing package ... %s" % Package.Header.Name)\r
-#            shutil.copytree(os.path.join(ContentFileDir, Path), Options.InstallDir)\r
-#            SaveFileOnChange(os.path.join(Options.InstallDir, Path, Package.Header.Name, ".dec"), Dec.PackageToDec(Package), False)\r
-\r
-        # Check module exist and install\r
-        Module = None\r
-        for Guid,Version,Path in DistPkg.ModuleSurfaceArea:\r
-            ModulePath = os.path.dirname(Path)\r
-            NewModulePath = ModulePath\r
-            Module = DistPkg.ModuleSurfaceArea[Guid,Version,Path]\r
-            EdkLogger.info("Installing module ... %s" % Module.ModuleHeader.Name)\r
-            if Dep.CheckModuleExists(Guid, Version):\r
-                EdkLogger.quiet("Module [%s] has been installed" %Path)\r
-            NewModulePath = InstallNewPackage(WorkspaceDir, ModulePath)\r
-            Module.FileList = []\r
-            for Item in Module.MiscFiles.Files:\r
-                ModulePath = ModulePath[os.path.normpath(ModulePath).rfind(os.path.normpath('/'))+1:]\r
-                FromFile = os.path.join(ModulePath, Item.Filename)\r
-                ToFile = os.path.normpath(os.path.join(WorkspaceDir, NewModulePath, Item.Filename))\r
-                ContentZipFile.UnpackFile(FromFile, ToFile)\r
-                Module.FileList.append(ToFile)\r
-            \r
-#            EdkLogger.info("Installing module ... %s" % Module.Header.Name)\r
-#            shutil.copytree(os.path.join(ContentFileDir, Path), Options.InstallDir)\r
-#            SaveFileOnChange(os.path.join(Options.InstallDir, Path, Module.Header.Name, ".inf"), Inf.ModuleToInf(Module), False)\r
-            \r
-            # Update module\r
-            Module.ModuleHeader.CombinePath = Module.ModuleHeader.CombinePath.replace(os.path.dirname(Path), NewModulePath, 1)\r
-            del DistPkg.ModuleSurfaceArea[Guid,Version,Path]\r
-            DistPkg.ModuleSurfaceArea[Guid,Version,Module.ModuleHeader.CombinePath] = Module\r
-#            \r
-#        \r
-#        for Guid,Version,Path in DistPkg.PackageSurfaceArea:\r
-#            print Guid,Version,Path\r
-#            for item in DistPkg.PackageSurfaceArea[Guid,Version,Path].FileList:\r
-#                print item\r
-#        for Guid,Version,Path in DistPkg.ModuleSurfaceArea:\r
-#            print Guid,Version,Path\r
-#            for item in DistPkg.ModuleSurfaceArea[Guid,Version,Path].FileList:\r
-#                print item\r
-\r
-        if Options.Tools:\r
-            EdkLogger.info("Installing tools ... ")\r
-            for File in DistPkg.Tools.Files:\r
-                FromFile = File.Filename\r
-                ToFile = InstallNewFile(WorkspaceDir, FromFile)\r
-                ContentZipFile.UnpackFile(FromFile, ToFile)\r
-        if Options.MiscFiles:\r
-            EdkLogger.info("Installing misc files ... ")\r
-            for File in DistPkg.MiscellaneousFiles.Files:\r
-                FromFile = File.Filename\r
-                ToFile = InstallNewFile(WorkspaceDir, FromFile)\r
-                ContentZipFile.UnpackFile(FromFile, ToFile)\r
-\r
-        # update database\r
-        EdkLogger.quiet("Update Distribution Package Database ...")\r
-        Db.AddDPObject(DistPkg)\r
-\r
-    except FatalError, X:\r
-        if Options and Options.LogLevel < EdkLogger.DEBUG_9:\r
-            EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())\r
-        ReturnCode = X.args[0]\r
-    except KeyboardInterrupt:\r
-        ReturnCode = ABORT_ERROR\r
-        if Options and Options.LogLevel < EdkLogger.DEBUG_9:\r
-            EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())\r
-    except:\r
-        EdkLogger.error(\r
-                    "\nInstallPkg",\r
-                    CODE_ERROR,\r
-                    "Unknown fatal error when installing [%s]" % Options.PackageFile,\r
-                    ExtraData="\n(Please send email to edk2-buildtools-devel@lists.sourceforge.net for help, attaching following call stack trace!)\n",\r
-                    RaiseError=False\r
-                    )\r
-        EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())\r
-        ReturnCode = CODE_ERROR\r
-    finally:\r
-        EdkLogger.quiet("Removing temp files ... ")\r
-        if DistFile:\r
-            DistFile.Close()\r
-        if ContentZipFile:\r
-            ContentZipFile.Close()\r
-        if UnpackDir:\r
-            shutil.rmtree(UnpackDir)\r
-        \r
-        EdkLogger.quiet("DONE")\r
-        Progressor.Abort()\r
-\r
-if __name__ == '__main__':\r
-    sys.exit(Main())\r
diff --git a/BaseTools/Source/Python/PackagingTool/IpiDb.py b/BaseTools/Source/Python/PackagingTool/IpiDb.py
deleted file mode 100644 (file)
index 6da3e18..0000000
+++ /dev/null
@@ -1,629 +0,0 @@
-## @file\r
-# This file is for installed package information database operations\r
-#\r
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-##\r
-# Import Modules\r
-#\r
-import sqlite3\r
-import os\r
-import time\r
-import Common.EdkLogger as EdkLogger\r
-\r
-from CommonDataClass import DistributionPackageClass\r
-\r
-## IpiDb\r
-#\r
-# This class represents the installed package information databse\r
-# Add/Remove/Get installed distribution package information here.\r
-# \r
-# \r
-# @param object:      Inherited from object class\r
-# @param DbPath:      A string for the path of the database\r
-#\r
-# @var Conn:          Connection of the database\r
-# @var Cur:           Cursor of the connection\r
-#\r
-class IpiDatabase(object):\r
-    def __init__(self, DbPath):\r
-        Dir = os.path.dirname(DbPath)\r
-        if not os.path.isdir(Dir):\r
-            os.mkdir(Dir)\r
-        self.Conn = sqlite3.connect(DbPath, isolation_level = 'DEFERRED')\r
-        self.Conn.execute("PRAGMA page_size=4096")\r
-        self.Conn.execute("PRAGMA synchronous=OFF")\r
-        self.Cur = self.Conn.cursor()\r
-        self.DpTable = 'DpInfo'\r
-        self.PkgTable = 'PkgInfo'\r
-        self.ModInPkgTable = 'ModInPkgInfo'\r
-        self.StandaloneModTable = 'StandaloneModInfo'\r
-        self.ModDepexTable = 'ModDepexInfo'\r
-        self.DpFileListTable = 'DpFileListInfo'\r
-    \r
-    ## Initialize build database\r
-    #\r
-    #\r
-    def InitDatabase(self):\r
-        EdkLogger.verbose("\nInitialize IPI database started ...")\r
-        \r
-        #\r
-        # Create new table\r
-        #\r
-        SqlCommand = """create table IF NOT EXISTS %s (DpGuid TEXT NOT NULL,\r
-                                                       DpVersion TEXT NOT NULL,\r
-                                                       InstallTime REAL NOT NULL,\r
-                                                       PkgFileName TEXT,\r
-                                                       PRIMARY KEY (DpGuid, DpVersion)\r
-                                                      )""" % self.DpTable\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        SqlCommand = """create table IF NOT EXISTS %s (FilePath TEXT NOT NULL,\r
-                                                       DpGuid TEXT,\r
-                                                       DpVersion TEXT,\r
-                                                       PRIMARY KEY (FilePath)\r
-                                                      )""" % self.DpFileListTable\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        SqlCommand = """create table IF NOT EXISTS %s (PackageGuid TEXT NOT NULL,\r
-                                                       PackageVersion TEXT NOT NULL,\r
-                                                       InstallTime REAL NOT NULL,\r
-                                                       DpGuid TEXT,\r
-                                                       DpVersion TEXT,\r
-                                                       InstallPath TEXT NOT NULL,\r
-                                                       PRIMARY KEY (PackageGuid, PackageVersion, InstallPath)\r
-                                                      )""" % self.PkgTable\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        SqlCommand = """create table IF NOT EXISTS %s (ModuleGuid TEXT NOT NULL,\r
-                                                       ModuleVersion TEXT NOT NULL,\r
-                                                       InstallTime REAL NOT NULL,\r
-                                                       PackageGuid TEXT,\r
-                                                       PackageVersion TEXT,\r
-                                                       InstallPath TEXT NOT NULL,\r
-                                                       PRIMARY KEY (ModuleGuid, ModuleVersion, InstallPath)\r
-                                                      )""" % self.ModInPkgTable\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        SqlCommand = """create table IF NOT EXISTS %s (ModuleGuid TEXT NOT NULL,\r
-                                                       ModuleVersion TEXT NOT NULL,\r
-                                                       InstallTime REAL NOT NULL,\r
-                                                       DpGuid TEXT,\r
-                                                       DpVersion TEXT,\r
-                                                       InstallPath TEXT NOT NULL,\r
-                                                       PRIMARY KEY (ModuleGuid, ModuleVersion, InstallPath)\r
-                                                      )""" % self.StandaloneModTable\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        SqlCommand = """create table IF NOT EXISTS %s (ModuleGuid TEXT NOT NULL,\r
-                                                       ModuleVersion TEXT NOT NULL,\r
-                                                       InstallPath TEXT NOT NULL,\r
-                                                       DepexGuid TEXT,\r
-                                                       DepexVersion TEXT\r
-                                                      )""" % self.ModDepexTable\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        self.Conn.commit()\r
-        \r
-        EdkLogger.verbose("Initialize IPI database ... DONE!")\r
-\r
-    ## Add a distribution install information from DpObj\r
-    #\r
-    # @param DpObj:\r
-    #\r
-    def AddDPObject(self, DpObj):\r
-        \r
-        for PkgKey in DpObj.PackageSurfaceArea.keys():\r
-            PkgGuid = PkgKey[0]\r
-            PkgVersion = PkgKey[1]\r
-            PkgInstallPath = PkgKey[2]\r
-            self.AddPackage(PkgGuid, PkgVersion, DpObj.Header.Guid, DpObj.Header.Version, PkgInstallPath)\r
-            PkgObj = DpObj.PackageSurfaceArea[PkgKey]\r
-            for ModKey in PkgObj.Modules.keys():\r
-                ModGuid = ModKey[0]\r
-                ModVersion = ModKey[1]\r
-                ModInstallPath = ModKey[2]\r
-                self.AddModuleInPackage(ModGuid, ModVersion, PkgGuid, PkgVersion, ModInstallPath)\r
-                ModObj = PkgObj.Modules[ModKey]\r
-                for Dep in ModObj.PackageDependencies:\r
-                    DepexGuid = Dep.PackageGuid\r
-                    DepexVersion = Dep.PackageVersion\r
-                    self.AddModuleDepex(ModGuid, ModVersion, ModInstallPath, DepexGuid, DepexVersion)\r
-            for FilePath in PkgObj.FileList:\r
-                self.AddDpFilePathList(DpObj.Header.Guid, DpObj.Header.Version, FilePath)\r
-\r
-        for ModKey in DpObj.ModuleSurfaceArea.keys():\r
-            ModGuid = ModKey[0]\r
-            ModVersion = ModKey[1]\r
-            ModInstallPath = ModKey[2]\r
-            self.AddStandaloneModule(ModGuid, ModVersion, DpObj.Header.Guid, DpObj.Header.Version, ModInstallPath)\r
-            ModObj = DpObj.ModuleSurfaceArea[ModKey]\r
-            for Dep in ModObj.PackageDependencies:\r
-                DepexGuid = Dep.PackageGuid\r
-                DepexVersion = Dep.PackageVersion\r
-                self.AddModuleDepex(ModGuid, ModVersion, ModInstallPath, DepexGuid, DepexVersion)\r
-            for FilePath in ModObj.FileList:\r
-                self.AddDpFilePathList(DpObj.Header.Guid, DpObj.Header.Version, FilePath)\r
-                \r
-        self.AddDp(DpObj.Header.Guid, DpObj.Header.Version, DpObj.Header.FileName)    \r
-    ## Add a distribution install information\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    # @param PkgFileName:\r
-    #\r
-    def AddDp(self, Guid, Version, PkgFileName = None):\r
-        \r
-        if Version == None or len(Version.strip()) == 0:\r
-            Version = 'N/A'\r
-        \r
-        #\r
-        # Add newly installed DP information to DB.\r
-        #\r
-        if PkgFileName == None or len(PkgFileName.strip()) == 0:\r
-            PkgFileName = 'N/A'\r
-        (Guid, Version, PkgFileName) = (Guid, Version, PkgFileName)\r
-        CurrentTime = time.time()\r
-        SqlCommand = """insert into %s values('%s', '%s', %s, '%s')""" % (self.DpTable, Guid, Version, CurrentTime, PkgFileName)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-        \r
-    ## Add a file list from DP\r
-    #\r
-    # @param DpGuid:  \r
-    # @param DpVersion:\r
-    # @param Path\r
-    #\r
-    def AddDpFilePathList(self, DpGuid, DpVersion, Path):\r
-        \r
-        SqlCommand = """insert into %s values('%s', '%s', '%s')""" % (self.DpFileListTable, Path, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-            \r
-    ## Add a package install information\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    # @param DpGuid:  \r
-    # @param DpVersion:\r
-    # @param Path\r
-    #\r
-    def AddPackage(self, Guid, Version, DpGuid = None, DpVersion = None, Path = ''):\r
-        \r
-        if Version == None or len(Version.strip()) == 0:\r
-            Version = 'N/A'\r
-        \r
-        if DpGuid == None or len(DpGuid.strip()) == 0:\r
-            DpGuid = 'N/A'\r
-        \r
-        if DpVersion == None or len(DpVersion.strip()) == 0:\r
-            DpVersion = 'N/A'\r
-        \r
-        #\r
-        # Add newly installed package information to DB.\r
-        #\r
-        \r
-        CurrentTime = time.time()\r
-        SqlCommand = """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % (self.PkgTable, Guid, Version, CurrentTime, DpGuid, DpVersion, Path)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-        \r
-    ## Add a module that from a package install information\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    # @param PkgFileName:\r
-    #\r
-    def AddModuleInPackage(self, Guid, Version, PkgGuid = None, PkgVersion = None, Path = ''):\r
-        \r
-        if Version == None or len(Version.strip()) == 0:\r
-            Version = 'N/A'\r
-        \r
-        if PkgGuid == None or len(PkgGuid.strip()) == 0:\r
-            PkgGuid = 'N/A'\r
-        \r
-        if PkgVersion == None or len(PkgVersion.strip()) == 0:\r
-            PkgVersion = 'N/A'\r
-        \r
-        #\r
-        # Add module from package information to DB.\r
-        #\r
-        CurrentTime = time.time()\r
-        SqlCommand = """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % (self.ModInPkgTable, Guid, Version, CurrentTime, PkgGuid, PkgVersion, Path)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-    \r
-    ## Add a module that is standalone install information\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    # @param PkgFileName:\r
-    #\r
-    def AddStandaloneModule(self, Guid, Version, DpGuid = None, DpVersion = None, Path = ''):\r
-        \r
-        if Version == None or len(Version.strip()) == 0:\r
-            Version = 'N/A'\r
-        \r
-        if DpGuid == None or len(DpGuid.strip()) == 0:\r
-            DpGuid = 'N/A'\r
-        \r
-        if DpVersion == None or len(DpVersion.strip()) == 0:\r
-            DpVersion = 'N/A'\r
-        \r
-        #\r
-        # Add module standalone information to DB.\r
-        #\r
-        CurrentTime = time.time()\r
-        SqlCommand = """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % (self.StandaloneModTable, Guid, Version, CurrentTime, DpGuid, DpVersion, Path)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-    \r
-    ## Add a module depex\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    # @param DepexGuid:\r
-    # @param DepexVersion:\r
-    #\r
-    def AddModuleDepex(self, Guid, Version, Path, DepexGuid = None, DepexVersion = None):\r
-                \r
-        if DepexGuid == None or len(DepexGuid.strip()) == 0:\r
-            DepexGuid = 'N/A'\r
-        \r
-        if DepexVersion == None or len(DepexVersion.strip()) == 0:\r
-            DepexVersion = 'N/A'\r
-        \r
-        #\r
-        # Add module depex information to DB.\r
-        #\r
-        \r
-        SqlCommand = """insert into %s values('%s', '%s', '%s', '%s', '%s')""" % (self.ModDepexTable, Guid, Version, Path, DepexGuid, DepexVersion)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-        \r
-    ## Remove a distribution install information, if no version specified, remove all DPs with this Guid.\r
-    #\r
-    # @param DpObj:  \r
-    #\r
-    def RemoveDpObj(self, DpGuid, DpVersion):\r
-        \r
-        PkgList = self.GetPackageListFromDp(DpGuid, DpVersion)\r
-        \r
-        # delete from ModDepex the standalone module's dependency\r
-        SqlCommand = """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in \r
-                        (select ModuleGuid from StandaloneModInfo as B where B.DpGuid = '%s' and B.DpVersion = '%s')\r
-                         and ModDepexInfo.ModuleVersion in\r
-                        (select ModuleVersion from StandaloneModInfo as B where B.DpGuid = '%s' and B.DpVersion = '%s')\r
-                         and ModDepexInfo.InstallPath in\r
-                        (select InstallPath from StandaloneModInfo as B where B.DpGuid = '%s' and B.DpVersion = '%s') """ \\r
-                        %(DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion)\r
-\r
-#        SqlCommand = """delete from %s where %s.DpGuid ='%s' and %s.DpVersion = '%s' and \r
-#                        %s.ModuleGuid = %s.ModuleGuid and %s.ModuleVersion = %s.ModuleVersion and \r
-#                        %s.InstallPath = %s.InstallPath""" \\r
-#                        % (self.ModDepexTable, self.StandaloneModTable, DpGuid, self.StandaloneModTable, DpVersion, self.ModDepexTable, self.StandaloneModTable, self.ModDepexTable, self.StandaloneModTable, self.ModDepexTable, self.StandaloneModTable)\r
-#        print SqlCommand\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        # delete from ModDepex the from pkg module's dependency\r
-        for Pkg in PkgList:\r
-#            SqlCommand = """delete from %s where %s.PackageGuid ='%s' and %s.PackageVersion = '%s' and \r
-#                        %s.ModuleGuid = %s.ModuleGuid and %s.ModuleVersion = %s.ModuleVersion and \r
-#                        %s.InstallPath = %s.InstallPath""" \\r
-#                        % (self.ModDepexTable, self.ModInPkgTable, Pkg[0], self.ModInPkgTable, Pkg[1], self.ModDepexTable, self.ModInPkgTable, self.ModDepexTable, self.ModInPkgTable, self.ModDepexTable, self.ModInPkgTable)\r
-            SqlCommand = """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in \r
-                            (select ModuleGuid from ModInPkgInfo where ModInPkgInfo.PackageGuid ='%s' and ModInPkgInfo.PackageVersion = '%s')\r
-                            and ModDepexInfo.ModuleVersion in\r
-                            (select ModuleVersion from ModInPkgInfo where ModInPkgInfo.PackageGuid ='%s' and ModInPkgInfo.PackageVersion = '%s')\r
-                            and ModDepexInfo.InstallPath in\r
-                            (select InstallPath from ModInPkgInfo where ModInPkgInfo.PackageGuid ='%s' and ModInPkgInfo.PackageVersion = '%s')""" \\r
-                            % (Pkg[0], Pkg[1],Pkg[0], Pkg[1],Pkg[0], Pkg[1])\r
-            \r
-            self.Cur.execute(SqlCommand)\r
-        \r
-        # delete the standalone module\r
-        SqlCommand = """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % (self.StandaloneModTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        # delete the from pkg module\r
-        for Pkg in PkgList:\r
-            SqlCommand = """delete from %s where %s.PackageGuid ='%s' and %s.PackageVersion = '%s'""" \\r
-                        % (self.ModInPkgTable, self.ModInPkgTable, Pkg[0], self.ModInPkgTable, Pkg[1])\r
-            self.Cur.execute(SqlCommand)\r
-        \r
-        # delete packages\r
-        SqlCommand = """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % (self.PkgTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        # delete file list from DP\r
-        SqlCommand = """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % (self.DpFileListTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-            \r
-        # delete DP\r
-        SqlCommand = """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % (self.DpTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-        \r
-        self.Conn.commit()\r
-        \r
-    ## Get a list of distribution install information.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:  \r
-    #\r
-    def GetDp(self, Guid, Version):\r
-        \r
-        if Version == None or len(Version.strip()) == 0:\r
-            Version = 'N/A'\r
-            EdkLogger.verbose("\nGetting list of DP install information started ...")\r
-            (DpGuid, DpVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where DpGuid ='%s'""" % (self.DpTable, DpGuid)\r
-            self.Cur.execute(SqlCommand)\r
-        \r
-        else:\r
-            EdkLogger.verbose("\nGetting DP install information started ...")\r
-            (DpGuid, DpVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where DpGuid ='%s' and DpVersion = '%s'""" % (self.DpTable, DpGuid, DpVersion)\r
-            self.Cur.execute(SqlCommand)\r
-\r
-        DpList = []\r
-        for DpInfo in self.Cur:\r
-            DpGuid = DpInfo[0]\r
-            DpVersion = DpInfo[1]\r
-            InstallTime = DpInfo[2]\r
-            PkgFileName = DpInfo[3]\r
-            DpList.append((DpGuid, DpVersion, InstallTime, PkgFileName))\r
-        \r
-        EdkLogger.verbose("Getting DP install information ... DONE!")\r
-        return DpList\r
-    \r
-    ## Get a list of distribution install file path information.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:  \r
-    #\r
-    def GetDpFileList(self, Guid, Version):\r
-        \r
-        (DpGuid, DpVersion) = (Guid, Version)\r
-        SqlCommand = """select * from %s where DpGuid ='%s' and DpVersion = '%s'""" % (self.DpFileListTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-\r
-        PathList = []\r
-        for Result in self.Cur:\r
-            Path = Result[0]\r
-            PathList.append(Path)\r
-        \r
-        return PathList\r
-    \r
-    ## Get a list of package information.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:  \r
-    #\r
-    def GetPackage(self, Guid, Version, DpGuid = '', DpVersion = ''):\r
-        \r
-        if DpVersion == '' or DpGuid == '':\r
-\r
-            (PackageGuid, PackageVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where PackageGuid ='%s' and PackageVersion = '%s'""" % (self.PkgTable, PackageGuid, PackageVersion)\r
-            self.Cur.execute(SqlCommand)\r
-        \r
-        elif Version == None or len(Version.strip()) == 0:\r
-            \r
-            SqlCommand = """select * from %s where PackageGuid ='%s'""" % (self.PkgTable, Guid)\r
-            self.Cur.execute(SqlCommand)\r
-        else:\r
-            (PackageGuid, PackageVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where PackageGuid ='%s' and PackageVersion = '%s'\r
-                            and DpGuid = '%s' and DpVersion = '%s'""" % (self.PkgTable, PackageGuid, PackageVersion, DpGuid, DpVersion)\r
-            self.Cur.execute(SqlCommand)\r
-\r
-        PkgList = []\r
-        for PkgInfo in self.Cur:\r
-            PkgGuid = PkgInfo[0]\r
-            PkgVersion = PkgInfo[1]\r
-            InstallTime = PkgInfo[2]\r
-            InstallPath = PkgInfo[5]\r
-            PkgList.append((PkgGuid, PkgVersion, InstallTime, DpGuid, DpVersion, InstallPath))\r
-        \r
-        return PkgList\r
-    \r
-    ## Get a list of module in package information.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:  \r
-    #\r
-    def GetModInPackage(self, Guid, Version, PkgGuid = '', PkgVersion = ''):\r
-        \r
-        if PkgVersion == '' or PkgGuid == '':\r
-\r
-            (ModuleGuid, ModuleVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where ModuleGuid ='%s' and ModuleVersion = '%s'""" % (self.ModInPkgTable, ModuleGuid, ModuleVersion)\r
-            self.Cur.execute(SqlCommand)\r
-        \r
-        else:\r
-            (ModuleGuid, ModuleVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where ModuleGuid ='%s' and ModuleVersion = '%s' and PackageGuid ='%s' and PackageVersion = '%s'\r
-                            """ % (self.ModInPkgTable, ModuleGuid, ModuleVersion, PkgGuid, PkgVersion)\r
-            self.Cur.execute(SqlCommand)\r
-\r
-        ModList = []\r
-        for ModInfo in self.Cur:\r
-            ModGuid = ModInfo[0]\r
-            ModVersion = ModInfo[1]\r
-            InstallTime = ModInfo[2]\r
-            InstallPath = ModInfo[5]\r
-            ModList.append((ModGuid, ModVersion, InstallTime, PkgGuid, PkgVersion, InstallPath))\r
-        \r
-        return ModList\r
-    \r
-    ## Get a list of module standalone.\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:  \r
-    #\r
-    def GetStandaloneModule(self, Guid, Version, DpGuid = '', DpVersion = ''):\r
-        \r
-        if DpGuid == '':\r
-\r
-            (ModuleGuid, ModuleVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where ModuleGuid ='%s' and ModuleVersion = '%s'""" % (self.StandaloneModTable, ModuleGuid, ModuleVersion)\r
-            self.Cur.execute(SqlCommand)\r
-        \r
-        else:\r
-            (ModuleGuid, ModuleVersion) = (Guid, Version)\r
-            SqlCommand = """select * from %s where ModuleGuid ='%s' and ModuleVersion = '%s' and DpGuid ='%s' and DpVersion = '%s'\r
-                            """ % (self.StandaloneModTable, ModuleGuid, ModuleVersion, DpGuid, DpVersion)\r
-            self.Cur.execute(SqlCommand)\r
-\r
-        ModList = []\r
-        for ModInfo in self.Cur:\r
-            ModGuid = ModInfo[0]\r
-            ModVersion = ModInfo[1]\r
-            InstallTime = ModInfo[2]\r
-            InstallPath = ModInfo[5]\r
-            ModList.append((ModGuid, ModVersion, InstallTime, DpGuid, DpVersion, InstallPath))\r
-        \r
-        return ModList\r
-    \r
-    ## Get a list of module information that comes from DP.\r
-    #\r
-    # @param DpGuid:  \r
-    # @param DpVersion:  \r
-    #\r
-    def GetStandaloneModuleInstallPathListFromDp(self, DpGuid, DpVersion):\r
-\r
-        PathList = []\r
-        SqlCommand = """select t1.InstallPath from %s t1 where t1.DpGuid ='%s' and t1.DpVersion = '%s'\r
-                        """ % (self.StandaloneModTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-\r
-        for Result in self.Cur:\r
-            InstallPath = Result[0]\r
-            PathList.append(InstallPath)\r
-        \r
-        return PathList\r
-    \r
-    ## Get a list of package information.\r
-    #\r
-    # @param DpGuid:  \r
-    # @param DpVersion:  \r
-    #\r
-    def GetPackageListFromDp(self, DpGuid, DpVersion):\r
-        \r
-\r
-        SqlCommand = """select * from %s where DpGuid ='%s' and DpVersion = '%s'\r
-                        """ % (self.PkgTable, DpGuid, DpVersion)\r
-        self.Cur.execute(SqlCommand)\r
-\r
-        PkgList = []\r
-        for PkgInfo in self.Cur:\r
-            PkgGuid = PkgInfo[0]\r
-            PkgVersion = PkgInfo[1]\r
-            InstallPath = PkgInfo[5]\r
-            PkgList.append((PkgGuid, PkgVersion, InstallPath))\r
-        \r
-        return PkgList\r
-    \r
-    ## Get a list of modules that depends on package information from a DP.\r
-    #\r
-    # @param DpGuid:  \r
-    # @param DpVersion:  \r
-    #\r
-    def GetDpDependentModuleList(self, DpGuid, DpVersion):\r
-        \r
-        ModList = []\r
-        PkgList = self.GetPackageListFromDp(DpGuid, DpVersion)\r
-        if len(PkgList) > 0:\r
-            return ModList\r
-        \r
-        for Pkg in PkgList:\r
-            SqlCommand = """select t1.ModuleGuid, t1.ModuleVersion, t1.InstallPath \r
-                            from %s as t1, %s as t2, where t1.ModuleGuid = t2.ModuleGuid and \r
-                            t1.ModuleVersion = t2.ModuleVersion and t2.DepexGuid ='%s' and (t2.DepexVersion = '%s' or t2.DepexVersion = 'N/A') and\r
-                            t1.PackageGuid != '%s' and t1.PackageVersion != '%s'\r
-                        """ % (self.ModInPkgTable, self.ModDepexTable, Pkg[0], Pkg[1], Pkg[0], Pkg[1])\r
-            self.Cur.execute(SqlCommand)\r
-            for ModInfo in self.Cur:\r
-                ModGuid = ModInfo[0]\r
-                ModVersion = ModInfo[1]\r
-                InstallPath = ModInfo[2]\r
-                ModList.append((ModGuid, ModVersion, InstallPath))\r
-\r
-            SqlCommand = """select t1.ModuleGuid, t1.ModuleVersion, t1.InstallPath \r
-                            from %s as t1, %s as t2, where t1.ModuleGuid = t2.ModuleGuid and \r
-                            t1.ModuleVersion = t2.ModuleVersion and t2.DepexGuid ='%s' and (t2.DepexVersion = '%s' or t2.DepexVersion = 'N/A') and\r
-                            t1.DpGuid != '%s' and t1.DpVersion != '%s'\r
-                        """ % (self.StandaloneModTable, self.ModDepexTable, Pkg[0], Pkg[1], DpGuid, DpVersion)\r
-            self.Cur.execute(SqlCommand)\r
-            for ModInfo in self.Cur:\r
-                ModGuid = ModInfo[0]\r
-                ModVersion = ModInfo[1]\r
-                InstallPath = ModInfo[2]\r
-                ModList.append((ModGuid, ModVersion, InstallPath))\r
-        \r
-        \r
-        return ModList\r
-    \r
-    ## Get a module depex\r
-    #\r
-    # @param Guid:  \r
-    # @param Version:\r
-    # @param Path:\r
-    #\r
-    def GetModuleDepex(self, Guid, Version, Path):\r
-                \r
-        #\r
-        # Get module depex information to DB.\r
-        #\r
-        \r
-        SqlCommand = """select * from %s where ModuleGuid ='%s' and ModuleVersion = '%s' and InstallPath ='%s'\r
-                            """ % (self.ModDepexTable, Guid, Version, Path)\r
-        self.Cur.execute(SqlCommand)\r
-        self.Conn.commit()\r
-        \r
-        DepexList = []\r
-        for DepInfo in self.Cur:\r
-            DepexGuid = DepInfo[3]\r
-            DepexVersion = DepInfo[4]\r
-            DepexList.append((DepexGuid, DepexVersion))\r
-        \r
-        return DepexList\r
-    \r
-    ## Close entire database\r
-    #\r
-    # Close the connection and cursor\r
-    #\r
-    def CloseDb(self):\r
-        \r
-        self.Cur.close()\r
-        self.Conn.close()\r
-\r
-    ## Convert To Sql String\r
-    #\r
-    # 1. Replace "'" with "''" in each item of StringList\r
-    # \r
-    # @param StringList:  A list for strings to be converted\r
-    #\r
-    def __ConvertToSqlString(self, StringList):\r
-        return map(lambda s: s.replace("'", "''") , StringList)\r
-##\r
-#\r
-# This acts like the main() function for the script, unless it is 'import'ed into another\r
-# script.\r
-#\r
-if __name__ == '__main__':\r
-    EdkLogger.Initialize()\r
-    EdkLogger.SetLevel(EdkLogger.DEBUG_0)\r
-    DATABASE_PATH = "C://MyWork//Conf//.cache//XML.db"\r
-    Db = IpiDatabase(DATABASE_PATH)\r
-    Db.InitDatabase()\r
-\r
-    
\ No newline at end of file
diff --git a/BaseTools/Source/Python/PackagingTool/MkPkg.py b/BaseTools/Source/Python/PackagingTool/MkPkg.py
deleted file mode 100644 (file)
index f6d693d..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-## @file\r
-# Install distribution package.\r
-#\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-##\r
-# Import Modules\r
-#\r
-import os\r
-import os.path\r
-import sys\r
-import glob\r
-import shutil\r
-import traceback\r
-import platform\r
-from optparse import OptionParser\r
-import md5\r
-import time\r
-import uuid\r
-\r
-from PackageFile import *\r
-import Common.EdkLogger as EdkLogger\r
-from Common.BuildToolError import *\r
-from Common.Misc import *\r
-from Common.XmlParser import *\r
-from CommonDataClass.DistributionPackageClass import *\r
-from Common.DecClassObjectLight import Dec\r
-from Common.InfClassObjectLight import Inf\r
-\r
-from PackageFile import *\r
-\r
-# Version and Copyright\r
-VersionNumber = "0.1"\r
-__version__ = "%prog Version " + VersionNumber\r
-__copyright__ = "Copyright (c) 2008, Intel Corporation  All rights reserved."\r
-\r
-## Check environment variables\r
-#\r
-#  Check environment variables that must be set for build. Currently they are\r
-#\r
-#   WORKSPACE           The directory all packages/platforms start from\r
-#   EDK_TOOLS_PATH      The directory contains all tools needed by the build\r
-#   PATH                $(EDK_TOOLS_PATH)/Bin/<sys> must be set in PATH\r
-#\r
-#   If any of above environment variable is not set or has error, the build\r
-#   will be broken.\r
-#\r
-def CheckEnvVariable():\r
-    # check WORKSPACE\r
-    if "WORKSPACE" not in os.environ:\r
-        EdkLogger.error("MkPkg", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",\r
-                        ExtraData="WORKSPACE")\r
-\r
-    WorkspaceDir = os.path.normpath(os.environ["WORKSPACE"])\r
-    if not os.path.exists(WorkspaceDir):\r
-        EdkLogger.error("MkPkg", FILE_NOT_FOUND, "WORKSPACE doesn't exist", ExtraData="%s" % WorkspaceDir)\r
-    elif ' ' in WorkspaceDir:\r
-        EdkLogger.error("MkPkg", FORMAT_NOT_SUPPORTED, "No space is allowed in WORKSPACE path", \r
-                        ExtraData=WorkspaceDir)\r
-    os.environ["WORKSPACE"] = WorkspaceDir\r
-\r
-## Parse command line options\r
-#\r
-# Using standard Python module optparse to parse command line option of this tool.\r
-#\r
-#   @retval Opt   A optparse.Values object containing the parsed options\r
-#   @retval Args  Target of build command\r
-#\r
-def MyOptionParser():\r
-    UsageString = "%prog -m <module_file> -p <package_file> [-o distribution_file] " + \\r
-                   "[-x xml-file-header] [-t tools-directory] [-f misc-files] [-q | -v] [-h]"\r
-\r
-    Parser = OptionParser(description=__copyright__,version=__version__,prog="MkPkg",usage=UsageString)\r
-\r
-    Parser.add_option("-?", action="help", help="show this help message and exit")\r
-\r
-    Parser.add_option("-o", "--output-file", action="store", type="string", dest="DistributionFile",\r
-            help="Specify the distribution file to be created.")\r
-\r
-    Parser.add_option("-f", "--misc-files", action="append", type="string", dest="MiscFiles",\r
-            help="Specify any misc files.")\r
-\r
-    Parser.add_option("-x", "--xml-file-header", action="store", type=None, dest="TemplateFile",\r
-            help="Specify the xml file which includes header information for creating the distribution file.")\r
-\r
-    Parser.add_option("-t", "--tools-directory", action="store", type=None, dest="ToolsDir",\r
-            help="Specify the directory name of tools.")\r
-\r
-    Parser.add_option("-m", "--module", action="append", type="string", dest="ModuleFileList",\r
-            help="The inf file of module to be distributed standalone.")\r
-\r
-    Parser.add_option("-p", "--package", action="append", type="string", dest="PackageFileList",\r
-            help="The dec file of package to be distributed.")\r
-\r
-    Parser.add_option("-q", "--quiet", action="store_const", dest="LogLevel", const=EdkLogger.QUIET,\r
-            help="Disable all messages except FATAL ERRORS.")\r
-\r
-    Parser.add_option("-v", "--verbose", action="store_const", dest="LogLevel", const=EdkLogger.VERBOSE,\r
-            help="Turn on verbose output")\r
-\r
-    Parser.add_option("-d", "--debug", action="store", type="int", dest="LogLevel",\r
-            help="Enable debug messages at specified level.")\r
-\r
-    Parser.set_defaults(LogLevel=EdkLogger.INFO)\r
-\r
-    (Opt, Args)=Parser.parse_args()\r
-    # error check\r
-    if not Opt.ModuleFileList and not Opt.PackageFileList:\r
-        EdkLogger.error("MkPkg", OPTION_NOT_SUPPORTED, ExtraData="At least one package file or module file must be specified")\r
-    if Opt.TemplateFile:\r
-        if not os.path.exists(Opt.TemplateFile):\r
-            EdkLogger.error(\r
-                            "\nMkPkg",\r
-                            FILE_NOT_FOUND,\r
-                            "Template file [%s] not found" % Opt.TemplateFile\r
-                            )\r
-    return Opt\r
-\r
-## Tool entrance method\r
-#\r
-# This method mainly dispatch specific methods per the command line options.\r
-# If no error found, return zero value so the caller of this tool can know\r
-# if it's executed successfully or not.\r
-#\r
-#   @retval 0     Tool was successful\r
-#   @retval 1     Tool failed\r
-#\r
-def Main():\r
-    EdkLogger.Initialize()\r
-    Options = MyOptionParser()\r
-    try:\r
-        if Options.LogLevel < EdkLogger.DEBUG_9:\r
-            EdkLogger.SetLevel(Options.LogLevel + 1)\r
-        else:\r
-            EdkLogger.SetLevel(Options.LogLevel)\r
-\r
-        CheckEnvVariable()\r
-        WorkspaceDir = os.environ["WORKSPACE"]\r
-        \r
-        # Init DistributionFile\r
-        if not Options.DistributionFile:\r
-            Options.DistributionFile = "DistributionPackage.zip"\r
-        \r
-        # Check Tools Dir\r
-        if Options.ToolsDir:\r
-            if not os.path.isdir(os.path.normpath(os.path.join(WorkspaceDir, Options.ToolsDir))):\r
-                EdkLogger.error(\r
-                                "\nMkPkg",\r
-                                FILE_NOT_FOUND,\r
-                                "Tools directory [%s] not found" % Options.ToolsDir\r
-                                )\r
-        \r
-        # Check misc files\r
-        if Options.MiscFiles:\r
-            for Item in Options.MiscFiles:\r
-                FullPath = os.path.normpath(os.path.join(WorkspaceDir, Item))\r
-                if not os.path.isfile(FullPath):\r
-                    EdkLogger.error(\r
-                                    "\nMkPkg",\r
-                                    FILE_NOT_FOUND,\r
-                                    "Misc file [%s] not found" % Item\r
-                                    )\r
-        \r
-        #Check package file existing and valid\r
-        if Options.PackageFileList:\r
-            for Item in Options.PackageFileList:\r
-                (Name, Ext) = os.path.splitext(Item)\r
-                if Ext.upper() != '.DEC':\r
-                    EdkLogger.error(\r
-                    "\nMkPkg",\r
-                    OPTION_VALUE_INVALID,\r
-                    "[%s] is not a valid package name" % Item\r
-                    )\r
-                Path = os.path.normpath(os.path.join(WorkspaceDir, Item))\r
-                if not os.path.exists(Path):\r
-                    EdkLogger.error(\r
-                        "\nMkPkg",\r
-                        FILE_NOT_FOUND,\r
-                        "[%s] not found" % Item\r
-                        )\r
-        #Check module file existing and valid\r
-        if Options.ModuleFileList:\r
-            for Item in Options.ModuleFileList:\r
-                (Name, Ext) = os.path.splitext(Item)\r
-                if Ext.upper() != '.INF':\r
-                    EdkLogger.error(\r
-                    "\nMkPkg",\r
-                    OPTION_VALUE_INVALID,\r
-                    "[%s] is not a valid module name" % Item\r
-                    )\r
-                Path = os.path.normpath(os.path.join(WorkspaceDir, Item))\r
-                if not os.path.exists(Path):\r
-                    EdkLogger.error(\r
-                        "\nMkPkg",\r
-                        FILE_NOT_FOUND,\r
-                        "[%s] not found" % Item\r
-                        )\r
-\r
-        ContentFile = PackageFile("content.zip", "w")\r
-        DistPkg = DistributionPackageClass()\r
-        DistPkg.GetDistributionPackage(WorkspaceDir, Options.PackageFileList, Options.ModuleFileList)\r
-        DistPkgXml = DistributionPackageXml()\r
-        for Item in DistPkg.PackageSurfaceArea:\r
-            ContentFile.Pack(os.path.dirname(os.path.normpath(os.path.join(WorkspaceDir,Item[2]))))\r
-        for Item in DistPkg.ModuleSurfaceArea:\r
-            ContentFile.Pack(os.path.dirname(os.path.normpath(os.path.join(WorkspaceDir,Item[2]))))\r
-\r
-        # Add tools files and information\r
-        if Options.ToolsDir:\r
-            ToolsFiles = MiscFileClass()\r
-            ToolsRoot = os.path.normpath(os.path.join(WorkspaceDir, Options.ToolsDir))\r
-            ContentFile.Pack(ToolsRoot)\r
-            ToolsFileList = GetFiles(ToolsRoot, ['CVS', '.svn'])\r
-            for Item in ToolsFileList:\r
-                OriPath = Item[len(WorkspaceDir)+1:]\r
-                FileObj = FileClass()\r
-                FileObj.Filename = OriPath\r
-                (Name, Ext) = os.path.splitext(OriPath)\r
-                if Ext.upper() in ['EXE', 'COM', 'EFI']:\r
-                    FileObj.Executable = 'True'\r
-                ToolsFiles.Files.append(FileObj)\r
-            DistPkg.Tools = ToolsFiles\r
-        \r
-        # Add misc files and information\r
-        if Options.MiscFiles:\r
-            MiscFiles = MiscFileClass()\r
-            for Item in Options.MiscFiles:\r
-                ContentFile.PackFile(Item)\r
-                FileObj = FileClass()\r
-                FileObj.Filename = Item\r
-                (Name, Ext) = os.path.splitext(Item)\r
-                if Ext.upper() in ['EXE', 'COM', 'EFI']:\r
-                    FileObj.Executable = 'True'\r
-                MiscFiles.Files.append(FileObj)\r
-            DistPkg.MiscellaneousFiles = MiscFiles\r
-                \r
-        print "Compressing Distribution Package File ..."\r
-        ContentFile.Close()\r
-        \r
-        # Add temp distribution header\r
-        if Options.TemplateFile:\r
-            TempXML = DistributionPackageXml()\r
-            DistPkg.Header = TempXML.FromXml(Options.TemplateFile).Header\r
-        # Add init dp information\r
-        else:\r
-            DistPkg.Header.Name = 'Distribution Package'\r
-            DistPkg.Header.Guid = str(uuid.uuid4())\r
-            DistPkg.Header.Version = '1.0'\r
-        \r
-        # Add Md5Sigature\r
-        Md5Sigature = md5.new(open(str(ContentFile)).read())\r
-        DistPkg.Header.Signature = Md5Sigature.hexdigest()\r
-        # Add current Date\r
-        DistPkg.Header.Date = str(time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime()))\r
-\r
-        # Finish final dp file\r
-        DistPkgFile = PackageFile(Options.DistributionFile, "w")\r
-        DistPkgFile.PackFile(str(ContentFile))\r
-        DistPkgFile.PackData(DistPkgXml.ToXml(DistPkg), "dist.pkg")\r
-        DistPkgFile.Close()\r
-        print "DONE"\r
-\r
-    except FatalError, X:\r
-        if Options and Options.LogLevel < EdkLogger.DEBUG_9:\r
-            EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())\r
-        ReturnCode = X.args[0]\r
-    except KeyboardInterrupt:\r
-        ReturnCode = ABORT_ERROR\r
-        if Options and Options.LogLevel < EdkLogger.DEBUG_9:\r
-            EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())\r
-    except:\r
-        EdkLogger.error(\r
-                    "\nMkPkg",\r
-                    CODE_ERROR,\r
-                    "Unknown fatal error when creating [%s]" % Options.DistributionFile,\r
-                    ExtraData="\n(Please send email to edk2-buildtools-devel@lists.sourceforge.net for help, attaching following call stack trace!)\n",\r
-                    RaiseError=False\r
-                    )\r
-        EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())\r
-        ReturnCode = CODE_ERROR\r
-    finally:\r
-        Progressor.Abort()\r
-\r
-if __name__ == '__main__':\r
-    sys.exit(Main())\r
-\r
diff --git a/BaseTools/Source/Python/PackagingTool/PackageFile.py b/BaseTools/Source/Python/PackagingTool/PackageFile.py
deleted file mode 100644 (file)
index 6194231..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-## @file\r
-#\r
-# PackageFile class represents the zip file of a distribution package.\r
-#\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-##\r
-# Import Modules\r
-#\r
-import os\r
-import sys\r
-import zipfile\r
-import tempfile\r
-\r
-from Common import EdkLogger\r
-from Common.Misc import *\r
-from Common.BuildToolError import *\r
-\r
-class PackageFile:\r
-    def __init__(self, FileName, Mode="r"):\r
-        self._FileName = FileName\r
-        if Mode not in ["r", "w", "a"]:\r
-            Mode = "r"\r
-        try:\r
-            self._ZipFile = zipfile.ZipFile(FileName, Mode, zipfile.ZIP_DEFLATED)\r
-            self._Files = {}\r
-            for F in self._ZipFile.namelist():\r
-                self._Files[os.path.normpath(F)] = F\r
-        except BaseException, X:\r
-            EdkLogger.error("PackagingTool", FILE_OPEN_FAILURE, \r
-                            ExtraData="%s (%s)" % (FileName, str(X)))\r
-\r
-        BadFile = self._ZipFile.testzip()\r
-        if BadFile != None:\r
-            EdkLogger.error("PackagingTool", FILE_CHECKSUM_FAILURE, \r
-                            ExtraData="[%s] in %s" % (BadFile, FileName))\r
-\r
-    def __str__(self):\r
-        return self._FileName\r
-\r
-    def Unpack(self, To):\r
-        for F in self._ZipFile.namelist():\r
-            ToFile = os.path.normpath(os.path.join(To, F))\r
-            print F, "->", ToFile\r
-            self.Extract(F, ToFile)\r
-    \r
-    def UnpackFile(self, File, ToFile):\r
-        File = File.replace('\\', '/')\r
-        if File in self._ZipFile.namelist():\r
-            print File, "->", ToFile\r
-            self.Extract(File, ToFile)\r
-            \r
-            return ToFile\r
-        \r
-        return ''\r
-    \r
-    def Extract(self, Which, To):\r
-        Which = os.path.normpath(Which)\r
-        if Which not in self._Files:\r
-            EdkLogger.error("PackagingTool", FILE_NOT_FOUND,\r
-                            ExtraData="[%s] in %s" % (Which, self._FileName))\r
-        try:\r
-            FileContent = self._ZipFile.read(self._Files[Which])\r
-        except BaseException, X:\r
-            EdkLogger.error("PackagingTool", FILE_DECOMPRESS_FAILURE, \r
-                            ExtraData="[%s] in %s (%s)" % (Which, self._FileName, str(X)))\r
-        try:\r
-            CreateDirectory(os.path.dirname(To))\r
-            ToFile = open(To, "wb")\r
-        except BaseException, X:\r
-            EdkLogger.error("PackagingTool", FILE_OPEN_FAILURE, \r
-                            ExtraData="%s (%s)" % (To, str(X)))\r
-\r
-        try:\r
-            ToFile.write(FileContent)\r
-            ToFile.close()\r
-        except BaseException, X:\r
-            EdkLogger.error("PackagingTool", FILE_WRITE_FAILURE, \r
-                            ExtraData="%s (%s)" % (To, str(X)))\r
-\r
-    def Remove(self, Files):\r
-        TmpDir = os.path.join(tempfile.gettempdir(), ".packaging")\r
-        if os.path.exists(TmpDir):\r
-            RemoveDirectory(TmpDir, True)\r
-\r
-        os.mkdir(TmpDir)\r
-        self.Unpack(TmpDir)\r
-        for F in Files:\r
-            F = os.path.normpath(F)\r
-            if F not in self._Files:\r
-                EdkLogger.error("PackagingTool", FILE_NOT_FOUND, \r
-                                ExtraData="%s is not in %s!" % (F, self._FileName))\r
-            #os.remove(os.path.join(TmpDir, F))  # no need to really remove file\r
-            self._Files.pop(F)\r
-        self._ZipFile.close()\r
-\r
-        self._ZipFile = zipfile.ZipFile(self._FileName, "w", zipfile.ZIP_DEFLATED)\r
-        Cwd = os.getcwd()\r
-        os.chdir(TmpDir)\r
-        self.PackFiles(self._Files)\r
-        os.chdir(Cwd)\r
-        RemoveDirectory(TmpDir, True)\r
-\r
-    def Pack(self, Top):\r
-        if not os.path.isdir(Top):\r
-            EdkLogger.error("PackagingTool", FILE_UNKNOWN_ERROR, "%s is not a directory!" %Top)\r
-\r
-        FilesToPack = []\r
-        ParentDir = os.path.dirname(Top)\r
-        BaseDir = os.path.basename(Top)\r
-        Cwd = os.getcwd()\r
-        os.chdir(ParentDir)\r
-        for Root, Dirs, Files in os.walk(BaseDir):\r
-            if 'CVS' in Dirs:\r
-                Dirs.remove('CVS')\r
-            if '.svn' in Dirs:\r
-                Dirs.remove('.svn')\r
-            for F in Files:\r
-                FilesToPack.append(os.path.join(Root, F))\r
-        self.PackFiles(FilesToPack)\r
-        os.chdir(Cwd)\r
-\r
-    def PackFiles(self, Files):\r
-        for F in Files:\r
-            try:\r
-                print "packing ...", F\r
-                self._ZipFile.write(F)\r
-            except BaseException, X:\r
-                EdkLogger.error("PackagingTool", FILE_COMPRESS_FAILURE, \r
-                                ExtraData="%s (%s)" % (F, str(X)))\r
-\r
-    def PackFile(self, File, ArcName=None):\r
-        try:\r
-            print "packing ...", File\r
-            self._ZipFile.write(File, ArcName)\r
-        except BaseException, X:\r
-            EdkLogger.error("PackagingTool", FILE_COMPRESS_FAILURE,\r
-                            ExtraData="%s (%s)" % (File, str(X)))\r
-\r
-    def PackData(self, Data, ArcName):\r
-        try:\r
-            self._ZipFile.writestr(ArcName, Data)\r
-        except BaseException, X:\r
-            EdkLogger.error("PackagingTool", FILE_COMPRESS_FAILURE,\r
-                            ExtraData="%s (%s)" % (ArcName, str(X)))\r
-\r
-    def Close(self):\r
-        self._ZipFile.close()\r
-\r
-if __name__ == '__main__':\r
-    pass\r
-\r