]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Sync BaseTool trunk (version r2599) into EDKII BaseTools.
authorLiming Gao <liming.gao@intel.com>
Fri, 23 Aug 2013 02:18:16 +0000 (02:18 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Aug 2013 02:18:16 +0000 (02:18 +0000)
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Heshen Chen <chen.heshen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14591 6f19259b-4bc3-4df7-8a09-765794883524

136 files changed:
BaseTools/Bin/Win32/BPDG.exe
BaseTools/Bin/Win32/BootSectImage.exe
BaseTools/Bin/Win32/Common.PyUtility.pyd
BaseTools/Bin/Win32/EfiCompressor.pyd
BaseTools/Bin/Win32/EfiLdrImage.exe
BaseTools/Bin/Win32/EfiRom.exe
BaseTools/Bin/Win32/Eot.EfiCompressor.pyd
BaseTools/Bin/Win32/Eot.LzmaCompressor.pyd
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/PatchPcdValue.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
BaseTools/Bin/Win32/VfrCompile.exe
BaseTools/Bin/Win32/VolInfo.exe
BaseTools/Bin/Win32/_ctypes.pyd
BaseTools/Bin/Win32/_hashlib.pyd
BaseTools/Bin/Win32/_socket.pyd
BaseTools/Bin/Win32/_sqlite3.pyd
BaseTools/Bin/Win32/_ssl.pyd
BaseTools/Bin/Win32/build.exe
BaseTools/Bin/Win32/pyexpat.pyd
BaseTools/Bin/Win32/python25.dll [deleted file]
BaseTools/Bin/Win32/python27.dll [new file with mode: 0644]
BaseTools/Bin/Win32/select.pyd
BaseTools/Bin/Win32/sqlite3.dll
BaseTools/Conf/XMLSchema/DistributionPackage.xsd
BaseTools/Conf/build_rule.template
BaseTools/Conf/target.template
BaseTools/Conf/tools_def.template
BaseTools/Contributions.txt [new file with mode: 0644]
BaseTools/GNUmakefile
BaseTools/License.txt [new file with mode: 0644]
BaseTools/ReadMe.txt
BaseTools/Scripts/gcc4.4-ld-script
BaseTools/Source/C/BootSectImage/GNUmakefile
BaseTools/Source/C/Common/BasePeCoff.c
BaseTools/Source/C/Common/GNUmakefile
BaseTools/Source/C/Common/PeCoffLoaderEx.c
BaseTools/Source/C/EfiLdrImage/GNUmakefile
BaseTools/Source/C/EfiRom/GNUmakefile
BaseTools/Source/C/GNUmakefile
BaseTools/Source/C/GenBootSector/GenBootSector.c
BaseTools/Source/C/GenCrc32/GNUmakefile
BaseTools/Source/C/GenCrc32/GenCrc32.c
BaseTools/Source/C/GenFfs/GNUmakefile
BaseTools/Source/C/GenFv/GNUmakefile
BaseTools/Source/C/GenFv/GenFvInternalLib.c
BaseTools/Source/C/GenFw/Elf64Convert.c
BaseTools/Source/C/GenFw/GNUmakefile
BaseTools/Source/C/GenFw/elf_common.h
BaseTools/Source/C/GenPage/GNUmakefile
BaseTools/Source/C/GenPage/GenPage.c
BaseTools/Source/C/GenSec/GNUmakefile
BaseTools/Source/C/GenVtf/GNUmakefile
BaseTools/Source/C/GnuGenBootSector/GNUmakefile
BaseTools/Source/C/Include/AArch64/ProcessorBind.h [new file with mode: 0644]
BaseTools/Source/C/Include/Arm/ProcessorBind.h [new file with mode: 0644]
BaseTools/Source/C/Include/Common/BuildVersion.h
BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
BaseTools/Source/C/Include/Common/UefiMultiPhase.h
BaseTools/Source/C/Include/Ia32/ProcessorBind.h
BaseTools/Source/C/Include/IndustryStandard/PeImage.h
BaseTools/Source/C/Include/X64/ProcessorBind.h
BaseTools/Source/C/LzmaCompress/GNUmakefile
BaseTools/Source/C/Makefiles/header.makefile
BaseTools/Source/C/Split/GNUmakefile
BaseTools/Source/C/TianoCompress/GNUmakefile
BaseTools/Source/C/VfrCompile/EfiVfr.h
BaseTools/Source/C/VfrCompile/GNUmakefile
BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
BaseTools/Source/C/VfrCompile/VfrCompiler.h
BaseTools/Source/C/VfrCompile/VfrError.cpp
BaseTools/Source/C/VfrCompile/VfrError.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/C/VolInfo/GNUmakefile
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/AutoGen/GenC.py
BaseTools/Source/Python/AutoGen/UniClassObject.py
BaseTools/Source/Python/Common/BuildVersion.py
BaseTools/Source/Python/Common/DataType.py
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py
BaseTools/Source/Python/Common/Expression.py
BaseTools/Source/Python/Common/FdfParserLite.py
BaseTools/Source/Python/Common/MigrationUtilities.py
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/Common/PyUtility.pyd
BaseTools/Source/Python/Common/String.py
BaseTools/Source/Python/CommonDataClass/CommonClass.py
BaseTools/Source/Python/CommonDataClass/ModuleClass.py
BaseTools/Source/Python/CommonDataClass/PlatformClass.py
BaseTools/Source/Python/Ecc/Check.py
BaseTools/Source/Python/Eot/EfiCompressor.pyd
BaseTools/Source/Python/Eot/LzmaCompressor.pyd
BaseTools/Source/Python/GNUmakefile
BaseTools/Source/Python/GenFds/Fd.py
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/FfsFileStatement.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/GenFds.py
BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools/Source/Python/GenFds/VerSection.py
BaseTools/Source/Python/Makefile
BaseTools/Source/Python/TargetTool/TargetTool.py
BaseTools/Source/Python/UPT/BuildVersion.py
BaseTools/Source/Python/UPT/Library/DataType.py
BaseTools/Source/Python/UPT/Library/GlobalData.py
BaseTools/Source/Python/UPT/Library/String.py
BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py
BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py
BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py
BaseTools/Source/Python/Workspace/MetaFileParser.py
BaseTools/Source/Python/Workspace/WorkspaceCommon.py [new file with mode: 0644]
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools/Source/Python/build/BuildReport.py
BaseTools/Source/Python/build/build.py
BaseTools/Tests/GNUmakefile
BaseTools/building-gcc.txt
BaseTools/toolsetup.bat

index 9f387620844d0abde02c5edd5420d915f1f6b024..09137b60370a09924c893c2098ba959c9d29d950 100644 (file)
Binary files a/BaseTools/Bin/Win32/BPDG.exe and b/BaseTools/Bin/Win32/BPDG.exe differ
index 72bb94f3ccacb0bd5320fd1a59a5645674668742..a37e779ae73cc20303e782dc7b0c43924c087d35 100755 (executable)
Binary files a/BaseTools/Bin/Win32/BootSectImage.exe and b/BaseTools/Bin/Win32/BootSectImage.exe differ
index 5bb57d91e0bf0a81cd78423634b6e41a83fb43b0..856b508e4ea39a806fbe52264ac5e4db0956a2de 100644 (file)
Binary files a/BaseTools/Bin/Win32/Common.PyUtility.pyd and b/BaseTools/Bin/Win32/Common.PyUtility.pyd differ
index e0d0ae60be94b344f2b065d4716e7407707875c2..9de9beb4026a8a1fe8a7d89613ef80ef2670f77b 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiCompressor.pyd and b/BaseTools/Bin/Win32/EfiCompressor.pyd differ
index f4a0ef8f9f206ba6481563fb611f86f2acb49a85..29db3e2f416cb4f266c074542de94e680ef70973 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiLdrImage.exe and b/BaseTools/Bin/Win32/EfiLdrImage.exe differ
index 86ec6bb4cf55715c822ae6d4a5f0a299e1588b3b..6aefa0d41ade149d902fb2ceb875e081a240c67a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiRom.exe and b/BaseTools/Bin/Win32/EfiRom.exe differ
index 0729100b997577d4d531f947e693698ad916e19b..9de9beb4026a8a1fe8a7d89613ef80ef2670f77b 100644 (file)
Binary files a/BaseTools/Bin/Win32/Eot.EfiCompressor.pyd and b/BaseTools/Bin/Win32/Eot.EfiCompressor.pyd differ
index d792a7e9fb2073071b085076bfb15f99567e1aba..337c055e2062e16d469436efff3b9460be19e1ef 100644 (file)
Binary files a/BaseTools/Bin/Win32/Eot.LzmaCompressor.pyd and b/BaseTools/Bin/Win32/Eot.LzmaCompressor.pyd differ
index 2b8ebe60e2809e11d4b5305427dc48535d9f9de5..8bb35ac8357f17b7ec8459a8515828d98240ac41 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenBootSector.exe and b/BaseTools/Bin/Win32/GenBootSector.exe differ
index 14b0677c9ec70df9a7d074b91295d117b59f67d7..a6009cd72aa8828721689c21fc8ccf805e7d1c84 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenCrc32.exe and b/BaseTools/Bin/Win32/GenCrc32.exe differ
index d4d56965e8ff919d98a965d4740b09e0cb62c581..3d05e761366ddcdccbe6876777d5c4195b0641ea 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenDepex.exe and b/BaseTools/Bin/Win32/GenDepex.exe differ
index 88b88d63be1b5d25aa92549e3f4ce0a224532949..9bc45a846a2391ebcf0fd07e238679d147b9d9fd 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFds.exe and b/BaseTools/Bin/Win32/GenFds.exe differ
index 7d33a46a1b9fa0e7d8ab494665b54865e5261c11..632f7f3bb374120795ee56673d84125903e76ec1 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFfs.exe and b/BaseTools/Bin/Win32/GenFfs.exe differ
index 633cac7028fe6dfea0c8f50c2a11d21629fc69e0..b87331335e35332bfe3ae8cc65f97807af59346e 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFv.exe and b/BaseTools/Bin/Win32/GenFv.exe differ
index 2b1fd01f9c9a739031f08ac72319d8e14d09eac0..d47991f919b9be4ecfb99c81e931158bd9a88838 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFw.exe and b/BaseTools/Bin/Win32/GenFw.exe differ
index 3449ba54575de51e2e1f005f6776097637ce78e2..50806487c9e350cfba36cf5c618ddbbc2453af28 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPage.exe and b/BaseTools/Bin/Win32/GenPage.exe differ
index 512134c08ded221916aac982639c18803f4af769..a3ce036d43621c4f90577eac3af42d6782892d71 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPatchPcdTable.exe and b/BaseTools/Bin/Win32/GenPatchPcdTable.exe differ
index 40fbe7ab02e30ae69eaafc4e5b65bc49b3a2044b..a79833599d17e6580ed878527605f190e222ef6d 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenSec.exe and b/BaseTools/Bin/Win32/GenSec.exe differ
index 1448486c8975f9e73460d0f0dc59362650f93308..a248c31f7a69abfb9cc44da35d61eb9092091fd3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenVtf.exe and b/BaseTools/Bin/Win32/GenVtf.exe differ
index c5b07a40cace25d2a39d48d3e981d10809405876..456d67326838303c92d85e1169b3b005408bffa2 100755 (executable)
Binary files a/BaseTools/Bin/Win32/LzmaCompress.exe and b/BaseTools/Bin/Win32/LzmaCompress.exe differ
index d77b67a7792cb9b9ad5537a2a4c5c93fb78ccca8..48b24e22cb48627c6a282933954441d715f65dad 100755 (executable)
Binary files a/BaseTools/Bin/Win32/PatchPcdValue.exe and b/BaseTools/Bin/Win32/PatchPcdValue.exe differ
index e50d48dfdf955f70ad34b26882da6fac8565617d..00000ac73932017895eed3ef1307c17d2c1ac978 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Split.exe and b/BaseTools/Bin/Win32/Split.exe differ
index f5eeef9281543f51e85fd0d752d6b970e8a4db8b..bdaaf07260a167807691403c26d342b10ee0fde7 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TargetTool.exe and b/BaseTools/Bin/Win32/TargetTool.exe differ
index da6b82cfa2bee88a2b712f0135ab67e5be263243..a65ba046b571321ef050708837ab239dd496123a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TianoCompress.exe and b/BaseTools/Bin/Win32/TianoCompress.exe differ
index 418818b1b6dd866874a2acb317587069977e763f..44edbab30d579b4f57de779a4b43f3fa6c53e632 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Trim.exe and b/BaseTools/Bin/Win32/Trim.exe differ
index 03d6679fe3eb6e1e11c266d2fd4fa61c0a7617b6..a7060c7447223b16374d46a3e9a1d653ba527c88 100644 (file)
Binary files a/BaseTools/Bin/Win32/UPT.exe and b/BaseTools/Bin/Win32/UPT.exe differ
index 91681d800ee2a41472cab2058cddbf8a04d35e2b..20e1b43c93dfdcbb652b0648b46240ec5bdf82e7 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VfrCompile.exe and b/BaseTools/Bin/Win32/VfrCompile.exe differ
index 9655614239aae0ca8f3683be233b4624d159056c..593784de3a78ce43cbb11ef1b9bb89a625b9f9e3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VolInfo.exe and b/BaseTools/Bin/Win32/VolInfo.exe differ
index 06d1ed14c09aa963c9d3d46f860a637f3674ddeb..ae456be8063dc5776e31bda4300a9c04304a2511 100644 (file)
Binary files a/BaseTools/Bin/Win32/_ctypes.pyd and b/BaseTools/Bin/Win32/_ctypes.pyd differ
index 3690e54853dc75ffd3461be70f82dded1fef4cb4..5efea4ac7366e80f01d857462a066a1bbb74adfa 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_hashlib.pyd and b/BaseTools/Bin/Win32/_hashlib.pyd differ
index 707853bd33d02bb09d3017125be2d4f4c3757190..b4b3b1fe60899deb850110a1aacd46e956722ab0 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_socket.pyd and b/BaseTools/Bin/Win32/_socket.pyd differ
index 907de8ab4796d183664079ff46cd8f6298427de4..b86f5527a41d61fc30395e6253da82117e50bb1f 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_sqlite3.pyd and b/BaseTools/Bin/Win32/_sqlite3.pyd differ
index 428b51b008b1dcfdf1eca76b58d7847143e260df..c054f240d67ff88e4fb9f6745858b0365099829e 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_ssl.pyd and b/BaseTools/Bin/Win32/_ssl.pyd differ
index fc43d62866687cfbeb728f5f51da41a47a3a4bf0..2b74c9948f6fe9127c6490c6aa4995c56b7fdb5a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/build.exe and b/BaseTools/Bin/Win32/build.exe differ
index 9914173a532d6eefe38b5b93adef7718b924ef16..03c607001ccfa956e83f38fcab4edc5eab33899b 100755 (executable)
Binary files a/BaseTools/Bin/Win32/pyexpat.pyd and b/BaseTools/Bin/Win32/pyexpat.pyd differ
diff --git a/BaseTools/Bin/Win32/python25.dll b/BaseTools/Bin/Win32/python25.dll
deleted file mode 100755 (executable)
index a116a9b..0000000
Binary files a/BaseTools/Bin/Win32/python25.dll and /dev/null differ
diff --git a/BaseTools/Bin/Win32/python27.dll b/BaseTools/Bin/Win32/python27.dll
new file mode 100644 (file)
index 0000000..436f8d2
Binary files /dev/null and b/BaseTools/Bin/Win32/python27.dll differ
index cc70648a3cad9b88b781d82fdc47659e04b1eadb..e1b0ec2c49f1108286fcd941a922070976c0e9ab 100755 (executable)
Binary files a/BaseTools/Bin/Win32/select.pyd and b/BaseTools/Bin/Win32/select.pyd differ
index c99ef993cf23c0be2bc244d6e8e373993f4e0c48..189ca345cdb907d300abde8e47e218f3376428be 100755 (executable)
Binary files a/BaseTools/Bin/Win32/sqlite3.dll and b/BaseTools/Bin/Win32/sqlite3.dll differ
index 8f136ae04e3c8d72b0a8b0ec68197624b0804d41..5ae85f2bc31175a0cbde2e92878da906da26636b 100644 (file)
@@ -2,7 +2,7 @@
 <!--
 Filename: DistributionPackage.xsd
 
-Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2008 - 2012, 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 
@@ -13,108 +13,96 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
-    targetNamespace="http://www.uefi.org/2011/1.1" xmlns="http://www.uefi.org/2011/1.1">
+    targetNamespace="http://www.uefi.org/2012/1.0" xmlns="http://www.uefi.org/2012/1.0">
     <xs:element name="DistributionPackage">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI Distribution Package
-                description (PKG) file. It describes the content of:</xs:documentation>
-            <xs:documentation xml:lang="en-us"> 1) Package descriptions with definitions and
-                headers.</xs:documentation>
-            <xs:documentation xml:lang="en-us"> 2) Modules in either source or binary format. (Note
-                that Binary format is for FFS leaf section file types only, complete FFS files
-                cannot be distributed using this distribution format.) </xs:documentation>
-            <xs:documentation xml:lang="en-us"> 3) The distribution of custom tools used to modify
-                the binary images to create UEFI/PI compliant images. </xs:documentation>
-            <xs:documentation xml:lang="en-us"> 4) Finally, it can be used to distribute other
-                miscellaneous content that is not specific to UEFI/PI images. </xs:documentation>
-            <xs:documentation xml:lang="en-us"> The Package Surface Area describes the content of
-                packages, while the Module Surface Area provides information relevant to source
-                and/or binary distributions. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI Distribution Package description (PKG)
+                file. It describes the content of:</xs:documentation>
+            <xs:documentation xml:lang="en-us"> 1) Package descriptions with definitions and headers.</xs:documentation>
+            <xs:documentation xml:lang="en-us"> 2) Modules in either source or binary format. (Note that Binary format
+                is for FFS leaf section file types only, complete FFS files cannot be distributed using this
+                distribution format.) </xs:documentation>
+            <xs:documentation xml:lang="en-us"> 3) The distribution of custom tools used to modify the binary images to
+                create UEFI/PI compliant images. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> 4) Finally, it can be used to distribute other miscellaneous content
+                that is not specific to UEFI/PI images. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> The Package Surface Area describes the content of packages, while the
+                Module Surface Area provides information relevant to source and/or binary distributions.
+            </xs:documentation>
         </xs:annotation>
         <xs:complexType>
             <xs:sequence>
                 <xs:element ref="DistributionHeader" minOccurs="1" maxOccurs="1">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This header contains (legal) information
-                            usually required for distributing both binary and/or source code.
-                        </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This header contains (legal) information usually required
+                            for distributing both binary and/or source code. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
                 <xs:element ref="PackageSurfaceArea" minOccurs="0" maxOccurs="unbounded">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The list of packages in this
-                            distribution. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Packages are groups of files and/or
-                            modules that are similar in nature.</xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Packages are uniquely identified by a
-                            package GUID and a package version. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> A package can declare public mappings of
-                            C names to GUID values. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> A package can provide header files for
-                            library classes and/or other industry standard definitions. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> A package can also declare public
-                            mappings of platform configuration database (PCD) &quot;knobs&quot; to
-                            control features and operation of modules within a platform. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Finally, a package lists the library
-                            instances and/or modules that are provided in a distribution package.
-                        </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The list of packages in this distribution. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Packages are groups of files and/or modules that are similar
+                            in nature.</xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Packages are uniquely identified by a package GUID and a
+                            package version. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A package can declare public mappings of C names to GUID
+                            values. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A package can provide header files for library classes
+                            and/or other industry standard definitions. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A package can also declare public mappings of platform
+                            configuration database (PCD) &quot;knobs&quot; to control features and operation of modules
+                            within a platform. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Finally, a package lists the library instances and/or
+                            modules that are provided in a distribution package. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
                 <xs:element ref="ModuleSurfaceArea" minOccurs="0" maxOccurs="unbounded">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The listing of UEFI/PI compliant modules
-                            in this distribution that are NOT part of a Package. Every module that
-                            is provided as part of a package needs to be described in a
-                            PackageSurfaceArea.Modules section. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> The ModuleSurfaceArea section describes
-                            how each module in a distribution is coded, or, in the case of a binary
-                            module distribution, how it was built. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> UEFI/PI compliant libraries and modules
-                            are uniquely identified by the Module's GUID and version number. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> This section will typically be used for
-                            modules that don't require any additional files that would be included
-                            in a package. For example, the Enhanced FAT driver binary does not need
-                            to have a package description, as no additional files are provided.
-                        </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The listing of UEFI/PI compliant modules in this
+                            distribution that are NOT part of a Package. Every module that is provided as part of a
+                            package needs to be described in a PackageSurfaceArea.Modules section. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The ModuleSurfaceArea section describes how each module in a
+                            distribution is coded, or, in the case of a binary module distribution, how it was built. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> UEFI/PI compliant libraries and modules are uniquely
+                            identified by the Module's GUID and version number. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section will typically be used for modules that don't
+                            require any additional files that would be included in a package. For example, the Enhanced
+                            FAT driver binary does not need to have a package description, as no additional files are
+                            provided. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
                 <xs:element ref="Tools" minOccurs="0" maxOccurs="unbounded">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is for distributing vendor
-                            specific executable tools, tool source code and/or configuration files.
-                            These tools are primarily for manipulating code and/or binary images. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Tools in this section
-                            can:</xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 1) Parse build meta-data files to create
-                            source code files and build scripts. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 2) Modify image files to conform to
-                            UEFI/PI specifications. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 3) Generate binary files from certain
-                            types of text/unicode files. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 4) Generate PCI Option Roms or Firmware
-                            Device images. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 5) Implement external
-                            encoding/decoding/signature/GUIDed tools. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 6) Distribution Package
-                            create/install/remove tools. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is for distributing vendor specific executable
+                            tools, tool source code and/or configuration files. These tools are primarily for
+                            manipulating code and/or binary images. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Tools in this section can:</xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 1) Parse build meta-data files to create source code files
+                            and build scripts. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 2) Modify image files to conform to UEFI/PI specifications. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 3) Generate binary files from certain types of text/unicode
+                            files. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 4) Generate PCI Option Roms or Firmware Device images. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 5) Implement external encoding/decoding/signature/GUIDed
+                            tools. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 6) Distribution Package create/install/remove tools.
+                        </xs:documentation>
                     </xs:annotation>
                 </xs:element>
                 <xs:element ref="MiscellaneousFiles" minOccurs="0" maxOccurs="unbounded">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The list of miscellaneous files in this
-                            distribution. Any files that are not listed in either the Package,
-                            Module or Tools sections can be listed here. This section can be used to
-                            distribute specifications for packages and modules that are not
-                            &quot;industry standards&quot; such as a specification for a chipset or
-                            a video device. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The list of miscellaneous files in this distribution. Any
+                            files that are not listed in either the Package, Module or Tools sections can be listed
+                            here. This section can be used to distribute specifications for packages and modules that
+                            are not &quot;industry standards&quot; such as a specification for a chipset or a video
+                            device. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
                 <xs:element ref="UserExtensions" minOccurs="0" maxOccurs="unbounded">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The UserExtensions section is used to
-                            disseminate processing instructions that may be custom to the content
-                            provided by the distribution. This section contains information that is
-                            common to all aspects of this disribution. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The UserExtensions section is used to disseminate processing
+                            instructions that may be custom to the content provided by the distribution. This section
+                            contains information that is common to all aspects of this disribution. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
             </xs:sequence>
@@ -125,31 +113,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
     <xs:element name="DistributionHeader">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> This section defines the content of the UEIF/PI
-                compliant Distribution Package Header. This is the only required element of a
-                UEFI/PI compliant distribution package. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> This section defines the content of the UEIF/PI compliant Distribution
+                Package Header. This is the only required element of a UEFI/PI compliant distribution package.
+            </xs:documentation>
         </xs:annotation>
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="1" maxOccurs="1" name="Name">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This is the User Interface Name for this
-                            Distribution Package. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Each Distribution Package is uniquely
-                            identified by it's GUID and Version number. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This is the User Interface Name for this Distribution
+                            Package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Each Distribution Package is uniquely identified by it's
+                            GUID and Version number. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:simpleContent>
                             <xs:extension base="xs:normalizedString">
                                 <xs:attribute name="BaseName" type="xs:NMTOKEN" use="optional">
                                     <xs:annotation>
-                                        <xs:documentation xml:lang="en-us"> The reference name of
-                                            the Distribution Package file. This single word name can
-                                            be used by tools as a keyword or for directory and/or
-                                            file creation. </xs:documentation>
-                                        <xs:documentation xml:lang="en-us"> White space and special
-                                            characters (dash and underscore characters may be used)
-                                            are not permitted in this name. </xs:documentation>
+                                        <xs:documentation xml:lang="en-us"> The reference name of the Distribution
+                                            Package file. This single word name can be used by tools as a keyword or for
+                                            directory and/or file creation. </xs:documentation>
+                                        <xs:documentation xml:lang="en-us"> White space and special characters (dash and
+                                            underscore characters may be used) are not permitted in this name.
+                                        </xs:documentation>
                                     </xs:annotation>
                                 </xs:attribute>
                             </xs:extension>
@@ -158,22 +145,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 </xs:element>
                 <xs:element minOccurs="1" maxOccurs="1" name="GUID">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This 128-bit GUID and the Version
-                            attribute uniquely identify this Distribution Package. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Backward compatible releases of a
-                            distribution package need only change the version number, while
-                            non-backward compatible changes require the GUID to change (resetting
-                            the version number to 1.0 is optional.) </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This 128-bit GUID and the Version attribute uniquely
+                            identify this Distribution Package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Backward compatible releases of a distribution package need
+                            only change the version number, while non-backward compatible changes require the GUID to
+                            change (resetting the version number to 1.0 is optional.) </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:simpleContent>
                             <xs:extension base="RegistryFormatGuid">
                                 <xs:attribute name="Version" type="xs:decimal" use="required">
                                     <xs:annotation>
-                                        <xs:documentation xml:lang="en-us"> This value, along with
-                                            the GUID, is used to uniquely identify this object. The
-                                            higher the number, the more recent the content.
-                                        </xs:documentation>
+                                        <xs:documentation xml:lang="en-us"> This value, along with the GUID, is used to
+                                            uniquely identify this object. The higher the number, the more recent the
+                                            content. </xs:documentation>
                                     </xs:annotation>
                                 </xs:attribute>
                             </xs:extension>
@@ -182,97 +167,116 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 </xs:element>
                 <xs:element minOccurs="1" maxOccurs="1" name="Vendor" type="xs:normalizedString">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A string identifying who created this
-                            distribution package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A string identifying who created this distribution package.
+                        </xs:documentation>
                     </xs:annotation>
                 </xs:element>
                 <xs:element minOccurs="1" maxOccurs="1" name="Date" type="xs:dateTime">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The date and time this distribution was
-                            created. The format is: YYYY-MM-DDThh:mm:ss, for example:
-                            2001-01-31T13:30:00 (note the T character separator between the calendar
-                            date and the time. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The date and time this distribution was created. The format
+                            is: YYYY-MM-DDThh:mm:ss, for example: 2001-01-31T13:30:00 (note the T character separator
+                            between the calendar date and the time. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
-                <xs:element minOccurs="1" maxOccurs="1" name="Copyright" type="xs:string">
+                <xs:element minOccurs="1" maxOccurs="unbounded" name="Copyright">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The copyright for this file that is
-                            generated by the creator of the distribution. If a derivative work is
-                            generated from an existing distribution, then the existing copyright
-                            must be maintained, and additional copyrights may be appended to the end
-                            of this element. It may also be the primary copyright for all code
-                            provided in the Distribution Package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The copyright for this file that is generated by the creator
+                            of the distribution. If a derivative work is generated from an existing distribution, then
+                            the existing copyright must be maintained, and additional copyrights may be appended to the
+                            end of this element. It may also be the primary copyright for all code provided in the
+                            Distribution Package. </xs:documentation>
                     </xs:annotation>
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:string">
+                                <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
+                    
                 </xs:element>
-                <xs:element minOccurs="1" maxOccurs="1" name="License" type="xs:string">
+                <xs:element minOccurs="1" maxOccurs="unbounded" name="License">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A license that describes any
-                            restrictions on the use of this distribution. If a derivative work is
-                            allowed by the original license and a derivative work is generated from
-                            an existing distribution, then the existing license must be maintained,
-                            and additional licenses may be appended to the end of this element. It
-                            may also be the primary license for all code provided in the
-                            distribution file. Alternatively, this may point to a filename that
-                            contains the License. The file (included in the content zip file) will
-                            be stored in the same location as the distribution package's .pkg file.
+                        <xs:documentation xml:lang="en-us"> A license that describes any restrictions on the use of this
+                            distribution. If a derivative work is allowed by the original license and a derivative work
+                            is generated from an existing distribution, then the existing license must be maintained,
+                            and additional licenses may be appended to the end of this element. It may also be the
+                            primary license for all code provided in the distribution file. Alternatively, this may
+                            point to a filename that contains the License. The file (included in the content zip file)
+                            will be stored in the same location as the distribution package's .pkg file.
                         </xs:documentation>
                     </xs:annotation>
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:string">
+                                <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
                 </xs:element>
-                <xs:element minOccurs="1" maxOccurs="1" name="Abstract" type="xs:normalizedString">
+                <xs:element minOccurs="1" maxOccurs="unbounded" name="Abstract">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A one line description of the
-                            Distribution Package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A one line description of the Distribution Package.
+                        </xs:documentation>
                     </xs:annotation>
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:normalizedString">
+                                <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
                 </xs:element>
-                <xs:element minOccurs="0" maxOccurs="1" name="Description" type="xs:string">
+                <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A complete description of the
-                            Distribution Package. This description may include the release name of
-                            the file, the version of the file, and a complete description of the
-                            file contents and/or features including a description of the updates
-                            since the previous file release. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A complete description of the Distribution Package. This
+                            description may include the release name of the file, the version of the file, and a
+                            complete description of the file contents and/or features including a description of the
+                            updates since the previous file release. </xs:documentation>
                     </xs:annotation>
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:string">
+                                <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
                 </xs:element>
                 <xs:element minOccurs="0" maxOccurs="1" name="Signature" type="Md5Sum">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The packaging utilities will use this
-                            MD5 sum value of the included ZIP file containing files and/or code. If
-                            this element is not present, then installation tools should assume that
-                            the content is correct, or that other methods may be needed to verify
-                            content. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The packaging utilities will use this MD5 sum value of the
+                            included ZIP file containing files and/or code. If this element is not present, then
+                            installation tools should assume that the content is correct, or that other methods may be
+                            needed to verify content. </xs:documentation>
                     </xs:annotation>
                 </xs:element>
-                <xs:element minOccurs="1" maxOccurs="1" name="XmlSpecification" type="xs:decimal"
-                    default="1.1">
+                <xs:element minOccurs="1" maxOccurs="1" name="XmlSpecification" type="xs:decimal" default="1.1">
                     <xs:annotation>
                         <xs:documentation xml:lang="en-us"> This version of this XML Schema is 1.1 </xs:documentation>
                         <xs:documentation xml:lang="en-us"> Changes to 1.1 from 1.0 </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> #1 Updated to present date and new
-                            version which is important to reflect the present state of the
-                            matter</xs:documentation>
-                        <xs:documentation xml:lang="en-us"> #2 Added definition/enumeration of
-                            UNDEFIND type 2 is important since there is a large body of legacy code
-                            for which the GUID’s and other code/data objects were not decorated with
-                            their usage. This document will allow for importing today’s source
-                            artifacts and producing decorations using the â€˜Undefined’ versus having
-                            an error</xs:documentation>
-                        <xs:documentation xml:lang="en-us">#3 Allow for inclusion of ARM and future
-                            architecture types</xs:documentation>
+                        <xs:documentation xml:lang="en-us"> #1 Updated to present date and new version which is
+                            important to reflect the present state of the matter</xs:documentation>
+                        <xs:documentation xml:lang="en-us"> #2 Added definition/enumeration of UNDEFIND type 2 is
+                            important since there is a large body of legacy code for which the GUID’s and other
+                            code/data objects were not decorated with their usage. This document will allow for
+                            importing today’s source artifacts and producing decorations using the â€˜Undefined’ versus
+                            having an error</xs:documentation>
+                        <xs:documentation xml:lang="en-us">#3 Allow for inclusion of ARM and future architecture
+                            types</xs:documentation>
                     </xs:annotation>
                 </xs:element>
             </xs:sequence>
             <xs:attribute name="ReadOnly" type="xs:boolean" default="false" use="optional">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> If set to true, all content within this
-                        Distribution Package should NOT be modified. The default permits
-                        modification of all content. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> If set to true, all content within this Distribution Package
+                        should NOT be modified. The default permits modification of all content. </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
             <xs:attribute name="RePackage" type="xs:boolean" default="false" use="optional">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> If set to true, then the content can be
-                        repackaged into another distribution package. The default prohibits
-                        repackaging the Distribution content. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> If set to true, then the content can be repackaged into another
+                        distribution package. The default prohibits repackaging the Distribution content.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
         </xs:complexType>
@@ -281,12 +285,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
     <xs:element name="PackageSurfaceArea">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> A package is a collection of related objects -
-                Includes, Libraries and Modules. </xs:documentation>
-            <xs:documentation xml:lang="en-us"> Each package is uniquely identified by it's GUID and
-                Version number. Backward compatible releases of a package need only change the
-                version number, while non-backward compatible changes require the GUID to change
-                (resetting the version number to 1.0 is optional.) </xs:documentation>
+            <xs:documentation xml:lang="en-us"> A package is a collection of related objects - Includes, Libraries and
+                Modules. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> Each package is uniquely identified by it's GUID and Version number.
+                Backward compatible releases of a package need only change the version number, while non-backward
+                compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
+            </xs:documentation>
         </xs:annotation>
         <xs:complexType>
             <xs:sequence>
@@ -296,19 +300,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="1" name="Name">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is the User Interface
-                                        Name for this package. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is the User Interface Name for this
+                                        package. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:normalizedString">
-                                            <xs:attribute name="BaseName" type="xs:NMTOKEN"
-                                                use="required">
+                                            <xs:attribute name="BaseName" type="xs:NMTOKEN" use="required">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This is a
-                                                  single word BaseName of the package. This BaseName
-                                                  can be used by tools as a keyword and for
-                                                  directory/file creation. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This is a single word BaseName
+                                                        of the package. This BaseName can be used by tools as a keyword
+                                                        and for directory/file creation. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
@@ -317,72 +319,93 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             </xs:element>
                             <xs:element minOccurs="1" maxOccurs="1" name="GUID">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This GUID and the Version
-                                        attribute uniquely identify a given package.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
+                                        identify a given package. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="RegistryFormatGuid">
-                                            <xs:attribute name="Version" type="xs:decimal"
-                                                use="required">
+                                            <xs:attribute name="Version" type="xs:decimal" use="required">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. </xs:documentation>
-                                                  <xs:documentation xml:lang="en-us"> Backward
-                                                  compatible changes must make sure this number is
-                                                  incremented from the most recent version.
-                                                  Non-backward compatible changes require a new
-                                                  GUID, and the version can be reset.
-                                                  </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This value, along with the GUID,
+                                                        is used to uniquely identify this object. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> Backward compatible changes must
+                                                        make sure this number is incremented from the most recent
+                                                        version. Non-backward compatible changes require a new GUID, and
+                                                        the version can be reset. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Copyright">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> If the package requires a
-                                        different copyright than the distribution package, this
-                                        element can list one or more copyright lines.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> If the package requires a different copyright
+                                        than the distribution package, this element can list one or more copyright
+                                        lines. </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
+
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="License">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> If the package requires
-                                        licenses that are different from the distribution package
-                                        license, this element can contain one or more license text
-                                        paragraphs (or license filenames.) </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> If the package requires licenses that are
+                                        different from the distribution package license, this element can contain one or
+                                        more license text paragraphs (or license filenames.) </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
+
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Abstract"
-                                type="xs:normalizedString">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Abstract">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> A one line description of
-                                        this package. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> A one line description of this package.
+                                    </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:normalizedString">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Description"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> A complete description of a
-                                        package. This description may include the release name of
-                                        the package, the version of the package, and a complete
-                                        description of the package contents and/or features
-                                        including a description of the updates since the previous
-                                        package’s release. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> A complete description of a package. This
+                                        description may include the release name of the package, the version of the
+                                        package, and a complete description of the package contents and/or features
+                                        including a description of the updates since the previous package’s release.
+                                    </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="1" maxOccurs="1" name="PackagePath"
-                                type="xs:anyURI">
+                            <xs:element minOccurs="1" maxOccurs="1" name="PackagePath" type="xs:anyURI">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This element is the location
-                                        (in the ZIP file) for the root directory of a package.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This element is the location (in the ZIP file)
+                                        for the root directory of a package. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                         </xs:sequence>
@@ -392,29 +415,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="ClonedFrom">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> The term cloned is used here to indicate
-                            that this package as been copied and modified to a completely different
-                            package. An example might be for a new generation of chipsets that have
-                            few or no elements in common with the original. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The term cloned is used here to indicate that this package
+                            as been copied and modified to a completely different package. An example might be for a new
+                            generation of chipsets that have few or no elements in common with the original.
+                        </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="1" name="GUID">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This GUID and the Version
-                                        attribute uniquely identify the Package that this Package
-                                        was copied from. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
+                                        identify the Package that this Package was copied from. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="RegistryFormatGuid">
-                                            <xs:attribute name="Version" type="xs:decimal"
-                                                use="required">
+                                            <xs:attribute name="Version" type="xs:decimal" use="required">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  the package that this package was cloned from.
-                                                  </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This value, along with the GUID,
+                                                        is used to uniquely identify the package that this package was
+                                                        cloned from. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
@@ -428,11 +448,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="LibraryClassDeclarations">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> Library Classes are public interfaces
-                            that can be used by modules. One or more library instances can implement
-                            a library class, however only one library instance can be linked to an
-                            individual module. This provides the platform integrator with the
-                            flexibility of choosing one library instance's implementation over a
+                        <xs:documentation xml:lang="en-us"> Library Classes are public interfaces that can be used by
+                            modules. One or more library instances can implement a library class, however only one
+                            library instance can be linked to an individual module. This provides the platform
+                            integrator with the flexibility of choosing one library instance's implementation over a
                             different library instance. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
@@ -440,59 +459,51 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="LibraryClass">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile"
-                                            type="xs:anyURI">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> The header file
-                                                  provides definitions and function prototypes for a
-                                                  library class. Modules can be coded against these
-                                                  functions, using the definitions in this header,
-                                                  without concerning themselves about the libraries'
-                                                  implementation details. This is a PackagePath
-                                                  relative path and filename for the include file.
-                                                </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> The header file provides definitions
+                                                    and function prototypes for a library class. Modules can be coded
+                                                    against these functions, using the definitions in this header,
+                                                    without concerning themselves about the libraries' implementation
+                                                    details. This is a PackagePath relative path and filename for the
+                                                    include file. </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
-                                        <xs:element minOccurs="0" maxOccurs="1"
-                                            name="RecommendedInstance">
+                                        <xs:element minOccurs="0" maxOccurs="1" name="RecommendedInstance">
                                             <xs:complexType>
                                                 <xs:sequence>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="GUID">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This GUID and
-                                                  the Version attribute uniquely identify the
-                                                  Recommended Library Instance. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="RegistryFormatGuid">
-                                                  <xs:attribute name="Version" type="xs:decimal"
-                                                  use="optional">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. If this value is not specified, then
-                                                  any version of the library instance is
-                                                  recommended. </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:attribute>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
+                                                    <xs:element minOccurs="1" maxOccurs="1" name="GUID">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This GUID and the
+                                                            Version attribute uniquely identify the Recommended Library
+                                                            Instance. </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="RegistryFormatGuid">
+                                                            <xs:attribute name="Version" type="xs:decimal"
+                                                            use="optional">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This value, along with
+                                                            the GUID, is used to uniquely identify this object. If this
+                                                            value is not specified, then any version of the library
+                                                            instance is recommended. </xs:documentation>
+                                                            </xs:annotation>
+                                                            </xs:attribute>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                        </xs:complexType>
+                                                    </xs:element>
                                                 </xs:sequence>
                                             </xs:complexType>
                                         </xs:element>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Keyword" type="xs:NCName" use="required">
                                         <xs:annotation>
-                                            <xs:documentation xml:lang="en-us"> The single word name
-                                                of the Library Class that module developers will use
-                                                to identify a library class dependency.
-                                            </xs:documentation>
+                                            <xs:documentation xml:lang="en-us"> The single word name of the Library
+                                                Class that module developers will use to identify a library class
+                                                dependency. </xs:documentation>
                                         </xs:annotation>
                                     </xs:attribute>
                                     <xs:attributeGroup ref="SupportedArchMod"/>
@@ -505,28 +516,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="IndustryStandardIncludes">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is used to list header
-                            files for industry standards not under the auspices of UEFI.org. For
-                            example, headers that contain definitions and data structures for the
-                            USB specifications. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is used to list header files for industry
+                            standards not under the auspices of UEFI.org. For example, headers that contain definitions
+                            and data structures for the USB specifications. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="1" maxOccurs="unbounded"
-                                name="IndustryStandardHeader">
+                            <xs:element minOccurs="1" maxOccurs="unbounded" name="IndustryStandardHeader">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile"
-                                            type="xs:anyURI">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> The package
-                                                  relative path and filename (in the content zip
-                                                  file) of the industry standard include file.
-                                                </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> The package relative path and
+                                                    filename (in the content zip file) of the industry standard include
+                                                    file. </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                 </xs:complexType>
                             </xs:element>
@@ -537,13 +543,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="PackageIncludes">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> All top level header files that are
-                            included by a package that are not listed above. They cannot
-                            be:</xs:documentation>
+                        <xs:documentation xml:lang="en-us"> All top level header files that are included by a package
+                            that are not listed above. They cannot be:</xs:documentation>
                         <xs:documentation xml:lang="en-us"> 1) Local to a module (module specific.) </xs:documentation>
                         <xs:documentation xml:lang="en-us"> 2) An industry standard header. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> 3) A library class header.
-                        </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> 3) A library class header. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
@@ -552,20 +556,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     <xs:sequence>
                                         <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> This is the
-                                                  Package relative path and filename location within
-                                                  the content ZIP file. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> This is the Package relative path
+                                                    and filename location within the content ZIP file.
+                                                </xs:documentation>
                                             </xs:annotation>
                                             <xs:complexType>
                                                 <xs:simpleContent>
-                                                  <xs:extension base="xs:anyURI">
-                                                  <xs:attributeGroup ref="SupportedArchMod"/>
-                                                  </xs:extension>
+                                                    <xs:extension base="xs:anyURI">
+                                                        <xs:attributeGroup ref="SupportedArchMod"/>
+                                                    </xs:extension>
                                                 </xs:simpleContent>
                                             </xs:complexType>
                                         </xs:element>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                 </xs:complexType>
                             </xs:element>
@@ -579,9 +582,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                         <xs:sequence>
                             <xs:element ref="ModuleSurfaceArea" minOccurs="1" maxOccurs="unbounded">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This section lists the
-                                        Module Surface Area for all modules provided with this
-                                        package. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This section lists the Module Surface Area for
+                                        all modules provided with this package. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                         </xs:sequence>
@@ -591,31 +593,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="GuidDeclarations">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section defines the mapping of GUID
-                            C names to GUID values as a Registry Format GUID. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Modules that use these GUIDs must
-                            specify their dependency on this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section defines the mapping of GUID C names to GUID
+                            values as a Registry Format GUID. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Modules that use these GUIDs must specify their dependency
+                            on this package. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> Individual GUID Declarations
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> Individual GUID Declarations </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
                                         <xs:element minOccurs="1" maxOccurs="1" name="GuidValue"
                                             type="RegistryFormatGuid"/>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
-                                    <xs:attribute name="UiName" type="xs:normalizedString"
-                                        use="optional"/>
-                                    <xs:attribute name="GuidTypes" type="GuidListType"
-                                        use="optional"/>
+                                    <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/>
+                                    <xs:attribute name="GuidTypes" type="GuidListType" use="optional"/>
                                     <xs:attributeGroup ref="SupportedArchMod"/>
                                 </xs:complexType>
                             </xs:element>
@@ -626,29 +623,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="ProtocolDeclarations">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section defines the mapping of
-                            Protocol C names to GUID values as a Registry Format GUID. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Modules that use these Protocols must
-                            specify their dependency on this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section defines the mapping of Protocol C names to GUID
+                            values as a Registry Format GUID. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Modules that use these Protocols must specify their
+                            dependency on this package. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> Individual Protocol
-                                        Declarations </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> Individual Protocol Declarations
+                                    </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
                                         <xs:element minOccurs="1" maxOccurs="1" name="GuidValue"
                                             type="RegistryFormatGuid"/>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
-                                    <xs:attribute name="UiName" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/>
                                     <xs:attributeGroup ref="SupportedArchMod"/>
                                 </xs:complexType>
                             </xs:element>
@@ -659,29 +653,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="PpiDeclarations">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section defines the mapping of Ppi
-                            C names to GUID values as a Registry Format GUID. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Modules that use these Ppis must specify
-                            their dependency on this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section defines the mapping of Ppi C names to GUID
+                            values as a Registry Format GUID. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Modules that use these Ppis must specify their dependency on
+                            this package. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> Individual PPI Declarations
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> Individual PPI Declarations </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
                                         <xs:element minOccurs="1" maxOccurs="1" name="GuidValue"
                                             type="RegistryFormatGuid"/>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
-                                    <xs:attribute name="UiName" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/>
                                     <xs:attributeGroup ref="SupportedArchMod"/>
                                 </xs:complexType>
                             </xs:element>
@@ -692,63 +682,54 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="PcdDeclarations">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is used to declare platform
-                            configuration knobs that are defined by this package. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> Modules that use these PCD values must
-                            specify their dependency on this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is used to declare platform configuration knobs
+                            that are defined by this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> Modules that use these PCD values must specify their
+                            dependency on this package. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdEntry">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1"
-                                            name="TokenSpaceGuidCname" type="xs:NCName">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="TokenSpaceGuidCname"
+                                            type="xs:NCName">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> Specifies the C
-                                                  name of the Token Space GUID of which this PCD
-                                                  Entry is a member. This C name should also be
-                                                  listed in the GUIDs section, (specified above,)
-                                                  where the C name is assigned to a GUID value.
-                                                </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> Specifies the C name of the Token
+                                                    Space GUID of which this PCD Entry is a member. This C name should
+                                                    also be listed in the GUIDs section, (specified above,) where the C
+                                                    name is assigned to a GUID value. </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
                                         <xs:element minOccurs="1" maxOccurs="1" name="Token">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> Specifies the
-                                                  32-bit token value for this PCD Entry. The Token
-                                                  number must be unique to the Token Space that
-                                                  declares the PCD. </xs:documentation>
-                                                <xs:documentation xml:lang="en-us"> The minLength of
-                                                  3 is required to handle the "0x" prefix to the hex
-                                                  number. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> Specifies the 32-bit token value for
+                                                    this PCD Entry. The Token number must be unique to the Token Space
+                                                    that declares the PCD. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> The minLength of 3 is required to
+                                                    handle the "0x" prefix to the hex number. </xs:documentation>
                                             </xs:annotation>
                                             <xs:simpleType>
                                                 <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  <xs:maxLength value="10"/>
+                                                    <xs:minLength value="3"/>
+                                                    <xs:maxLength value="10"/>
                                                 </xs:restriction>
                                             </xs:simpleType>
                                         </xs:element>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
-                                            type="PcdDatumTypes">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="DatumType" type="PcdDatumTypes">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> A string that
-                                                  contains the data type of this PCD Entry. PCD data
-                                                  types are restricted to the following set:UINT8,
-                                                  UINT16, UINT32, UINT64, VOID*, BOOLEAN.
+                                                <xs:documentation xml:lang="en-us"> A string that contains the data type
+                                                    of this PCD Entry. PCD data types are restricted to the following
+                                                    set:UINT8, UINT16, UINT32, UINT64, VOID*, BOOLEAN.
                                                 </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="ValidUsage"
-                                            type="PcdItemListType">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="ValidUsage" type="PcdItemListType">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> A string that
-                                                  contains one or more PCD Item types separated by
-                                                  spaces. The PCD Item types are restricted to
-                                                  FeaturePcd, FixedPcd, PatchPcd, Pcd and/or PcdEx.
+                                                <xs:documentation xml:lang="en-us"> A string that contains one or more
+                                                    PCD Item types separated by spaces. The PCD Item types are
+                                                    restricted to FeaturePcd, FixedPcd, PatchPcd, Pcd and/or PcdEx.
                                                 </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
@@ -756,118 +737,118 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                             type="xs:normalizedString"/>
                                         <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> This is a
-                                                  recommended maximum data size for VOID* data
-                                                  types, the actual value should be defined by the
-                                                  Platform Integrator. It is not required for the
-                                                  other data types. </xs:documentation>
-                                                <xs:documentation xml:lang="en-us"> The minLength of
-                                                  3 is required to handle the "0x" prefix to the hex
-                                                  number. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> This is a recommended maximum data
+                                                    size for VOID* data types, the actual value should be defined by the
+                                                    Platform Integrator. It is not required for the other data types. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> The minLength of 3 is required to
+                                                    handle the "0x" prefix to the hex number. </xs:documentation>
 
                                             </xs:annotation>
                                             <xs:simpleType>
                                                 <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
+                                                    <xs:minLength value="3"/>
                                                 </xs:restriction>
                                             </xs:simpleType>
                                         </xs:element>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element minOccurs="0" maxOccurs="unbounded" name="Prompt">
+                                            <xs:annotation>
+                                                <xs:documentation xml:lang="en-US"> This entry contains prompt
+                                                    information, that may used by tools to assist platform integrators
+                                                    with choosing the correct values </xs:documentation>
+                                            </xs:annotation>
+                                            <xs:complexType>
+                                                <xs:simpleContent>
+                                                    <xs:extension base="xs:string">
+                                                        <xs:attribute name="Lang" type="xs:language" default="en-us"
+                                                            use="optional"/>
+                                                    </xs:extension>
+                                                </xs:simpleContent>
+                                            </xs:complexType>
+                                        </xs:element>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
 
-                                        <xs:element minOccurs="0" maxOccurs="unbounded"
-                                            name="PcdError">
+                                        <xs:element minOccurs="0" maxOccurs="unbounded" name="PcdError">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> Valid Error
-                                                  messages that may be implemented in a module for
-                                                  the PCD Entry. Only One Error Number per PcdError,
-                                                  (multiple ErrorMessage entries are permitted) and
-                                                  multiple PcdError elements are permitted.
-                                                </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> Valid Error messages that may be
+                                                    implemented in a module for the PCD Entry. Only One Error Number per
+                                                    PcdError, (multiple ErrorMessage entries are permitted) and multiple
+                                                    PcdError elements are permitted. </xs:documentation>
                                             </xs:annotation>
                                             <xs:complexType>
                                                 <xs:sequence>
-                                                  <xs:choice minOccurs="1" maxOccurs="1">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> One of the
-                                                  following types of comparisons, which must be able
-                                                  to evaluate to either true or false.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="ValidValueList">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The PCD Value
-                                                  must be space separated list of values. Values are
-                                                  restricted to the data type of this PCD.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="xs:normalizedString">
-                                                  <xs:attribute name="Lang" type="xs:language"
-                                                  use="optional"/>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="ValidValueRange" type="xs:normalizedString">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The PCD must
-                                                  be within a specifed range of numeric values.
-                                                  Restricted to C style Relational, Equality and
-                                                  Logicial Operators and parenthesis are valid. Only
-                                                  the CName for this PCD is permitted in the
-                                                  ValidValueRange expression. All other values must
-                                                  be numeric.</xs:documentation>
-                                                  <xs:documentation xml:lang="en-us"> LValue (op
-                                                  RValue)+ </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="Expression" type="xs:normalizedString">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> A in-fix
-                                                  logical expression using C style logical
-                                                  operators. </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:element>
-                                                  </xs:choice>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="ErrorNumber">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> A hexadecimal
-                                                  value for the error message as defined by
-                                                  specifications. </xs:documentation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="1" maxOccurs="unbounded"
-                                                  name="ErrorMessage">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This string
-                                                  should be defined by specifications. There are
-                                                  pre-defined error number ranges in the UEFI/PI
-                                                  specificaiton. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="xs:string">
-                                                  <xs:attribute name="Lang" type="xs:language"
-                                                  default="en-us" use="optional"/>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
+                                                    <xs:choice minOccurs="1" maxOccurs="1">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> One of the following
+                                                            types of comparisons, which must be able to evaluate to
+                                                            either true or false. </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:element minOccurs="0" maxOccurs="1" name="ValidValueList">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The PCD Value must be
+                                                            space separated list of values. Values are restricted to the
+                                                            data type of this PCD. </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="xs:normalizedString">
+                                                            <xs:attribute name="Lang" type="xs:language" use="optional"
+                                                            />
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                            </xs:complexType>
+                                                        </xs:element>
+                                                        <xs:element minOccurs="0" maxOccurs="1" name="ValidValueRange"
+                                                            type="xs:normalizedString">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The PCD must be within a
+                                                            specifed range of numeric values. Restricted to C style
+                                                            Relational, Equality and Logicial Operators and parenthesis
+                                                            are valid. Only the CName for this PCD is permitted in the
+                                                            ValidValueRange expression. All other values must be
+                                                            numeric.</xs:documentation>
+                                                            <xs:documentation xml:lang="en-us"> LValue (op RValue)+
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                        </xs:element>
+                                                        <xs:element minOccurs="0" maxOccurs="1" name="Expression"
+                                                            type="xs:normalizedString">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> A in-fix logical
+                                                            expression using C style logical operators.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                        </xs:element>
+                                                    </xs:choice>
+                                                    <xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> A hexadecimal value for
+                                                            the error message as defined by specifications. </xs:documentation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number. </xs:documentation>
+
+                                                        </xs:annotation>
+                                                        <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            </xs:restriction>
+                                                        </xs:simpleType>
+                                                    </xs:element>
+                                                    <xs:element minOccurs="1" maxOccurs="unbounded" name="ErrorMessage">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This string should be
+                                                            defined by specifications. There are pre-defined error
+                                                            number ranges in the UEFI/PI specificaiton.
+                                                            </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="xs:string">
+                                                            <xs:attribute name="Lang" type="xs:language" default="en-us"
+                                                            use="optional"/>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                        </xs:complexType>
+                                                    </xs:element>
                                                 </xs:sequence>
                                             </xs:complexType>
                                         </xs:element>
@@ -882,22 +863,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="PcdRelationshipChecks">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is used to describe any PCD
-                            interdependencies or relationships. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is used to describe any PCD interdependencies
+                            or relationships. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdCheck"
-                                type="xs:normalizedString">
+                            <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdCheck" type="xs:normalizedString">
                                 <xs:annotation>
                                     <xs:documentation xml:lang="en-us"> This entry must used
-                                        TokenSpaceGuidCName.PcdCname for every named PCD. Restricted
-                                        to Relational, Equality and Logical Operators (NOT, AND, OR,
-                                        GT, GE, EQ, LE, LT and XOR) and parenthesis are valid. Only
-                                        the TokenSpaceGuidCName.PcdCname us permitted to name PCDs
-                                        in the expression. All other values must be numeric. </xs:documentation>
-                                    <xs:documentation xml:lang="en-us"> LValue (op RValue)+
-                                    </xs:documentation>
+                                        TokenSpaceGuidCName.PcdCname for every named PCD. Restricted to Relational,
+                                        Equality and Logical Operators (NOT, AND, OR, GT, GE, EQ, LE, LT and XOR) and
+                                        parenthesis are valid. Only the TokenSpaceGuidCName.PcdCname us permitted to
+                                        name PCDs in the expression. All other values must be numeric. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> LValue (op RValue)+ </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                         </xs:sequence>
@@ -906,53 +884,49 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="MiscellaneousFiles">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section contains files that are not
-                            part of the code distributed with this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section contains files that are not part of the code
+                            distributed with this package. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> Only required if different
-                                        from the Package Copyright. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> Only required if different from the Package
+                                        Copyright. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> Only required if different
-                                        from the Package License. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> Only required if different from the Package
+                                        License. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> A one line description of
-                                        this section's content. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> A one line description of this section's
+                                        content. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Description"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Description" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> A complete description of
-                                        the files in this section. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> A complete description of the files in this
+                                        section. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is the PackagePath
-                                        relative path and filename location within the ZIP file.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is the PackagePath relative path and
+                                        filename location within the ZIP file. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:anyURI">
-                                            <xs:attribute name="Executable" type="xs:boolean"
-                                                default="false" use="optional">
+                                            <xs:attribute name="Executable" type="xs:boolean" default="false"
+                                                use="optional">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> If true, used
-                                                  by installation tools to ensure that a file that
-                                                  must be executable has the correct properties to
-                                                  permit execution. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> If true, used by installation
+                                                        tools to ensure that a file that must be executable has the
+                                                        correct properties to permit execution. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
@@ -967,9 +941,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="UserExtensions">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is used for any processing
-                            instructions that may be custom to the content provided by this package
-                            that are common to this package. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is used for any processing instructions that
+                            may be custom to the content provided by this package that are common to this package.
+                        </xs:documentation>
                     </xs:annotation>
                     <xs:complexType mixed="true">
                         <xs:sequence>
@@ -977,22 +951,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                         </xs:sequence>
                         <xs:attribute name="UserId" type="xs:NCName" use="required">
                             <xs:annotation>
-                                <xs:documentation xml:lang="en-us"> This is a single word identifier
-                                    for grouping similar content that does not fit into previously
-                                    defined sections or other sections of the Distribution.
-                                </xs:documentation>
+                                <xs:documentation xml:lang="en-us"> This is a single word identifier for grouping
+                                    similar content that does not fit into previously defined sections or other sections
+                                    of the Distribution. </xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
                         <xs:attribute name="Identifier" type="xs:string" use="required">
                             <xs:annotation>
-                                <xs:documentation xml:lang="en-us"> This can be used to
-                                    differentiate multiple sections with a grouping. </xs:documentation>
-                                <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS
-                                    Identifier might indicate specific steps and tools required
-                                    before processing module content, while a different
-                                    UserExtensions section with a POST_PROCESS Identifier might
-                                    describe steps that need to be executed after operations on the
-                                    modules in this package. </xs:documentation>
+                                <xs:documentation xml:lang="en-us"> This can be used to differentiate multiple sections
+                                    with a grouping. </xs:documentation>
+                                <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might indicate
+                                    specific steps and tools required before processing module content, while a
+                                    different UserExtensions section with a POST_PROCESS Identifier might describe steps
+                                    that need to be executed after operations on the modules in this package.
+                                </xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
                         <xs:anyAttribute processContents="lax"/>
@@ -1007,10 +979,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
     <xs:element name="ModuleSurfaceArea">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> Each module is uniquely identified by it's GUID and
-                Version number. Backward compatible releases of a module need only change the
-                version number, while non-backward compatible changes require the GUID to change
-                (resetting the version number to 1.0 is optional.) </xs:documentation>
+            <xs:documentation xml:lang="en-us"> Each module is uniquely identified by it's GUID and Version number.
+                Backward compatible releases of a module need only change the version number, while non-backward
+                compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
+            </xs:documentation>
         </xs:annotation>
         <xs:complexType>
             <xs:sequence>
@@ -1020,21 +992,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="1" name="Name">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is the User Interface
-                                        Name for this Module. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is the User Interface Name for this Module.
+                                    </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:normalizedString">
-                                            <xs:attribute name="BaseName" type="xs:NMTOKEN"
-                                                use="required">
+                                            <xs:attribute name="BaseName" type="xs:NMTOKEN" use="required">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This is a
-                                                  single word BaseName that will be used to create a
-                                                  module meta-data file. </xs:documentation>
-                                                  <xs:documentation xml:lang="en-us"> This name
-                                                  should also be used to create output file names
-                                                  and directories. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This is a single word BaseName
+                                                        that will be used to create a module meta-data file. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This name should also be used to
+                                                        create output file names and directories. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
@@ -1043,63 +1012,84 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             </xs:element>
                             <xs:element minOccurs="1" maxOccurs="1" name="GUID">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This GUID and the Version
-                                        attribute uniquely identify a given Module.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
+                                        identify a given Module. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="RegistryFormatGuid">
-                                            <xs:attribute name="Version" type="xs:decimal"
-                                                use="required">
+                                            <xs:attribute name="Version" type="xs:decimal" use="required">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. </xs:documentation>
-                                                  <xs:documentation xml:lang="en-us"> Backward
-                                                  compatible changes must make sure this number is
-                                                  incremented from the most recent version.
-                                                  Non-backward compatible changes require a new
-                                                  GUID, and the version can be reset.
-                                                  </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This value, along with the GUID,
+                                                        is used to uniquely identify this object. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> Backward compatible changes must
+                                                        make sure this number is incremented from the most recent
+                                                        version. Non-backward compatible changes require a new GUID, and
+                                                        the version can be reset. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Copyright">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        Copyright is different from either the Package or
-                                        Distribution copyright. Multiple copyright lines are
-                                        permitted within this section. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the Copyright is
+                                        different from either the Package or Distribution copyright. Multiple copyright
+                                        lines are permitted within this section. </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="License">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        license is different from either the Package or Distribution
-                                        license. Multiple licenses are permitted within this
-                                        section. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the license is
+                                        different from either the Package or Distribution license. Multiple licenses are
+                                        permitted within this section. </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Abstract"
-                                type="xs:normalizedString">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Abstract">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> A brief text description of
-                                        the module. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> A brief text description of the module.
+                                    </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:normalizedString">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Description"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> A complete description of
-                                        the module contents and/or features including a description
-                                        of the updates since the previous module release.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> A complete description of the module contents
+                                        and/or features including a description of the updates since the previous module
+                                        release. </xs:documentation>
                                 </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
                             </xs:element>
                         </xs:sequence>
                     </xs:complexType>
@@ -1108,35 +1098,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="ModuleProperties">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> List general information about a module,
-                            including the Supported Architectures, this module's type,
-                            specifications the module is coded against, and other informational
-                            content. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> List general information about a module, including the
+                            Supported Architectures, this module's type, specifications the module is coded against, and
+                            other informational content. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="1" maxOccurs="1" name="ModuleType"
-                                type="ModuleTypes">
+                            <xs:element minOccurs="1" maxOccurs="1" name="ModuleType" type="ModuleTypes">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> One of the Enumerated module
-                                        types that limit the use of a module. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> One of the Enumerated module types that limit
+                                        the use of a module. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="1" maxOccurs="1" name="Path" type="xs:anyURI">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> For stand-alone modules that
-                                        are NOT part of any package, this is the path to the root of
-                                        the module as listed in the ZIP file. For modules included
-                                        in a package, this is the location, relative to the root of
-                                        the package (PackagePath) this module belongs to.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> For stand-alone modules that are NOT part of any
+                                        package, this is the path to the root of the module as listed in the ZIP file.
+                                        For modules included in a package, this is the location, relative to the root of
+                                        the package (PackagePath) this module belongs to. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="0" maxOccurs="1" name="PcdIsDriver">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This element is only
-                                        required for the PEIM that produces the PCD PPI or the DXE
-                                        Driver that produces the PCD Protocol. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This element is only required for the PEIM that
+                                        produces the PCD PPI or the DXE Driver that produces the PCD Protocol.
+                                    </xs:documentation>
                                 </xs:annotation>
                                 <xs:simpleType>
                                     <xs:restriction base="xs:NCName">
@@ -1146,25 +1132,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                 </xs:simpleType>
                             </xs:element>
 
-                            <xs:element minOccurs="0" maxOccurs="1" name="UefiSpecificationVersion"
-                                type="xs:decimal"/>
+                            <xs:element minOccurs="0" maxOccurs="1" name="UefiSpecificationVersion" type="xs:decimal"/>
 
-                            <xs:element minOccurs="0" maxOccurs="1" name="PiSpecificationVersion"
-                                type="xs:decimal"/>
+                            <xs:element minOccurs="0" maxOccurs="1" name="PiSpecificationVersion" type="xs:decimal"/>
 
                             <xs:element minOccurs="0" maxOccurs="unbounded" name="Specification">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is a list of other
-                                        specifications that this module is written against. These
-                                        entries can be used in #define statements (depending on the
-                                        build system implementation, they may be autogenerated.)
+                                    <xs:documentation xml:lang="en-us"> This is a list of other specifications that this
+                                        module is written against. These entries can be used in #define statements
+                                        (depending on the build system implementation, they may be autogenerated.)
                                     </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:NCName">
-                                            <xs:attribute name="Version" type="xs:decimal"
-                                                use="required"/>
+                                            <xs:attribute name="Version" type="xs:decimal" use="required"/>
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
@@ -1172,156 +1154,139 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                             <xs:element minOccurs="0" maxOccurs="unbounded" name="BootMode">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> Different firmware execution
-                                        paths may be taken based on a given state of the hardware,
-                                        firmware, or through feature settings. A BootMode may be
-                                        declared (PRODUCES) or discovered (CONSUMES) based on these
-                                        states and feature settings. If the usage is UNDEFINE, it
-                                        implies that a Boot Mode is used, but the package creator
-                                        does not know how it is used. The supported boot modes map
-                                        to the PI specification Boot Modes. The boot modes listed
-                                        with Recovery are to indicate that the BootMode is valid
-                                        during a recovery boot. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> Different firmware execution paths may be taken
+                                        based on a given state of the hardware, firmware, or through feature settings. A
+                                        BootMode may be declared (PRODUCES) or discovered (CONSUMES) based on these
+                                        states and feature settings. If the usage is UNDEFINE, it implies that a Boot
+                                        Mode is used, but the package creator does not know how it is used. The
+                                        supported boot modes map to the PI specification Boot Modes. The boot modes
+                                        listed with Recovery are to indicate that the BootMode is valid during a
+                                        recovery boot. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:sequence minOccurs="0">
-                                        <xs:element minOccurs="1" maxOccurs="1"
-                                            name="SupportedBootModes">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="SupportedBootModes">
                                             <xs:simpleType>
                                                 <xs:list>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="xs:NCName">
-                                                  <xs:enumeration value="FULL"/>
-                                                  <xs:enumeration value="MINIMAL"/>
-                                                  <xs:enumeration value="NO_CHANGE"/>
-                                                  <xs:enumeration value="DIAGNOSTICS"/>
-                                                  <xs:enumeration value="DEFAULT"/>
-                                                  <xs:enumeration value="S2_RESUME"/>
-                                                  <xs:enumeration value="S3_RESUME"/>
-                                                  <xs:enumeration value="S4_RESUME"/>
-                                                  <xs:enumeration value="S5_RESUME"/>
-                                                  <xs:enumeration value="FLASH_UPDATE"/>
-                                                  <xs:enumeration value="RECOVERY_FULL"/>
-                                                  <xs:enumeration value="RECOVERY_MINIMAL"/>
-                                                  <xs:enumeration value="RECOVERY_NO_CHANGE"/>
-                                                  <xs:enumeration value="RECOVERY_DIAGNOSTICS"/>
-                                                  <xs:enumeration value="RECOVERY_DEFAULT"/>
-                                                  <xs:enumeration value="RECOVERY_S2_RESUME"/>
-                                                  <xs:enumeration value="RECOVERY_S3_RESUME"/>
-                                                  <xs:enumeration value="RECOVERY_S4_RESUME"/>
-                                                  <xs:enumeration value="RECOVERY_S5_RESUME"/>
-                                                  <xs:enumeration value="RECOVERY_FLASH_UPDATE"/>
-                                                  <xs:enumeration value="UNDEFINED"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
+                                                    <xs:simpleType>
+                                                        <xs:restriction base="xs:NCName">
+                                                            <xs:enumeration value="FULL"/>
+                                                            <xs:enumeration value="MINIMAL"/>
+                                                            <xs:enumeration value="NO_CHANGE"/>
+                                                            <xs:enumeration value="DIAGNOSTICS"/>
+                                                            <xs:enumeration value="DEFAULT"/>
+                                                            <xs:enumeration value="S2_RESUME"/>
+                                                            <xs:enumeration value="S3_RESUME"/>
+                                                            <xs:enumeration value="S4_RESUME"/>
+                                                            <xs:enumeration value="S5_RESUME"/>
+                                                            <xs:enumeration value="FLASH_UPDATE"/>
+                                                            <xs:enumeration value="RECOVERY_FULL"/>
+                                                            <xs:enumeration value="RECOVERY_MINIMAL"/>
+                                                            <xs:enumeration value="RECOVERY_NO_CHANGE"/>
+                                                            <xs:enumeration value="RECOVERY_DIAGNOSTICS"/>
+                                                            <xs:enumeration value="RECOVERY_DEFAULT"/>
+                                                            <xs:enumeration value="RECOVERY_S2_RESUME"/>
+                                                            <xs:enumeration value="RECOVERY_S3_RESUME"/>
+                                                            <xs:enumeration value="RECOVERY_S4_RESUME"/>
+                                                            <xs:enumeration value="RECOVERY_S5_RESUME"/>
+                                                            <xs:enumeration value="RECOVERY_FLASH_UPDATE"/>
+                                                            <xs:enumeration value="UNDEFINED"/>
+                                                        </xs:restriction>
+                                                    </xs:simpleType>
                                                 </xs:list>
                                             </xs:simpleType>
                                         </xs:element>
 
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Usage" use="required">
                                         <xs:simpleType>
                                             <xs:restriction base="xs:NCName">
                                                 <xs:enumeration value="CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  always supports the given boot modes.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module always supports
+                                                            the given boot modes. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module may
-                                                  support a given mode on some execution paths.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module may support a
+                                                            given mode on some execution paths. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  will change the boot mode. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module will change the
+                                                            boot mode. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIME_PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  will change the boot mode on some exection paths.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module will change the
+                                                            boot mode on some exection paths. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="UNDEFINED">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The package
-                                                  creator does not know how the boot mode is used.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The package creator does not
+                                                            know how the boot mode is used. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                             </xs:restriction>
                                         </xs:simpleType>
                                     </xs:attribute>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
 
-                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Event"
-                                nillable="true">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="Event" nillable="true">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> The functions that make up
-                                        the Event, Timer, and Task Priority Services are used during
-                                        preboot to create, close, signal, and wait for events; to
-                                        set timers; and to raise and restore task priority levels as
-                                        defined in the UEFI specification. GUIDed events should be
-                                        listed in the Guids section. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> The functions that make up the Event, Timer, and
+                                        Task Priority Services are used during preboot to create, close, signal, and
+                                        wait for events; to set timers; and to raise and restore task priority levels as
+                                        defined in the UEFI specification. GUIDed events should be listed in the Guids
+                                        section. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Usage" use="required">
                                         <xs:simpleType>
                                             <xs:restriction base="xs:NCName">
                                                 <xs:enumeration value="CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  will register a notification function and calls
-                                                  the function when it is signaled.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module will register a
+                                                            notification function and calls the function when it is
+                                                            signaled. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  will register a notification function and calls
-                                                  the function when it is signaled on some execution
-                                                  paths. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module will register a
+                                                            notification function and calls the function when it is
+                                                            signaled on some execution paths. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  will signal all events in an event group.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module will signal all
+                                                            events in an event group. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  will signal all events in an event group under
-                                                  some execution paths. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module will signal all
+                                                            events in an event group under some execution paths.
+                                                        </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="UNDEFINED">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The package
-                                                  creator does not know how an event is used.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The package creator does not
+                                                            know how an event is used. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                             </xs:restriction>
                                         </xs:simpleType>
@@ -1337,24 +1302,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 
                                     </xs:attribute>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
 
-                            <xs:element minOccurs="0" maxOccurs="unbounded" name="HOB"
-                                nillable="false">
+                            <xs:element minOccurs="0" maxOccurs="unbounded" name="HOB" nillable="false">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is a list of non-GUIDed
-                                        Hand Off Blocks (HOBs) produced or consumed by this module.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is a list of non-GUIDed Hand Off Blocks
+                                        (HOBs) produced or consumed by this module. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="HobType" use="required">
                                         <xs:simpleType>
@@ -1372,44 +1332,41 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                         <xs:simpleType>
                                             <xs:restriction base="xs:NCName">
                                                 <xs:enumeration value="CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> A HOB must be
-                                                  present in the system. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> A HOB must be present in the
+                                                            system. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> If present,
-                                                  the HOB will be used. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> If present, the HOB will be
+                                                            used. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The HOB is
-                                                  always produced by the module. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The HOB is always produced
+                                                            by the module. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The HOB may be
-                                                  produced by the module under some execution paths.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The HOB may be produced by
+                                                            the module under some execution paths. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="UNDEFINED">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The package
-                                                  creator knows that a HOB is used, but does not
-                                                  know how it is used. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The package creator knows
+                                                            that a HOB is used, but does not know how it is used.
+                                                        </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                             </xs:restriction>
                                         </xs:simpleType>
                                     </xs:attribute>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
 
@@ -1421,26 +1378,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="ClonedFrom">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section may be included for Modules
-                            that are copied from a different module. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section may be included for Modules that are copied
+                            from a different module. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="1" name="GUID">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This GUID and the Version
-                                        attribute uniquely identify the Module that this Module was
-                                        copied from. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
+                                        identify the Module that this Module was copied from. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="RegistryFormatGuid">
-                                            <xs:attribute name="Version" type="xs:decimal"
-                                                use="required">
+                                            <xs:attribute name="Version" type="xs:decimal" use="required">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> This value, along with the GUID,
+                                                        is used to uniquely identify this object. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
@@ -1454,68 +1408,59 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="LibraryClassDefinitions">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A list of the different Library Classes
-                            consumed by a driver, core and/or application module, or produced by a
-                            Library module. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A list of the different Library Classes consumed by a
+                            driver, core and/or application module, or produced by a Library module. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="LibraryClass">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="Keyword"
-                                            type="xs:NCName">
+                                        <xs:element minOccurs="1" maxOccurs="1" name="Keyword" type="xs:NCName">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us "> Used by tools
-                                                  to identify different instances of libraries that
-                                                  provide the library class. This keyword identifies
-                                                  the library class this module needs to be linked
-                                                  against. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us "> Used by tools to identify different
+                                                    instances of libraries that provide the library class. This keyword
+                                                    identifies the library class this module needs to be linked against.
+                                                </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
-                                        <xs:element minOccurs="0" maxOccurs="1"
-                                            name="RecommendedInstance">
+                                        <xs:element minOccurs="0" maxOccurs="1" name="RecommendedInstance">
                                             <xs:complexType>
                                                 <xs:all>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="GUID">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This GUID and
-                                                  the Version attribute uniquely identify the
-                                                  recommended Library Instance for this module .
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="RegistryFormatGuid">
-                                                  <xs:attribute name="Version" type="xs:decimal"
-                                                  use="optional">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:attribute>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
+                                                    <xs:element minOccurs="1" maxOccurs="1" name="GUID">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This GUID and the
+                                                            Version attribute uniquely identify the recommended Library
+                                                            Instance for this module . </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="RegistryFormatGuid">
+                                                            <xs:attribute name="Version" type="xs:decimal"
+                                                            use="optional">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This value, along with
+                                                            the GUID, is used to uniquely identify this object.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            </xs:attribute>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                        </xs:complexType>
+                                                    </xs:element>
                                                 </xs:all>
                                             </xs:complexType>
                                         </xs:element>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Usage" use="required">
                                         <xs:simpleType>
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> Library
-                                                  instances can provide code for a library class, or
-                                                  may require other library instances themselves.
-                                                  Since different execution paths in a library (or
-                                                  module) may need different library classes based
-                                                  on some setting, library classes may not alway be
-                                                  required. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> Library instances can provide code
+                                                    for a library class, or may require other library instances
+                                                    themselves. Since different execution paths in a library (or module)
+                                                    may need different library classes based on some setting, library
+                                                    classes may not alway be required. </xs:documentation>
                                             </xs:annotation>
                                             <xs:restriction base="xs:NCName">
                                                 <xs:enumeration value="PRODUCES"/>
@@ -1527,13 +1472,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     </xs:attribute>
 
                                     <xs:attributeGroup ref="SupportedArchMod"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional">
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional">
                                         <xs:annotation>
-                                            <xs:documentation xml:lang="en-us"> A FeatureFlag
-                                                attribute must evaluate to either true or false - it
-                                                may be a fixed value of true or false, a C name or
-                                                an in-fix expression. </xs:documentation>
+                                            <xs:documentation xml:lang="en-us"> A FeatureFlag attribute must evaluate to
+                                                either true or false - it may be a fixed value of true or false, a C
+                                                name or an in-fix expression. </xs:documentation>
                                         </xs:annotation>
                                     </xs:attribute>
                                 </xs:complexType>
@@ -1549,29 +1492,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
                                 <xs:annotation>
                                     <xs:documentation xml:lang="en-us"> This is the module relative
-                                        (ModuleProperties.Path) path and filename location within
-                                        the ZIP file. </xs:documentation>
+                                        (ModuleProperties.Path) path and filename location within the ZIP file.
+                                    </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:anyURI">
-                                            <xs:attribute name="Family" type="FamilyTypes"
-                                                use="optional">
+                                            <xs:attribute name="Family" type="FamilyTypes" use="optional">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The Family
-                                                  attribute is used to restrict usage to a given
-                                                  family of compilers, such as GCC or MSFT. Since
-                                                  not all code processing tools use the same syntax,
-                                                  especially for assembly, this field can be used to
-                                                  identify different syntax. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> The Family attribute is used to
+                                                        restrict usage to a given family of compilers, such as GCC or
+                                                        MSFT. Since not all code processing tools use the same syntax,
+                                                        especially for assembly, this field can be used to identify
+                                                        different syntax. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
-                                            <xs:attribute name="SupArchList" type="ArchListType"
-                                                use="optional"/>
-                                            <xs:attribute name="SupModList" type="ModuleListType"
-                                                use="optional"/>
-                                            <xs:attribute name="FeatureFlag"
-                                                type="xs:normalizedString" use="optional"/>
+                                            <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                            <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                            <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
@@ -1588,316 +1526,293 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="BinaryFile">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="unbounded"
-                                            name="Filename">
+                                        <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> This is the
-                                                  module relative (ModuleProperties.Path) path and
-                                                  filename location within the ZIP file.
-                                                </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> This is the module relative
+                                                    (ModuleProperties.Path) path and filename location within the ZIP
+                                                    file. </xs:documentation>
                                             </xs:annotation>
                                             <xs:complexType>
                                                 <xs:simpleContent>
-                                                  <xs:extension base="xs:anyURI">
-                                                  <xs:attribute name="FileType" use="optional">
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="xs:NCName">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> Binary file
-                                                  distribution is limited to UEFI/PI FFS leaf
-                                                  section file types. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:enumeration value="GUID"/>
-                                                  <xs:enumeration value="FREEFORM"/>
-                                                  <xs:enumeration value="UEFI_IMAGE"/>
-                                                  <xs:enumeration value="PE32">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> A UEFI/PI FFS
-                                                  Leaf section file type, not a raw PE32 file.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:enumeration>
-                                                  <xs:enumeration value="PIC"/>
-                                                  <xs:enumeration value="PEI_DEPEX"/>
-                                                  <xs:enumeration value="DXE_DEPEX"/>
-                                                  <xs:enumeration value="SMM_DEPEX"/>
-                                                  <xs:enumeration value="COMPAT16"/>
-                                                  <xs:enumeration value="DISPOSABLE"/>
-                                                  <xs:enumeration value="TE"/>
-                                                  <xs:enumeration value="VER"/>
-                                                  <xs:enumeration value="UI"/>
-                                                  <xs:enumeration value="BIN"/>
-                                                  <xs:enumeration value="FV"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:attribute>
-                                                  <xs:attribute name="SupArchList"
-                                                  type="ArchListType" use="optional"/>
-                                                  <xs:attribute name="SupModList"
-                                                  type="ModuleListType" use="optional"/>
-                                                  <xs:attribute name="FeatureFlag"
-                                                  type="xs:normalizedString" use="optional"/>
-                                                  </xs:extension>
+                                                    <xs:extension base="xs:anyURI">
+                                                        <xs:attribute name="FileType" use="optional">
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="xs:NCName">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> Binary file distribution
+                                                            is limited to UEFI/PI FFS leaf section file types.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:enumeration value="GUID"/>
+                                                            <xs:enumeration value="FREEFORM"/>
+                                                            <xs:enumeration value="UEFI_IMAGE"/>
+                                                            <xs:enumeration value="PE32">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> A UEFI/PI FFS Leaf
+                                                            section file type, not a raw PE32 file. </xs:documentation>
+                                                            </xs:annotation>
+                                                            </xs:enumeration>
+                                                            <xs:enumeration value="PIC"/>
+                                                            <xs:enumeration value="PEI_DEPEX"/>
+                                                            <xs:enumeration value="DXE_DEPEX"/>
+                                                            <xs:enumeration value="SMM_DEPEX"/>
+                                                            <xs:enumeration value="COMPAT16"/>
+                                                            <xs:enumeration value="DISPOSABLE"/>
+                                                            <xs:enumeration value="TE"/>
+                                                            <xs:enumeration value="VER"/>
+                                                            <xs:enumeration value="UI"/>
+                                                            <xs:enumeration value="BIN"/>
+                                                            <xs:enumeration value="FV"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                        </xs:attribute>
+                                                        <xs:attribute name="GUID" use="optional"
+                                                            type="RegistryFormatGuid"/>
+                                                        <xs:attribute name="SupArchList" type="ArchListType"
+                                                            use="optional"/>
+                                                        <xs:attribute name="SupModList" type="ModuleListType"
+                                                            use="optional"/>
+                                                        <xs:attribute name="FeatureFlag" type="xs:normalizedString"
+                                                            use="optional"/>
+                                                    </xs:extension>
                                                 </xs:simpleContent>
                                             </xs:complexType>
                                         </xs:element>
-                                        <xs:element minOccurs="0" maxOccurs="unbounded"
-                                            name="AsBuilt">
+                                        <xs:element minOccurs="0" maxOccurs="unbounded" name="AsBuilt">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> This section
-                                                  contains information about how the module was
-                                                  coded, such as Compiler Tools, Flags, PCDs (only
-                                                  PatchPcd and/or PcdEx) and Library Class Instances
-                                                  used to build the binary. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> This section contains information
+                                                    about how the module was coded, such as Compiler Tools, Flags, PCDs
+                                                    (only PatchPcd and/or PcdEx) and Library Class Instances used to
+                                                    build the binary. </xs:documentation>
                                             </xs:annotation>
                                             <xs:complexType>
                                                 <xs:sequence>
 
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="PatchPcdValue">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The element is
-                                                  the Patchable PCD Value that was used during the
-                                                  build. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:sequence>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="TokenSpaceGuidValue"
-                                                  type="RegistryFormatGuid"/>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="PcdCName" type="xs:NCName"/>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="Token">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  <xs:maxLength value="10"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="DatumType" type="PcdDatumTypes"/>
-                                                  <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="MaxDatumSize">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This field is
-                                                  required if the Pcd Datum Type is VOID* </xs:documentation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="Value" type="xs:normalizedString"/>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="Offset">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element ref="HelpText" minOccurs="0"
-                                                  maxOccurs="unbounded"/>
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="PcdError">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> Error
-                                                  information implemented by the module.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:sequence>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="ErrorNumber">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="ErrorMessage">
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="xs:string">
-                                                  <xs:attribute name="Lang" type="xs:language"
-                                                  default="en-us" use="optional"/>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
-                                                  </xs:sequence>
-                                                  </xs:complexType>
-                                                  </xs:element>
-                                                  </xs:sequence>
-                                                  </xs:complexType>
-                                                  </xs:element>
-
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="PcdExValue">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The element is
-                                                  the DynamicEx PCD Value that was used during the
-                                                  build. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:sequence>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="TokenSpaceGuidValue"
-                                                  type="RegistryFormatGuid"/>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="Token">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  <xs:maxLength value="10"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="DatumType" type="PcdDatumTypes"/>
-                                                  <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="MaxDatumSize">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This field is
-                                                  required if the Pcd Datum Type is VOID*
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="Value" type="xs:normalizedString"/>
-                                                  <xs:element ref="HelpText" minOccurs="0"
-                                                  maxOccurs="unbounded"/>
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="PcdError">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> Error
-                                                  information implemented by the module.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:sequence>
-                                                  <xs:element minOccurs="1" maxOccurs="1"
-                                                  name="ErrorNumber">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The minLength
-                                                  of 3 is required to handle the "0x" prefix to the
-                                                  hex number. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:simpleType>
-                                                  <xs:restriction base="HexNumber">
-                                                  <xs:minLength value="3"/>
-                                                  </xs:restriction>
-                                                  </xs:simpleType>
-                                                  </xs:element>
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="ErrorMessage">
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="xs:string">
-                                                  <xs:attribute name="Lang" type="xs:language"
-                                                  default="en-us" use="optional"/>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
-                                                  </xs:sequence>
-                                                  </xs:complexType>
-                                                  </xs:element>
-                                                  </xs:sequence>
-                                                  </xs:complexType>
-                                                  </xs:element>
-
-                                                  <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="LibraryInstances">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This is the
-                                                  actual library instance that was used to link
-                                                  against the module. </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:sequence>
-                                                  <xs:element minOccurs="1" maxOccurs="unbounded"
-                                                  name="GUID">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This GUID and
-                                                  the Version attribute uniquely identify the actual
-                                                  Library Instance linked in this module.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:complexType>
-                                                  <xs:simpleContent>
-                                                  <xs:extension base="RegistryFormatGuid">
-                                                  <xs:attribute name="Version" type="xs:decimal"
-                                                  use="required">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:attribute>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
-                                                  </xs:sequence>
-                                                  </xs:complexType>
-                                                  </xs:element>
-
-                                                  <xs:element minOccurs="0" maxOccurs="unbounded"
-                                                  name="BuildFlags">
-                                                  <xs:complexType mixed="true">
-                                                  <xs:simpleContent>
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> Any
-                                                  description of OS, Tool, and flags for the
-                                                  individual tool can go in this section.
-                                                  </xs:documentation>
-                                                  </xs:annotation>
-                                                  <xs:extension base="xs:string">
-                                                  <xs:anyAttribute processContents="lax"/>
-                                                  </xs:extension>
-                                                  </xs:simpleContent>
-                                                  </xs:complexType>
-                                                  </xs:element>
+                                                    <xs:element minOccurs="0" maxOccurs="unbounded" name="PatchPcdValue">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The element is the
+                                                            Patchable PCD Value that was used during the build.
+                                                            </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:complexType>
+                                                            <xs:sequence>
+                                                            <xs:element minOccurs="1" maxOccurs="1"
+                                                            name="TokenSpaceGuidValue" type="RegistryFormatGuid"/>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="PcdCName"
+                                                            type="xs:NCName"/>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="Token">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            <xs:maxLength value="10"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
+                                                            type="PcdDatumTypes"/>
+                                                            <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This field is required
+                                                            if the Pcd Datum Type is VOID* </xs:documentation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="Value"
+                                                            type="xs:normalizedString"/>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="Offset">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element ref="HelpText" minOccurs="0"
+                                                            maxOccurs="unbounded"/>
+                                                            <xs:element minOccurs="0" maxOccurs="unbounded"
+                                                            name="PcdError">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> Error information
+                                                            implemented by the module. </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:complexType>
+                                                            <xs:sequence>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element minOccurs="0" maxOccurs="unbounded"
+                                                            name="ErrorMessage">
+                                                            <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="xs:string">
+                                                            <xs:attribute name="Lang" type="xs:language" default="en-us"
+                                                            use="optional"/>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                            </xs:complexType>
+                                                            </xs:element>
+                                                            </xs:sequence>
+                                                            </xs:complexType>
+                                                            </xs:element>
+                                                            </xs:sequence>
+                                                        </xs:complexType>
+                                                    </xs:element>
+
+                                                    <xs:element minOccurs="0" maxOccurs="unbounded" name="PcdExValue">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The element is the
+                                                            DynamicEx PCD Value that was used during the build.
+                                                            </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:complexType>
+                                                            <xs:sequence>
+                                                            <xs:element minOccurs="1" maxOccurs="1"
+                                                            name="TokenSpaceGuidValue" type="RegistryFormatGuid"/>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="Token">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            <xs:maxLength value="10"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
+                                                            type="PcdDatumTypes"/>
+                                                            <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This field is required
+                                                            if the Pcd Datum Type is VOID* </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="Value"
+                                                            type="xs:normalizedString"/>
+                                                            <xs:element ref="HelpText" minOccurs="0"
+                                                            maxOccurs="unbounded"/>
+                                                            <xs:element minOccurs="0" maxOccurs="unbounded"
+                                                            name="PcdError">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> Error information
+                                                            implemented by the module. </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:complexType>
+                                                            <xs:sequence>
+                                                            <xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> The minLength of 3 is
+                                                            required to handle the "0x" prefix to the hex number.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:simpleType>
+                                                            <xs:restriction base="HexNumber">
+                                                            <xs:minLength value="3"/>
+                                                            </xs:restriction>
+                                                            </xs:simpleType>
+                                                            </xs:element>
+                                                            <xs:element minOccurs="0" maxOccurs="unbounded"
+                                                            name="ErrorMessage">
+                                                            <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="xs:string">
+                                                            <xs:attribute name="Lang" type="xs:language" default="en-us"
+                                                            use="optional"/>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                            </xs:complexType>
+                                                            </xs:element>
+                                                            </xs:sequence>
+                                                            </xs:complexType>
+                                                            </xs:element>
+                                                            </xs:sequence>
+                                                        </xs:complexType>
+                                                    </xs:element>
+
+                                                    <xs:element minOccurs="0" maxOccurs="1" name="LibraryInstances">
+                                                        <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This is the actual
+                                                            library instance that was used to link against the module.
+                                                            </xs:documentation>
+                                                        </xs:annotation>
+                                                        <xs:complexType>
+                                                            <xs:sequence>
+                                                            <xs:element minOccurs="1" maxOccurs="unbounded" name="GUID">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This GUID and the
+                                                            Version attribute uniquely identify the actual Library
+                                                            Instance linked in this module. </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:complexType>
+                                                            <xs:simpleContent>
+                                                            <xs:extension base="RegistryFormatGuid">
+                                                            <xs:attribute name="Version" type="xs:decimal"
+                                                            use="required">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This value, along with
+                                                            the GUID, is used to uniquely identify this object.
+                                                            </xs:documentation>
+                                                            </xs:annotation>
+                                                            </xs:attribute>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                            </xs:complexType>
+                                                            </xs:element>
+                                                            </xs:sequence>
+                                                        </xs:complexType>
+                                                    </xs:element>
+
+                                                    <xs:element minOccurs="0" maxOccurs="unbounded" name="BuildFlags">
+                                                        <xs:complexType mixed="true">
+                                                            <xs:simpleContent>
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> Any description of OS,
+                                                            Tool, and flags for the individual tool can go in this
+                                                            section. </xs:documentation>
+                                                            </xs:annotation>
+                                                            <xs:extension base="xs:string">
+                                                            <xs:anyAttribute processContents="lax"/>
+                                                            </xs:extension>
+                                                            </xs:simpleContent>
+                                                        </xs:complexType>
+                                                    </xs:element>
                                                 </xs:sequence>
                                             </xs:complexType>
                                         </xs:element>
                                         <!-- End of AsBuilt -->
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                 </xs:complexType>
                             </xs:element>
@@ -1913,47 +1828,41 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Package">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="0" maxOccurs="unbounded"
-                                            name="Description">
+                                        <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
                                             <xs:complexType>
                                                 <xs:simpleContent>
-                                                  <xs:extension base="xs:string">
-                                                  <xs:attribute name="Lang" type="xs:language"
-                                                  default="en-us" use="optional"/>
-                                                  </xs:extension>
+                                                    <xs:extension base="xs:string">
+                                                        <xs:attribute name="Lang" type="xs:language" default="en-us"
+                                                            use="optional"/>
+                                                    </xs:extension>
                                                 </xs:simpleContent>
                                             </xs:complexType>
                                         </xs:element>
                                         <xs:element minOccurs="1" maxOccurs="1" name="GUID">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> This GUID and
-                                                  the Version attribute uniquely identify Package
-                                                  that this Module depends on. </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> This GUID and the Version attribute
+                                                    uniquely identify Package that this Module depends on.
+                                                </xs:documentation>
                                             </xs:annotation>
                                             <xs:complexType>
                                                 <xs:simpleContent>
-                                                  <xs:extension base="RegistryFormatGuid">
-                                                  <xs:attribute name="Version" type="xs:decimal"
-                                                  use="optional">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> This value,
-                                                  along with the GUID, is used to uniquely identify
-                                                  this object. If the version attribute is not
-                                                  specified, the most recent version of the package
-                                                  can be used. </xs:documentation>
-                                                  </xs:annotation>
-                                                  </xs:attribute>
-                                                  </xs:extension>
+                                                    <xs:extension base="RegistryFormatGuid">
+                                                        <xs:attribute name="Version" type="xs:decimal" use="optional">
+                                                            <xs:annotation>
+                                                            <xs:documentation xml:lang="en-us"> This value, along with
+                                                            the GUID, is used to uniquely identify this object. If the
+                                                            version attribute is not specified, the most recent version
+                                                            of the package can be used. </xs:documentation>
+                                                            </xs:annotation>
+                                                        </xs:attribute>
+                                                    </xs:extension>
                                                 </xs:simpleContent>
                                             </xs:complexType>
                                         </xs:element>
                                     </xs:sequence>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="SupModList" type="ModuleListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
                         </xs:sequence>
@@ -1967,68 +1876,60 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="GuidCName">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
                                         <xs:element minOccurs="0" maxOccurs="1" name="VariableName"
                                             type="xs:normalizedString">
                                             <xs:annotation>
-                                                <xs:documentation xml:lang="en-us"> Only valid for
-                                                  Variable GUID types. </xs:documentation>
-                                                <xs:documentation> This can be either a Hex Array or
-                                                  C string in unicode format: L"string" Data.
-                                                </xs:documentation>
+                                                <xs:documentation xml:lang="en-us"> Only valid for Variable GUID types. </xs:documentation>
+                                                <xs:documentation> This can be either a Hex Array or C string in unicode
+                                                    format: L"string" Data. </xs:documentation>
                                             </xs:annotation>
                                         </xs:element>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Usage" use="required">
                                         <xs:simpleType>
                                             <xs:restriction base="xs:NCName">
                                                 <xs:enumeration value="CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us">The module does
-                                                  not install the GUID, and the GUID must be present
-                                                  for the module to execute. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us">The module does not install
+                                                            the GUID, and the GUID must be present for the module to
+                                                            execute. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_CONSUMES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  does not install the GUID, however, the GUID will
-                                                  be used if it is present. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module does not install
+                                                            the GUID, however, the GUID will be used if it is present.
+                                                        </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The module
-                                                  always installs the GUID. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The module always installs
+                                                            the GUID. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="SOMETIMES_PRODUCES">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The Module
-                                                  will install the GUID under certain execution
-                                                  paths. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The Module will install the
+                                                            GUID under certain execution paths. </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                                 <xs:enumeration value="UNDEFINED">
-                                                  <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> The package
-                                                  creator knows that a GUID is used, but does not
-                                                  know how it is used. </xs:documentation>
-                                                  </xs:annotation>
+                                                    <xs:annotation>
+                                                        <xs:documentation xml:lang="en-us"> The package creator knows
+                                                            that a GUID is used, but does not know how it is used.
+                                                        </xs:documentation>
+                                                    </xs:annotation>
                                                 </xs:enumeration>
                                             </xs:restriction>
                                         </xs:simpleType>
                                     </xs:attribute>
                                     <xs:attribute name="GuidType" type="GuidListType" use="required"/>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="SupModList" type="ModuleListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
                         </xs:sequence>
@@ -2038,19 +1939,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="Protocols">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A listing of protocols required or
-                            produced by this module. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A listing of protocols required or produced by this module.
+                        </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="1" maxOccurs="unbounded" name="Protocol"
-                                nillable="true">
+                            <xs:element minOccurs="1" maxOccurs="unbounded" name="Protocol" nillable="true">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Usage" use="required">
                                         <xs:simpleType>
@@ -2066,12 +1964,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                         </xs:simpleType>
                                     </xs:attribute>
                                     <xs:attribute name="Notify" type="xs:boolean" use="optional"/>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="SupModList" type="ModuleListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
                         </xs:sequence>
@@ -2081,19 +1976,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="PPIs">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> A listing of PPIs required or produced
-                            by this module. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> A listing of PPIs required or produced by this module.
+                        </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="1" maxOccurs="unbounded" name="Ppi"
-                                nillable="true">
+                            <xs:element minOccurs="1" maxOccurs="unbounded" name="Ppi" nillable="true">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
-                                            type="xs:NCName"/>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
                                     <xs:attribute name="Usage" use="required">
                                         <xs:simpleType>
@@ -2107,12 +1999,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                         </xs:simpleType>
                                     </xs:attribute>
                                     <xs:attribute name="Notify" type="xs:boolean" use="optional"/>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="SupModList" type="ModuleListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
                         </xs:sequence>
@@ -2122,9 +2011,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="Externs">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> These elements specify additional
-                            information about the module. This area may be used by tools to generate
-                            code. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> These elements specify additional information about the
+                            module. This area may be used by tools to generate code. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
@@ -2133,26 +2021,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     <xs:sequence>
                                         <xs:choice minOccurs="1">
                                             <xs:sequence>
-                                                <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="EntryPoint" type="xs:NCName"/>
-                                                <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="UnloadImage" type="xs:NCName"/>
+                                                <xs:element minOccurs="0" maxOccurs="1" name="EntryPoint"
+                                                    type="xs:NCName"/>
+                                                <xs:element minOccurs="0" maxOccurs="1" name="UnloadImage"
+                                                    type="xs:NCName"/>
                                             </xs:sequence>
                                             <xs:sequence>
-                                                <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="Constructor" type="xs:NCName"/>
-                                                <xs:element minOccurs="0" maxOccurs="1"
-                                                  name="Destructor" type="xs:NCName"/>
+                                                <xs:element minOccurs="0" maxOccurs="1" name="Constructor"
+                                                    type="xs:NCName"/>
+                                                <xs:element minOccurs="0" maxOccurs="1" name="Destructor"
+                                                    type="xs:NCName"/>
                                             </xs:sequence>
                                         </xs:choice>
                                         <xs:element ref="HelpText" minOccurs="0" maxOccurs="1"/>
                                     </xs:sequence>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="SupModList" type="ModuleListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
                         </xs:sequence>
@@ -2162,26 +2047,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="PcdCoded">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section describes how a platform is
-                            coded with respect to the platform configuration knobs.
-                        </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section describes how a platform is coded with respect
+                            to the platform configuration knobs. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdEntry">
                                 <xs:complexType>
                                     <xs:sequence>
-                                        <xs:element minOccurs="1" maxOccurs="1" name="CName"
+                                        <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+                                        <xs:element minOccurs="1" maxOccurs="1" name="TokenSpaceGuidCName"
                                             type="xs:NCName"/>
-                                        <xs:element minOccurs="1" maxOccurs="1"
-                                            name="TokenSpaceGuidCName" type="xs:NCName"/>
                                         <xs:element minOccurs="0" maxOccurs="1" name="DefaultValue"
                                             type="xs:normalizedString"/>
-                                        <xs:element ref="HelpText" minOccurs="0"
-                                            maxOccurs="unbounded"/>
+                                        <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
                                     </xs:sequence>
-                                    <xs:attribute name="PcdItemType" type="PcdItemTypes"
-                                        use="required"/>
+                                    <xs:attribute name="PcdItemType" type="PcdItemTypes" use="required"/>
                                     <xs:attribute name="PcdUsage" use="required">
                                         <xs:simpleType>
                                             <xs:restriction base="xs:NCName">
@@ -2195,12 +2076,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 
                                     </xs:attribute>
-                                    <xs:attribute name="SupArchList" type="ArchListType"
-                                        use="optional"/>
-                                    <xs:attribute name="SupModList" type="ModuleListType"
-                                        use="optional"/>
-                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString"
-                                        use="optional"/>
+                                    <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
+                                    <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
+                                    <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
                                 </xs:complexType>
                             </xs:element>
                         </xs:sequence>
@@ -2210,18 +2088,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="PeiDepex">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This is the PEI dependency expression
-                            for a Dependency Section. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This is the PEI dependency expression for a Dependency
+                            Section. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element name="Expression" type="xs:string" minOccurs="1"
-                                maxOccurs="1">
+                            <xs:element name="Expression" type="xs:string" minOccurs="1" maxOccurs="1">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> An in-fix expression, of C
-                                        identifiers and TRUE, FALSE, AND, OR, NOT, BEFORE, and AFTER
-                                        as well as parenthesis () in the in-fix notation. The
-                                        operators are restricted to grammar defined in the PI
+                                    <xs:documentation xml:lang="en-us"> An in-fix expression, of C identifiers and TRUE,
+                                        FALSE, AND, OR, NOT, BEFORE, and AFTER as well as parenthesis () in the in-fix
+                                        notation. The operators are restricted to grammar defined in the PI
                                         specification. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
@@ -2236,18 +2112,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="DxeDepex">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This is the DXE dependency expression
-                            for a Dependency Section. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This is the DXE dependency expression for a Dependency
+                            Section. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element name="Expression" type=" xs:string " minOccurs="1"
-                                maxOccurs="1">
+                            <xs:element name="Expression" type=" xs:string " minOccurs="1" maxOccurs="1">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> An in-fix expression, of C
-                                        identifiers and TRUE, FALSE, AND, OR, NOT, BEFORE, and AFTER
-                                        as well as parenthesis () in the in-fix notation. The
-                                        operators are restricted to grammar defined in the PI
+                                    <xs:documentation xml:lang="en-us"> An in-fix expression, of C identifiers and TRUE,
+                                        FALSE, AND, OR, NOT, BEFORE, and AFTER as well as parenthesis () in the in-fix
+                                        notation. The operators are restricted to grammar defined in the PI
                                         specification. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
@@ -2262,18 +2136,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="SmmDepex">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This is the SMM dependency expression
-                            for a Dependency Section. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This is the SMM dependency expression for a Dependency
+                            Section. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element name="Expression" type=" xs:string " minOccurs="1"
-                                maxOccurs="1">
+                            <xs:element name="Expression" type=" xs:string " minOccurs="1" maxOccurs="1">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> An in-fix expression, of C
-                                        identifiers and TRUE, FALSE, AND, OR, NOT, BEFORE, and AFTER
-                                        as well as parenthesis () in the in-fix notation. The
-                                        operators are restricted to grammar defined in the PI
+                                    <xs:documentation xml:lang="en-us"> An in-fix expression, of C identifiers and TRUE,
+                                        FALSE, AND, OR, NOT, BEFORE, and AFTER as well as parenthesis () in the in-fix
+                                        notation. The operators are restricted to grammar defined in the PI
                                         specification. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
@@ -2289,9 +2161,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="1" name="MiscellaneousFiles">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is used to provide comments
-                            and/or list auxiliary files, such as pdb or map files.
-                        </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is used to provide comments and/or list
+                            auxiliary files, such as pdb or map files. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:sequence>
@@ -2299,27 +2170,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:string">
-                                            <xs:attribute name="Lang" type="xs:language"
-                                                default="en-us" use="optional"/>
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
                             </xs:element>
                             <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is the path and
-                                        filename location within the ZIP file. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is the path and filename location within
+                                        the ZIP file. </xs:documentation>
                                 </xs:annotation>
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:anyURI">
-                                            <xs:attribute name="Executable" type="xs:boolean"
-                                                default="false" use="optional">
+                                            <xs:attribute name="Executable" type="xs:boolean" default="false"
+                                                use="optional">
                                                 <xs:annotation>
-                                                  <xs:documentation xml:lang="en-us"> If true, used
-                                                  by installation tools to ensure that a file that
-                                                  must be executable has the correct properties to
-                                                  permit execution. </xs:documentation>
+                                                    <xs:documentation xml:lang="en-us"> If true, used by installation
+                                                        tools to ensure that a file that must be executable has the
+                                                        correct properties to permit execution. </xs:documentation>
                                                 </xs:annotation>
                                             </xs:attribute>
                                         </xs:extension>
@@ -2333,35 +2203,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="UserExtensions">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This section is used for any processing
-                            instructions that may be custom to the content provided by the
-                            distribution that are common to module. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This section is used for any processing instructions that
+                            may be custom to the content provided by the distribution that are common to module. </xs:documentation>
                         <xs:documentation xml:lang="en-us"> The content is vendor specific. </xs:documentation>
-                        <xs:documentation xml:lang="en-us"> The content can be plain text as well as
-                            any user-defined, properly formatted XML structure. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> The content can be plain text as well as any user-defined,
+                            properly formatted XML structure. </xs:documentation>
                     </xs:annotation>
                     <xs:complexType mixed="true">
                         <xs:attribute name="UserId" type="xs:NCName" use="required">
                             <xs:annotation>
-                                <xs:documentation xml:lang="en-us"> This is a single word identifier
-                                    for grouping similar content. For example, ReferenceBuild might
-                                    be used to identify non-PI compliant build steps, with two
-                                    different UserExtensions sections, one with an Identifier of
-                                    Prebuild, and another of PostBuild. Both UserExtensions sections
-                                    would use the same UserId. </xs:documentation>
+                                <xs:documentation xml:lang="en-us"> This is a single word identifier for grouping
+                                    similar content. For example, ReferenceBuild might be used to identify non-PI
+                                    compliant build steps, with two different UserExtensions sections, one with an
+                                    Identifier of Prebuild, and another of PostBuild. Both UserExtensions sections would
+                                    use the same UserId. </xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
                         <xs:attribute name="Identifier" type="xs:string" use="required">
                             <xs:annotation>
-                                <xs:documentation xml:lang="en-us"> This can be any string used to
-                                    differentiate or identify this section from other UserExtensions
-                                    sections. </xs:documentation>
-                                <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS
-                                    Identifier might indicate specific steps and tools required
-                                    before processing module content, while a different
-                                    UserExtensions section with a POST_PROCESS Identifier might
-                                    describe steps that need to be executed after operations on this
-                                    module. </xs:documentation>
+                                <xs:documentation xml:lang="en-us"> This can be any string used to differentiate or
+                                    identify this section from other UserExtensions sections. </xs:documentation>
+                                <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might indicate
+                                    specific steps and tools required before processing module content, while a
+                                    different UserExtensions section with a POST_PROCESS Identifier might describe steps
+                                    that need to be executed after operations on this module. </xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
                         <xs:anyAttribute processContents="lax"/>
@@ -2372,11 +2237,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             </xs:sequence>
             <xs:attribute name="BinaryModule" type="xs:boolean" default="false" use="optional">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This attribute is used when the binaries are
-                        distributed for this module and no code generation from source files is
-                        required. If set, then the BinaryFiles section should be used, and any files
-                        listed in the SourceFiles section do not have to be built. Additionally, the
-                        AsBuilt section for each binary file must be included. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This attribute is used when the binaries are distributed for
+                        this module and no code generation from source files is required. If set, then the BinaryFiles
+                        section should be used, and any files listed in the SourceFiles section do not have to be built.
+                        Additionally, the AsBuilt section for each binary file must be included. </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
         </xs:complexType>
@@ -2390,42 +2254,34 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 <xs:element minOccurs="0" maxOccurs="1" name="Header">
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="1" maxOccurs="1" name="Name"
-                                type="xs:normalizedString">
+                            <xs:element minOccurs="1" maxOccurs="1" name="Name" type="xs:normalizedString">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us">This is the User Interface
-                                        Name for this Tools Distribution.</xs:documentation>
+                                    <xs:documentation xml:lang="en-us">This is the User Interface Name for this Tools
+                                        Distribution.</xs:documentation>
                                 </xs:annotation>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        Copyright is different from the Distribution Package
-                                        copyright. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the Copyright is
+                                        different from the Distribution Package copyright. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        License is different from the Distribution Package license.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the License is
+                                        different from the Distribution Package license. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Abstract"
-                                type="xs:normalizedString">
+                            <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:normalizedString">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        Abstract is different from the Distribution Package
-                                        Abstract. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the Abstract is
+                                        different from the Distribution Package Abstract. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Description"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="1" name="Description" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        Description is different from the Distribution Package
-                                        Description. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the Description is
+                                        different from the Distribution Package Description. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                         </xs:sequence>
@@ -2433,26 +2289,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 </xs:element>
                 <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This is the path and filename location
-                            within the ZIP file. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This is the path and filename location within the ZIP file.
+                        </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:simpleContent>
                             <xs:extension base="xs:anyURI">
                                 <xs:attribute name="OS" type="SupportedOs" use="optional">
                                     <xs:annotation>
-                                        <xs:documentation xml:lang="en-us"> This is required for
-                                            tools that execute; it should not be used for
-                                            configuration files. </xs:documentation>
+                                        <xs:documentation xml:lang="en-us"> This is required for tools that execute; it
+                                            should not be used for configuration files. </xs:documentation>
                                     </xs:annotation>
                                 </xs:attribute>
-                                <xs:attribute name="Executable" type="xs:boolean" default="false"
-                                    use="optional">
+                                <xs:attribute name="Executable" type="xs:boolean" default="false" use="optional">
                                     <xs:annotation>
-                                        <xs:documentation xml:lang="en-us"> If true, used by
-                                            installation tools to ensure that a file that must be
-                                            executable has the correct properties to permit
-                                            execution. </xs:documentation>
+                                        <xs:documentation xml:lang="en-us"> If true, used by installation tools to
+                                            ensure that a file that must be executable has the correct properties to
+                                            permit execution. </xs:documentation>
                                     </xs:annotation>
                                 </xs:attribute>
                             </xs:extension>
@@ -2466,44 +2319,39 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
     <xs:element name="MiscellaneousFiles">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> This section contains a list of files that are not
-                part of the code distributed with modules, packages or tools. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> This section contains a list of files that are not part of the code
+                distributed with modules, packages or tools. </xs:documentation>
         </xs:annotation>
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="0" maxOccurs="1" name="Header">
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Name"
-                                type="xs:normalizedString">
+                            <xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:normalizedString">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> The User interface name for
-                                        this content. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> The User interface name for this content.
+                                    </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright"
-                                type="xs:string">
+                            <xs:element minOccurs="0" maxOccurs="1" name="Copyright" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        Copyright is different from the Distribution Package
-                                        Copyright. </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the Copyright is
+                                        different from the Distribution Package Copyright. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
                             <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
                                 <xs:annotation>
-                                    <xs:documentation xml:lang="en-us"> This is only required if the
-                                        License is different from the Distribution Package License.
-                                    </xs:documentation>
+                                    <xs:documentation xml:lang="en-us"> This is only required if the License is
+                                        different from the Distribution Package License. </xs:documentation>
                                 </xs:annotation>
                             </xs:element>
-                            <xs:element minOccurs="0" maxOccurs="1" name="Abstract"
-                                type="xs:normalizedString"/>
+                            <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:normalizedString"/>
                             <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
                                 <xs:complexType>
                                     <xs:simpleContent>
                                         <xs:extension base="xs:string">
-                                            <xs:attribute name="Lang" type="xs:language"
-                                                default="en-us" use="optional"/>
+                                            <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+                                            />
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
@@ -2513,19 +2361,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 </xs:element>
                 <xs:element minOccurs="0" maxOccurs="unbounded" name="Filename">
                     <xs:annotation>
-                        <xs:documentation xml:lang="en-us"> This is the path and filename location
-                            within the ZIP file. </xs:documentation>
+                        <xs:documentation xml:lang="en-us"> This is the path and filename location within the ZIP file.
+                        </xs:documentation>
                     </xs:annotation>
                     <xs:complexType>
                         <xs:simpleContent>
                             <xs:extension base="xs:anyURI">
-                                <xs:attribute name="Executable" type="xs:boolean" default="false"
-                                    use="optional">
+                                <xs:attribute name="Executable" type="xs:boolean" default="false" use="optional">
                                     <xs:annotation>
-                                        <xs:documentation xml:lang="en-us"> If true, used by
-                                            installation tools to ensure that a file that must be
-                                            executable has the correct properties to permit
-                                            execution. </xs:documentation>
+                                        <xs:documentation xml:lang="en-us"> If true, used by installation tools to
+                                            ensure that a file that must be executable has the correct properties to
+                                            permit execution. </xs:documentation>
                                     </xs:annotation>
                                 </xs:attribute>
                             </xs:extension>
@@ -2544,22 +2390,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             </xs:sequence>
             <xs:attribute name="UserId" type="xs:NCName" use="required">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This is a single word identifier for
-                        grouping similar content. For example, ReferenceBuild might be used to
-                        identify non-PI compliant build steps, with two different UserExtensions
-                        sections, one with an Identifier of Prebuild, and another of PostBuild. Both
-                        UserExtensions sections would use the same UserId. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This is a single word identifier for grouping similar content.
+                        For example, ReferenceBuild might be used to identify non-PI compliant build steps, with two
+                        different UserExtensions sections, one with an Identifier of Prebuild, and another of PostBuild.
+                        Both UserExtensions sections would use the same UserId. </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
             <xs:attribute name="Identifier" type="xs:string" use="optional">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This can be any string used to differentiate
-                        or identify this section from other UserExtensions sections. </xs:documentation>
-                    <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might
-                        indicate specific steps and tools required before processing distribution
-                        package content, while a different UserExtensions section with a
-                        POST_PROCESS Identifier might describe steps that need to be executed after
-                        operations on this content. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This can be any string used to differentiate or identify this
+                        section from other UserExtensions sections. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might indicate specific
+                        steps and tools required before processing distribution package content, while a different
+                        UserExtensions section with a POST_PROCESS Identifier might describe steps that need to be
+                        executed after operations on this content. </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
             <xs:anyAttribute processContents="lax"/>
@@ -2596,11 +2440,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             <xs:enumeration value="X64"/>
             <xs:enumeration value="IPF"/>
             <xs:enumeration value="EBC"/>
+            <xs:enumeration value="ARM"/>
             <xs:pattern value="([A-Z])([a-zA-Z0-9])*">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> Any processor architecture not listed above.
-                        The Architecture must be a target architecture of one or more compiler tool
-                        chains. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> Any processor architecture not listed above. The Architecture
+                        must be a target architecture of one or more compiler tool chains. </xs:documentation>
                 </xs:annotation>
             </xs:pattern>
         </xs:restriction>
@@ -2613,8 +2457,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             <xs:enumeration value="GCC"/>
             <xs:pattern value="[A-Z][a-zA-Z0-9]*">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> Any other family of build utilities for
-                        which compiler tools exist. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> Any other family of build utilities for which compiler tools
+                        exist. </xs:documentation>
                 </xs:annotation>
             </xs:pattern>
         </xs:restriction>
@@ -2657,70 +2501,66 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
     <xs:simpleType name="ModuleTypes">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> The following module types are defined by
-                specifications. </xs:documentation>
-            <xs:documentation xml:lang="en-us"> Module types for components and libraries defined
-                for this distribution mechanism. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> The following module types are defined by specifications. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> Module types for components and libraries defined for this distribution
+                mechanism. </xs:documentation>
         </xs:annotation>
         <xs:restriction base="xs:NCName">
             <xs:enumeration value="BASE ">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> Use of this module is not restricted.
-                    </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> Use of this module is not restricted. </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="DXE_CORE">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to the DXE
-                        core. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to the DXE core.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="DXE_DRIVER">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE
-                        driver. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE driver.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="DXE_RUNTIME_DRIVER">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE
-                        runtime driver. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE runtime driver.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="DXE_SAL_DRIVER">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to an IPF DXE
-                        runtime driver. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to an IPF DXE runtime driver.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="DXE_SMM_DRIVER">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE SMM
-                        driver. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE SMM driver.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="PEI_CORE">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to the PEI
-                        core. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to the PEI core.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="PEIM">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only valid for PEI modules.
-                    </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only valid for PEI modules. </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="SEC">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only applicable to Security
-                        phase. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only applicable to Security phase.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="UEFI_DRIVER">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only valid for UEFI drivers.
-                    </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only valid for UEFI drivers. </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="UEFI_RUNTIME_DRIVER">
@@ -2731,8 +2571,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             </xs:enumeration>
             <xs:enumeration value="UEFI_APPLICATION">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This module is only valid for UEFI
-                        applications. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This module is only valid for UEFI applications.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="SMM_CORE">
@@ -2743,21 +2583,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             </xs:enumeration>
             <xs:enumeration value="USER_DEFINED">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This content is restricted to a specific
-                        implementation. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This content is restricted to a specific implementation.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="UNDEFINED">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This enumeration is for use in a list that
-                        where the package creator does not know the what module types are supported
-                        by a module. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This enumeration is for use in a list that where the package
+                        creator does not know the what module types are supported by a module. </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:pattern value="([A-Z])([a-zA-Z0-9])*">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This pattern has been added for use in a
-                        module lists - for future expansion. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This pattern has been added for use in a module lists - for
+                        future expansion. </xs:documentation>
                 </xs:annotation>
             </xs:pattern>
         </xs:restriction>
@@ -2765,8 +2604,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
     <xs:simpleType name="PcdDatumTypes">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> The following data types are defined by the PCD
-                specification (or PCD section of the UEFI/PI specifications.) </xs:documentation>
+            <xs:documentation xml:lang="en-us"> The following data types are defined by the PCD specification (or PCD
+                section of the UEFI/PI specifications.) </xs:documentation>
         </xs:annotation>
         <xs:restriction base="xs:normalizedString">
             <xs:enumeration value="UINT8"/>
@@ -2786,82 +2625,73 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         <xs:restriction base="xs:NCName">
             <xs:enumeration value="FeaturePcd">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> The Feature PCD is a binary, evaluating to
-                        either true or false. This is used during build to include/exclude content.
-                        It can also be used during execution to force execution paths within
-                        drivers, or to enable/disable features within a driver for a given platform.
-                    </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> The Feature PCD is a binary, evaluating to either true or false.
+                        This is used during build to include/exclude content. It can also be used during execution to
+                        force execution paths within drivers, or to enable/disable features within a driver for a given
+                        platform. </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="FixedPcd">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> The Fixed PCD is a #define value that is set
-                        at build time. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> The Fixed PCD is a #define value that is set at build time.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="PatchPcd">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> The Patch PCD is a #define that is set at
-                        build time, and that can be modified within a binary file. Additional
-                        information, such as the offset location of the value, along with it's
-                        length may need to be provided.</xs:documentation>
+                    <xs:documentation xml:lang="en-us"> The Patch PCD is a #define that is set at build time, and that
+                        can be modified within a binary file. Additional information, such as the offset location of the
+                        value, along with it's length may need to be provided.</xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="Pcd">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> This PCD type has an overloaded definition.
-                        Prior to build, the platform integrator may choose to implement a PCD as
-                        Fixed, Patchable or a Dynamic PCD. If the platform integrator choose to use
-                        the PCD as dynamic, then a PCD driver is required in the platform
-                        (PEI/DXE/both) to track the PCD in some sort of 'database' of these items.
-                        For Dynamic PCDs, the PcdGet* must pass in the token space guid and the
-                        token number to retrieve data (PcdSet* also needs these values.)
-                    </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> This PCD type has an overloaded definition. Prior to build, the
+                        platform integrator may choose to implement a PCD as Fixed, Patchable or a Dynamic PCD. If the
+                        platform integrator choose to use the PCD as dynamic, then a PCD driver is required in the
+                        platform (PEI/DXE/both) to track the PCD in some sort of 'database' of these items. For Dynamic
+                        PCDs, the PcdGet* must pass in the token space guid and the token number to retrieve data
+                        (PcdSet* also needs these values.) </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="PcdEx">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> The PCD can only be used as Dynamic, and the
-                        platform firmware must contain a driver to maintain a 'database' of these
-                        items. For Dynamic PCDs, the PcdGet* must pass in the token space guid and
-                        the token number to retrieve data (PcdSet* also needs these values.)
-                    </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> The PCD can only be used as Dynamic, and the platform firmware
+                        must contain a driver to maintain a 'database' of these items. For Dynamic PCDs, the PcdGet*
+                        must pass in the token space guid and the token number to retrieve data (PcdSet* also needs
+                        these values.) </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
         </xs:restriction>
     </xs:simpleType>
 
-
-
     <xs:simpleType name="RegistryFormatGuid">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> A GUID must contain five different Hexadecimal
-                character sets that are separated by a dash (-) character. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> A GUID must contain five different Hexadecimal character sets that are
+                separated by a dash (-) character. </xs:documentation>
         </xs:annotation>
         <xs:restriction base="xs:string">
-            <xs:pattern
-                value="\s*[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\s*"
-            />
+            <xs:pattern value="\s*[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\s*"/>
         </xs:restriction>
     </xs:simpleType>
 
     <xs:simpleType name="SupportedOs">
         <xs:annotation>
-            <xs:documentation xml:lang="en-us"> The EDK II build system supports workstations
-                running one of the following supported operating systems. This is the OS for the
-                developer's workstation, not the target platform. </xs:documentation>
+            <xs:documentation xml:lang="en-us"> The EDK II build system supports workstations running one of the
+                following supported operating systems. This is the OS for the developer's workstation, not the target
+                platform. </xs:documentation>
         </xs:annotation>
         <xs:restriction base="xs:string">
             <xs:enumeration value="Win32">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> For Windows 2003, Windows XP and Windows
-                        Vista. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> For Windows 2003, Windows XP and Windows Vista.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="Win64">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> For Windows 2003, Windows XP and Windows
-                        Vista. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> For Windows 2003, Windows XP and Windows Vista.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="Linux32"/>
@@ -2870,14 +2700,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             <xs:enumeration value="OS/X64"/>
             <xs:enumeration value="GenericWin">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> Typically, this is used for Windows Batch
-                        files. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> Typically, this is used for Windows Batch files.
+                    </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:enumeration value="GenericNix">
                 <xs:annotation>
-                    <xs:documentation xml:lang="en-us"> Typically use for shell scripts - valid for
-                        any Linux and Mac OS/X. </xs:documentation>
+                    <xs:documentation xml:lang="en-us"> Typically use for shell scripts - valid for any Linux and Mac
+                        OS/X. </xs:documentation>
                 </xs:annotation>
             </xs:enumeration>
             <xs:pattern value="[a-zA-Z]([a-zA-Z0-9])*"/>
index 107e783d2e193e2032f2c07b925965a5de390bde..4a21aba8545c57109bf0772e00e2e910a60b5ad8 100644 (file)
         -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
 \r
     <Command.GCC>\r
-        $(OBJCOPY) --only-keep-debug ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug\r
-        $(OBJCOPY) --strip-unneeded ${src}\r
+        $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug\r
+        $(OBJCOPY) --strip-unneeded -R .eh_frame ${src}\r
 \r
         #\r
         #The below 2 lines are only needed for UNIXGCC tool chain, which genereates PE image directly\r
index 67443200ebb001d0e68979cb6b6312009734fe59..787fc64fb1f23eda753ac8ff8d952aff08595c7f 100644 (file)
@@ -34,7 +34,8 @@ ACTIVE_PLATFORM       = Nt32Pkg/Nt32Pkg.dsc
 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
+#                                               One, or more, of the following, IA32, IPF, X64, EBC, ARM\r
+#                                               or AArch64.\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 a platform description file, \r
index a82404a14430d9c4663db0c8320c35250a23ab10..06e7d6596a95651a9be6e7a046944730b8159e80 100644 (file)
@@ -1,6 +1,7 @@
 #\r
-#  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+#  Portions copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -47,6 +48,14 @@ DEFINE VS2010x86_DLL    = C:\Program Files (x86)\Microsoft Visual Studio 10.0\Co
 DEFINE VS2010x86_BINX64 = DEF(VS2010x86_BIN)\x86_amd64\r
 DEFINE VS2010x86_BIN64  = DEF(VS2010x86_BIN)\x86_ia64\r
 \r
+DEFINE VS2012_BIN      = C:\Program Files\Microsoft Visual Studio 11.0\Vc\bin\r
+DEFINE VS2012_DLL      = C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE;DEF(VS2012_BIN)\r
+DEFINE VS2012_BINX64   = DEF(VS2012_BIN)\x86_amd64\r
+\r
+DEFINE VS2012x86_BIN    = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Vc\bin\r
+DEFINE VS2012x86_DLL    = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE;DEF(VS2012x86_BIN)\r
+DEFINE VS2012x86_BINX64 = DEF(VS2012x86_BIN)\x86_amd64\r
+\r
 DEFINE WINSDK_VERSION   = v6.0A\r
 DEFINE WINSDK_BIN       = c:\Program Files\Microsoft SDKs\Windows\DEF(WINSDK_VERSION)\bin\r
 DEFINE WINSDKx86_BIN    = c:\Program Files (x86)\Microsoft SDKs\Windows\DEF(WINSDK_VERSION)\bin\r
@@ -147,6 +156,9 @@ DEFINE GCC45_X64_PREFIX        = /usr/bin/
 DEFINE GCC46_IA32_PREFIX       = /usr/bin/\r
 DEFINE GCC46_X64_PREFIX        = /usr/bin/\r
 \r
+DEFINE GCC47_IA32_PREFIX       = /usr/bin/\r
+DEFINE GCC47_X64_PREFIX        = /usr/bin/\r
+\r
 DEFINE UNIX_IASL_BIN           = /usr/bin/iasl\r
 #DEFINE UNIX_IASL_BIN           = $(HOME)/programs/iasl\r
 DEFINE WIN_ASL_BIN_DIR         = C:\ASL\r
@@ -244,6 +256,15 @@ DEFINE CLANG_BIN = /usr/bin/
 #                             Required to build platforms or ACPI tables:\r
 #                               Intel(r) ACPI Compiler (iasl.exe) v20101013 from\r
 #                               http://www.acpica.org/downloads/previous_releases.php\r
+#   VS2012      -win32-  Requires:\r
+#                             Microsoft Visual Studio 2012 Professional Edition\r
+#                             Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830\r
+#                        Optional:\r
+#                             Required to build EBC drivers:\r
+#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Intel(r) ACPI Compiler (iasl.exe) v20101013 from\r
+#                               http://www.acpica.org/downloads/previous_releases.php\r
 #   DDK3790     -win32-  Requires:\r
 #                             Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830\r
 #                        Optional:\r
@@ -277,6 +298,12 @@ DEFINE CLANG_BIN = /usr/bin/
 #                             Required to build platforms or ACPI tables:\r
 #                               Intel(r) ACPI Compiler v20101013 from\r
 #                               http://www.acpica.org/downloads/previous_releases.php\r
+#   GCC47       -Linux-  Requires:\r
+#                             GCC 4.7 (Native)\r
+#                        Optional:\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Intel(r) ACPI Compiler v20101013 from\r
+#                               http://www.acpica.org/downloads/previous_releases.php\r
 #   ELFGCC      -Linux-  Requires:\r
 #                             GCC(this tool chain uses whatever version of gcc and binutils that is installed in /usr/bin)\r
 #                        Optional:\r
@@ -361,6 +388,15 @@ DEFINE CLANG_BIN = /usr/bin/
 #                             Required to build platforms or ACPI tables:\r
 #                               Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from\r
 #                               http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi\r
+#   VS2012xASL  -win32-  Requires:\r
+#                             Microsoft Visual Studio 2012 Professional Edition\r
+#                             Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830\r
+#                        Optional:\r
+#                             Required to build EBC drivers:\r
+#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from\r
+#                               http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi\r
 #   DDK3790xASL -win32-  Requires:\r
 #                             Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830\r
 #                        Optional:\r
@@ -425,6 +461,13 @@ DEFINE CLANG_BIN = /usr/bin/
 #                             Required to build platforms or ACPI tables:\r
 #                               Intel(r) ACPI Compiler (iasl.exe) v20101013 from\r
 #                               http://www.acpica.org/downloads/previous_releases.php \r
+#   VS2012x86   -win64-  Requires:\r
+#                             Microsoft Visual Studio 2012 (x86) Professional Edition\r
+#                             Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830\r
+#                        Optional:\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Intel(r) ACPI Compiler (iasl.exe) v20101013 from\r
+#                               http://www.acpica.org/downloads/previous_releases.php\r
 #   ICCx86      -win64-  Requires:\r
 #                             Intel C Compiler V9.1(x86)\r
 #                        Dependencies:\r
@@ -472,6 +515,13 @@ DEFINE CLANG_BIN = /usr/bin/
 #                             Required to build platforms or ACPI tables:\r
 #                               Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from\r
 #                               http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi\r
+#  VS2012x86xASL -win64- Requires:\r
+#                             Microsoft Visual Studio 2012 (x86) Professional Edition\r
+#                             Microsoft Windows Server 2003 Driver Development Kit(Microsoft WINDDK) version 3790.1830 \r
+#                        Optional:\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from\r
+#                               http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi\r
 #   ICCx86xASL  -win64-  Requires:\r
 #                             Intel C Compiler V9.1 (x86)\r
 #                        Dependencies:\r
@@ -514,6 +564,32 @@ DEFINE CLANG_BIN = /usr/bin/
 #                             Required to build platforms or ACPI tables:\r
 #                               Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from\r
 #                               http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi\r
+#   ARMGCC      -unix-   Requires:\r
+#                             ARM None EABI GCC 4.6.0\r
+#                        Optional:\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Intel(r) ACPI Compiler v20101013 from\r
+#                               http://www.acpica.org/downloads/previous_releases.php\r
+#   ARMLINUXGCC -unix-   Requires:\r
+#                             ARM Linux GNU EABI GCC 4.6.0\r
+#                        Optional:\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Intel(r) ACPI Compiler v20101013 from\r
+#                               http://www.acpica.org/downloads/previous_releases.php\r
+#   RVCT        -win-   Requires:\r
+#                             ARM C/C++ Compiler, 5.00\r
+#                        Optional:\r
+#                             Required to build EBC drivers:\r
+#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from\r
+#                               http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi\r
+#   RVCTLINUX   -unix-   Requires:\r
+#                             ARM C/C++ Compiler, 5.00\r
+#                        Optional:\r
+#                             Required to build platforms or ACPI tables:\r
+#                               Intel(r) ACPI Compiler v20101013 from\r
+#                               http://www.acpica.org/downloads/previous_releases.php\r
 # * Commented out - All versions of VS2005 use the same standard install directory\r
 #\r
 ####################################################################################\r
@@ -713,7 +789,6 @@ NOOPT_VS2003xASL_IA32_DLINK_FLAGS       = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OP
 *_VS2003xASL_EBC_DLINK_FLAGS            = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
 \r
 ####################################################################################\r
-#\r
 # Microsoft Visual Studio 2005\r
 #\r
 #   VS2005  - Microsoft Visual Studio 2005 All Edition, including Standard, Professional, Express, TeamSuite\r
@@ -789,7 +864,6 @@ NOOPT_VS2005_IA32_DLINK_FLAGS     = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
 *_VS2005_X64_ASLPP_PATH    = DEF(VS2005_BINX64)\cl.exe\r
 *_VS2005_X64_ASLDLINK_PATH = DEF(VS2005_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2005_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2005_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2005_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -926,7 +1000,6 @@ NOOPT_VS2005xASL_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE
 *_VS2005xASL_X64_ASLPP_PATH    = DEF(VS2005_BINX64)\cl.exe\r
 *_VS2005xASL_X64_ASLDLINK_PATH = DEF(VS2005_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2005xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2005xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2005xASL_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -1063,7 +1136,6 @@ NOOPT_VS2005x86_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
 *_VS2005x86_X64_ASLPP_PATH    = DEF(VS2005x86_BINX64)\cl.exe\r
 *_VS2005x86_X64_ASLDLINK_PATH = DEF(VS2005x86_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2005x86_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2005x86_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2005x86_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -1200,7 +1272,6 @@ NOOPT_VS2005x86xASL_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT
 *_VS2005x86xASL_X64_ASLPP_PATH    = DEF(VS2005x86_BINX64)\cl.exe\r
 *_VS2005x86xASL_X64_ASLDLINK_PATH = DEF(VS2005x86_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2005x86xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2005x86xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2005x86xASL_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -1261,7 +1332,6 @@ NOOPT_VS2005x86xASL_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:R
 *_VS2005x86xASL_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
 \r
 \r
-\r
 ####################################################################################\r
 #\r
 # Microsoft Visual Studio 2008\r
@@ -1339,7 +1409,6 @@ NOOPT_VS2008_IA32_DLINK_FLAGS     = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
 *_VS2008_X64_ASLPP_PATH    = DEF(VS2008_BINX64)\cl.exe\r
 *_VS2008_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2008_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2008_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2008_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -1384,13 +1453,14 @@ NOOPT_VS2008_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF
 # EBC definitions\r
 ##################\r
 *_VS2008_EBC_*_FAMILY            = INTEL\r
+*_VS2008_EBC_*_DLL               = DEF(VS2008_DLL)\r
 \r
 *_VS2008_EBC_MAKE_PATH           = DEF(VS2008_BIN)\nmake.exe\r
 *_VS2008_EBC_PP_PATH             = DEF(EBC_BIN)\iec.exe\r
 *_VS2008_EBC_VFRPP_PATH          = DEF(EBC_BIN)\iec.exe\r
 *_VS2008_EBC_CC_PATH             = DEF(EBC_BIN)\iec.exe\r
-*_VS2008_EBC_SLINK_PATH          = DEF(EBC_BIN)\link.exe\r
-*_VS2008_EBC_DLINK_PATH          = DEF(EBC_BIN)\link.exe\r
+*_VS2008_EBC_SLINK_PATH          = DEF(VS2008_BIN)\link.exe\r
+*_VS2008_EBC_DLINK_PATH          = DEF(VS2008_BIN)\link.exe\r
 \r
 *_VS2008_EBC_MAKE_FLAGS          = /nologo\r
 *_VS2008_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
@@ -1399,6 +1469,7 @@ NOOPT_VS2008_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF
 *_VS2008_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
 *_VS2008_EBC_DLINK_FLAGS         = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
 \r
+\r
 ####################################################################################\r
 #\r
 # Microsoft Visual Studio 2008\r
@@ -1476,7 +1547,6 @@ NOOPT_VS2008xASL_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE
 *_VS2008xASL_X64_ASLPP_PATH    = DEF(VS2008_BINX64)\cl.exe\r
 *_VS2008xASL_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2008xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2008xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2008xASL_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -1521,13 +1591,14 @@ NOOPT_VS2008xASL_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,
 # EBC definitions\r
 ##################\r
 *_VS2008xASL_EBC_*_FAMILY            = INTEL\r
+*_VS2008xASL_EBC_*_DLL               = DEF(VS2008_DLL)\r
 \r
 *_VS2008xASL_EBC_MAKE_PATH           = DEF(VS2008_BIN)\nmake.exe\r
 *_VS2008xASL_EBC_PP_PATH             = DEF(EBC_BIN)\iec.exe\r
 *_VS2008xASL_EBC_VFRPP_PATH          = DEF(EBC_BIN)\iec.exe\r
 *_VS2008xASL_EBC_CC_PATH             = DEF(EBC_BIN)\iec.exe\r
-*_VS2008xASL_EBC_SLINK_PATH          = DEF(EBC_BIN)\link.exe\r
-*_VS2008xASL_EBC_DLINK_PATH          = DEF(EBC_BIN)\link.exe\r
+*_VS2008xASL_EBC_SLINK_PATH          = DEF(VS2008_BIN)\link.exe\r
+*_VS2008xASL_EBC_DLINK_PATH          = DEF(VS2008_BIN)\link.exe\r
 \r
 *_VS2008xASL_EBC_MAKE_FLAGS          = /nologo\r
 *_VS2008xASL_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
@@ -1652,6 +1723,26 @@ NOOPT_VS2008x86_IPF_ASM_FLAGS      = -N us -X explicit -M ilp64 -N so -W4 -d deb
 RELEASE_VS2008x86_IPF_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb\r
 NOOPT_VS2008x86_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG\r
 \r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2008x86_EBC_*_FAMILY            = INTEL\r
+*_VS2008x86_EBC_*_DLL               = DEF(VS2008x86_DLL)\r
+\r
+*_VS2008x86_EBC_MAKE_PATH           = DEF(VS2008x86_BIN)\nmake.exe\r
+*_VS2008x86_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2008x86_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe\r
+*_VS2008x86_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2008x86_EBC_SLINK_PATH          = DEF(VS2008x86_BIN)\link.exe\r
+*_VS2008x86_EBC_DLINK_PATH          = DEF(VS2008x86_BIN)\link.exe\r
+\r
+*_VS2008x86_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2008x86_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2008x86_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2008x86_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2008x86_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2008x86_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
 \r
 ####################################################################################\r
 #   VS2008x86xASL     - Microsoft Visual Studio 2008 with Microsoft ASL\r
@@ -1767,12 +1858,32 @@ NOOPT_VS2008x86xASL_IPF_ASM_FLAGS      = -N us -X explicit -M ilp64 -N so -W4 -d
 RELEASE_VS2008x86xASL_IPF_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb\r
 NOOPT_VS2008x86xASL_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG\r
 \r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2008x86xASL_EBC_*_FAMILY            = INTEL\r
+*_VS2008x86xASL_EBC_*_DLL               = DEF(VS2008x86_DLL)\r
+\r
+*_VS2008x86xASL_EBC_MAKE_PATH           = DEF(VS2008x86_BIN)\nmake.exe\r
+*_VS2008x86xASL_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2008x86xASL_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe\r
+*_VS2008x86xASL_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2008x86xASL_EBC_SLINK_PATH          = DEF(VS2008x86_BIN)\link.exe\r
+*_VS2008x86xASL_EBC_DLINK_PATH          = DEF(VS2008x86_BIN)\link.exe\r
+\r
+*_VS2008x86xASL_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2008x86xASL_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2008x86xASL_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2008x86xASL_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2008x86xASL_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2008x86xASL_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
 \r
 ####################################################################################\r
 #\r
 # Microsoft Visual Studio 2010\r
 #\r
-#   VS2010  - Microsoft Visual Studio 2010 Premium Edition\r
+#   VS2010  - Microsoft Visual Studio 2010 Premium Edition with Intel ASL\r
 #   ASL     - Intel ACPI Source Language Compiler\r
 ####################################################################################\r
 #   VS2010           - Microsoft Visual Studio 2010 Premium Edition\r
@@ -1845,7 +1956,6 @@ NOOPT_VS2010_IA32_DLINK_FLAGS     = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
 *_VS2010_X64_ASLPP_PATH    = DEF(VS2010_BINX64)\cl.exe\r
 *_VS2010_X64_ASLDLINK_PATH = DEF(VS2010_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2010_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2010_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2010_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -1890,13 +2000,14 @@ NOOPT_VS2010_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF
 # EBC definitions\r
 ##################\r
 *_VS2010_EBC_*_FAMILY            = INTEL\r
+*_VS2010_EBC_*_DLL               = DEF(VS2010_DLL)\r
 \r
 *_VS2010_EBC_MAKE_PATH           = DEF(VS2010_BIN)\nmake.exe\r
 *_VS2010_EBC_PP_PATH             = DEF(EBC_BIN)\iec.exe\r
 *_VS2010_EBC_VFRPP_PATH          = DEF(EBC_BIN)\iec.exe\r
 *_VS2010_EBC_CC_PATH             = DEF(EBC_BIN)\iec.exe\r
-*_VS2010_EBC_SLINK_PATH          = DEF(EBC_BIN)\link.exe\r
-*_VS2010_EBC_DLINK_PATH          = DEF(EBC_BIN)\link.exe\r
+*_VS2010_EBC_SLINK_PATH          = DEF(VS2010_BIN)\link.exe\r
+*_VS2010_EBC_DLINK_PATH          = DEF(VS2010_BIN)\link.exe\r
 \r
 *_VS2010_EBC_MAKE_FLAGS          = /nologo\r
 *_VS2010_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
@@ -1905,11 +2016,12 @@ NOOPT_VS2010_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF
 *_VS2010_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
 *_VS2010_EBC_DLINK_FLAGS         = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
 \r
+\r
 ####################################################################################\r
 #\r
 # Microsoft Visual Studio 2010\r
 #\r
-#   VS2010  - Microsoft Visual Studio 2010 Premium Edition\r
+#   VS2010xASL  - Microsoft Visual Studio 2010 Premium Edition with Microsoft ASL\r
 #   ASL     - Microsoft ACPI Source Language Compiler (asl.exe)\r
 ####################################################################################\r
 #   VS2010xASL           - Microsoft Visual Studio 2010 Premium Edition\r
@@ -1982,7 +2094,6 @@ NOOPT_VS2010xASL_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE
 *_VS2010xASL_X64_ASLPP_PATH    = DEF(VS2010_BINX64)\cl.exe\r
 *_VS2010xASL_X64_ASLDLINK_PATH = DEF(VS2010_BINX64)\link.exe\r
 \r
-\r
   DEBUG_VS2010xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
 RELEASE_VS2010xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
 NOOPT_VS2010xASL_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
@@ -2027,13 +2138,14 @@ NOOPT_VS2010xASL_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,
 # EBC definitions\r
 ##################\r
 *_VS2010xASL_EBC_*_FAMILY            = INTEL\r
+*_VS2010xASL_EBC_*_DLL               = DEF(VS2010_DLL)\r
 \r
 *_VS2010xASL_EBC_MAKE_PATH           = DEF(VS2010_BIN)\nmake.exe\r
 *_VS2010xASL_EBC_PP_PATH             = DEF(EBC_BIN)\iec.exe\r
 *_VS2010xASL_EBC_VFRPP_PATH          = DEF(EBC_BIN)\iec.exe\r
 *_VS2010xASL_EBC_CC_PATH             = DEF(EBC_BIN)\iec.exe\r
-*_VS2010xASL_EBC_SLINK_PATH          = DEF(EBC_BIN)\link.exe\r
-*_VS2010xASL_EBC_DLINK_PATH          = DEF(EBC_BIN)\link.exe\r
+*_VS2010xASL_EBC_SLINK_PATH          = DEF(VS2010_BIN)\link.exe\r
+*_VS2010xASL_EBC_DLINK_PATH          = DEF(VS2010_BIN)\link.exe\r
 \r
 *_VS2010xASL_EBC_MAKE_FLAGS          = /nologo\r
 *_VS2010xASL_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
@@ -2130,7 +2242,6 @@ NOOPT_VS2010x86_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi
 RELEASE_VS2010x86_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
 NOOPT_VS2010x86_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
 \r
-\r
 ##################\r
 # IPF definitions\r
 ##################\r
@@ -2159,6 +2270,26 @@ NOOPT_VS2010x86_IPF_ASM_FLAGS      = -N us -X explicit -M ilp64 -N so -W4 -d deb
 RELEASE_VS2010x86_IPF_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb\r
 NOOPT_VS2010x86_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG\r
 \r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2010x86_EBC_*_FAMILY            = INTEL\r
+*_VS2010x86_EBC_*_DLL               = DEF(VS2010x86_DLL)\r
+\r
+*_VS2010x86_EBC_MAKE_PATH           = DEF(VS2010x86_BIN)\nmake.exe\r
+*_VS2010x86_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2010x86_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe\r
+*_VS2010x86_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2010x86_EBC_SLINK_PATH          = DEF(VS2010x86_BIN)\link.exe\r
+*_VS2010x86_EBC_DLINK_PATH          = DEF(VS2010x86_BIN)\link.exe\r
+\r
+*_VS2010x86_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2010x86_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2010x86_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2010x86_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2010x86_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2010x86_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
 \r
 ####################################################################################\r
 #   VS2010x86xASL     - Microsoft Visual Studio 2010 with Microsoft ASL\r
@@ -2274,6 +2405,461 @@ NOOPT_VS2010x86xASL_IPF_ASM_FLAGS      = -N us -X explicit -M ilp64 -N so -W4 -d
 RELEASE_VS2010x86xASL_IPF_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb\r
 NOOPT_VS2010x86xASL_IPF_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG\r
 \r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2010x86xASL_EBC_*_FAMILY            = INTEL\r
+*_VS2010x86xASL_EBC_*_DLL               = DEF(VS2010x86_DLL)\r
+\r
+*_VS2010x86xASL_EBC_MAKE_PATH           = DEF(VS2010x86_BIN)\nmake.exe\r
+*_VS2010x86xASL_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2010x86xASL_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe\r
+*_VS2010x86xASL_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2010x86xASL_EBC_SLINK_PATH          = DEF(VS2010x86_BIN)\link.exe\r
+*_VS2010x86xASL_EBC_DLINK_PATH          = DEF(VS2010x86_BIN)\link.exe\r
+\r
+*_VS2010x86xASL_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2010x86xASL_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2010x86xASL_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2010x86xASL_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2010x86xASL_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2010x86xASL_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
+\r
+####################################################################################\r
+#\r
+# Microsoft Visual Studio 2012\r
+#\r
+#   VS2012  - Microsoft Visual Studio 2012 Professional Edition with Intel ASL\r
+#   ASL     - Intel ACPI Source Language Compiler\r
+####################################################################################\r
+#   VS2012           - Microsoft Visual Studio 2012 Premium Edition\r
+*_VS2012_*_*_FAMILY               = MSFT\r
+\r
+*_VS2012_*_MAKE_PATH              = DEF(VS2012_BIN)\nmake.exe\r
+*_VS2012_*_MAKE_FLAGS             = /nologo\r
+*_VS2012_*_RC_PATH                = DEF(WINSDK_BIN)\rc.exe\r
+\r
+*_VS2012_*_SLINK_FLAGS            = /NOLOGO /LTCG\r
+*_VS2012_*_APP_FLAGS              = /nologo /E /TC\r
+*_VS2012_*_PP_FLAGS               = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012_*_VFRPP_FLAGS            = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+\r
+*_VS2012_*_ASM16_PATH             = DEF(VS2012_BIN)\ml.exe\r
+\r
+##################\r
+# ASL definitions\r
+##################\r
+*_VS2012_*_ASL_PATH               = DEF(DEFAULT_WIN_ASL_BIN)\r
+*_VS2012_*_ASL_FLAGS              = DEF(DEFAULT_WIN_ASL_FLAGS)\r
+*_VS2012_*_ASL_OUTFLAGS           = DEF(DEFAULT_WIN_ASL_OUTFLAGS)\r
+*_VS2012_*_ASLCC_FLAGS            = DEF(MSFT_ASLCC_FLAGS)\r
+*_VS2012_*_ASLPP_FLAGS            = DEF(MSFT_ASLPP_FLAGS)\r
+*_VS2012_*_ASLDLINK_FLAGS         = DEF(MSFT_ASLDLINK_FLAGS)\r
+\r
+##################\r
+# IA32 definitions\r
+##################\r
+*_VS2012_IA32_*_DLL               = DEF(VS2012_DLL)\r
+\r
+*_VS2012_IA32_MAKE_PATH           = DEF(VS2012_BIN)\nmake.exe\r
+*_VS2012_IA32_CC_PATH             = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012_IA32_VFRPP_PATH          = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012_IA32_SLINK_PATH          = DEF(VS2012_BIN)\lib.exe\r
+*_VS2012_IA32_DLINK_PATH          = DEF(VS2012_BIN)\link.exe\r
+*_VS2012_IA32_APP_PATH            = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012_IA32_PP_PATH             = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012_IA32_ASM_PATH            = DEF(VS2012_BIN)\ml.exe\r
+*_VS2012_IA32_ASLCC_PATH          = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012_IA32_ASLPP_PATH          = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012_IA32_ASLDLINK_PATH       = DEF(VS2012_BIN)\link.exe\r
+\r
+      *_VS2012_IA32_MAKE_FLAGS    = /nologo\r
+  DEBUG_VS2012_IA32_CC_FLAGS      = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm\r
+RELEASE_VS2012_IA32_CC_FLAGS      = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012_IA32_CC_FLAGS        = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+RELEASE_VS2012_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd\r
+NOOPT_VS2012_IA32_ASM_FLAGS       = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+\r
+  DEBUG_VS2012_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012_IA32_DLINK_FLAGS     = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# X64 definitions\r
+##################\r
+*_VS2012_X64_*_DLL         = DEF(VS2012_DLL)\r
+\r
+*_VS2012_X64_CC_PATH       = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012_X64_PP_PATH       = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012_X64_APP_PATH      = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012_X64_VFRPP_PATH    = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012_X64_ASM_PATH      = DEF(VS2012_BINX64)\ml64.exe\r
+*_VS2012_X64_SLINK_PATH    = DEF(VS2012_BINX64)\lib.exe\r
+*_VS2012_X64_DLINK_PATH    = DEF(VS2012_BINX64)\link.exe\r
+*_VS2012_X64_ASLCC_PATH    = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012_X64_ASLPP_PATH    = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012_X64_ASLDLINK_PATH = DEF(VS2012_BINX64)\link.exe\r
+\r
+  DEBUG_VS2012_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
+RELEASE_VS2012_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+RELEASE_VS2012_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd\r
+NOOPT_VS2012_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+\r
+  DEBUG_VS2012_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2012_EBC_*_FAMILY            = INTEL\r
+*_VS2012_EBC_*_DLL               = DEF(VS2012_DLL)\r
+\r
+*_VS2012_EBC_MAKE_PATH           = DEF(VS2012_BIN)\nmake.exe\r
+*_VS2012_EBC_PP_PATH             = DEF(EBC_BIN)\iec.exe\r
+*_VS2012_EBC_VFRPP_PATH          = DEF(EBC_BIN)\iec.exe\r
+*_VS2012_EBC_CC_PATH             = DEF(EBC_BIN)\iec.exe\r
+*_VS2012_EBC_SLINK_PATH          = DEF(VS2012_BIN)\link.exe\r
+*_VS2012_EBC_DLINK_PATH          = DEF(VS2012_BIN)\link.exe\r
+\r
+*_VS2012_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2012_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2012_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2012_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2012_EBC_DLINK_FLAGS         = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
+\r
+####################################################################################\r
+#\r
+# Microsoft Visual Studio 2012\r
+#\r
+#   VS2012  - Microsoft Visual Studio 2012 Professional Edition with Microsoft ASL\r
+#   ASL     - Microsoft ACPI Source Language Compiler (asl.exe)\r
+####################################################################################\r
+#   VS2012xASL           - Microsoft Visual Studio 2012 Premium Edition\r
+*_VS2012xASL_*_*_FAMILY        = MSFT\r
+\r
+*_VS2012xASL_*_MAKE_PATH       = DEF(VS2012_BIN)\nmake.exe\r
+*_VS2012xASL_*_MAKE_FLAG       = /nologo\r
+*_VS2012xASL_*_RC_PATH         = DEF(WINSDK_BIN)\rc.exe\r
+\r
+*_VS2012xASL_*_SLINK_FLAGS     = /NOLOGO /LTCG\r
+*_VS2012xASL_*_APP_FLAGS       = /nologo /E /TC\r
+*_VS2012xASL_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012xASL_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+\r
+*_VS2012xASL_*_ASM16_PATH      = DEF(VS2012_BIN)\ml.exe\r
+\r
+##################\r
+# ASL definitions\r
+##################\r
+*_VS2012xASL_*_ASL_PATH        = DEF(WIN_ASL_BIN)\r
+*_VS2012xASL_*_ASL_FLAGS       =\r
+*_VS2012xASL_*_ASL_OUTFLAGS    = DEF(MS_ASL_OUTFLAGS)\r
+*_VS2012xASL_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)\r
+*_VS2012xASL_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)\r
+*_VS2012xASL_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)\r
+\r
+##################\r
+# IA32 definitions\r
+##################\r
+*_VS2012xASL_IA32_*_DLL        = DEF(VS2012_DLL)\r
+\r
+*_VS2012xASL_IA32_MAKE_PATH    = DEF(VS2012_BIN)\nmake.exe\r
+*_VS2012xASL_IA32_CC_PATH      = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012xASL_IA32_VFRPP_PATH   = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012xASL_IA32_SLINK_PATH   = DEF(VS2012_BIN)\lib.exe\r
+*_VS2012xASL_IA32_DLINK_PATH   = DEF(VS2012_BIN)\link.exe\r
+*_VS2012xASL_IA32_APP_PATH     = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012xASL_IA32_PP_PATH      = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012xASL_IA32_ASM_PATH     = DEF(VS2012_BIN)\ml.exe\r
+*_VS2012xASL_IA32_ASLCC_PATH    = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012xASL_IA32_ASLPP_PATH    = DEF(VS2012_BIN)\cl.exe\r
+*_VS2012xASL_IA32_ASLDLINK_PATH = DEF(VS2012_BIN)\link.exe\r
+\r
+      *_VS2012xASL_IA32_MAKE_FLAGS  = /nologo\r
+  DEBUG_VS2012xASL_IA32_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm\r
+RELEASE_VS2012xASL_IA32_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012xASL_IA32_CC_FLAGS      = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012xASL_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+RELEASE_VS2012xASL_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd\r
+NOOPT_VS2012xASL_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+\r
+  DEBUG_VS2012xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012xASL_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# X64 definitions\r
+##################\r
+*_VS2012xASL_X64_*_DLL         = DEF(VS2012_DLL)\r
+\r
+*_VS2012xASL_X64_CC_PATH       = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012xASL_X64_PP_PATH       = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012xASL_X64_APP_PATH      = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012xASL_X64_VFRPP_PATH    = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012xASL_X64_ASM_PATH      = DEF(VS2012_BINX64)\ml64.exe\r
+*_VS2012xASL_X64_SLINK_PATH    = DEF(VS2012_BINX64)\lib.exe\r
+*_VS2012xASL_X64_DLINK_PATH    = DEF(VS2012_BINX64)\link.exe\r
+*_VS2012xASL_X64_ASLCC_PATH    = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012xASL_X64_ASLPP_PATH    = DEF(VS2012_BINX64)\cl.exe\r
+*_VS2012xASL_X64_ASLDLINK_PATH = DEF(VS2012_BINX64)\link.exe\r
+\r
+  DEBUG_VS2012xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
+RELEASE_VS2012xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012xASL_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012xASL_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+RELEASE_VS2012xASL_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd\r
+NOOPT_VS2012xASL_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+\r
+  DEBUG_VS2012xASL_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012xASL_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012xASL_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2012xASL_EBC_*_FAMILY            = INTEL\r
+*_VS2012xASL_EBC_*_DLL               = DEF(VS2012_DLL)\r
+\r
+*_VS2012xASL_EBC_MAKE_PATH           = DEF(VS2012_BIN)\nmake.exe\r
+*_VS2012xASL_EBC_PP_PATH             = DEF(EBC_BIN)\iec.exe\r
+*_VS2012xASL_EBC_VFRPP_PATH          = DEF(EBC_BIN)\iec.exe\r
+*_VS2012xASL_EBC_CC_PATH             = DEF(EBC_BIN)\iec.exe\r
+*_VS2012xASL_EBC_SLINK_PATH          = DEF(VS2012_BIN)\link.exe\r
+*_VS2012xASL_EBC_DLINK_PATH          = DEF(VS2012_BIN)\link.exe\r
+\r
+*_VS2012xASL_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2012xASL_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012xASL_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2012xASL_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2012xASL_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2012xASL_EBC_DLINK_FLAGS         = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
+\r
+####################################################################################\r
+#   VS2012x86       - Microsoft Visual Studio 2012 (x86) professional with Intel ASL\r
+#   ASL  - Intel ACPI Source Language Compiler (iasl.exe)\r
+####################################################################################\r
+#   VS2012x86           - Microsoft Visual Studio 2012 (x86) professional Edition with Intel ASL\r
+*_VS2012x86_*_*_FAMILY        = MSFT\r
+\r
+*_VS2012x86_*_MAKE_PATH       = DEF(VS2012x86_BIN)\nmake.exe\r
+*_VS2012x86_*_MAKE_FLAG       = /nologo\r
+*_VS2012x86_*_RC_PATH         = DEF(WINSDK_BIN)\rc.exe\r
+\r
+*_VS2012x86_*_MAKE_FLAGS      = /nologo\r
+*_VS2012x86_*_SLINK_FLAGS     = /NOLOGO /LTCG\r
+*_VS2012x86_*_APP_FLAGS       = /nologo /E /TC\r
+*_VS2012x86_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012x86_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+\r
+*_VS2012x86_*_ASM16_PATH      = DEF(VS2012x86_BIN)\ml.exe\r
+\r
+##################\r
+# ASL definitions\r
+##################\r
+*_VS2012x86_*_ASL_PATH        = DEF(WIN_IASL_BIN)\r
+*_VS2012x86_*_ASL_FLAGS       = DEF(DEFAULT_WIN_ASL_FLAGS)\r
+*_VS2012x86_*_ASL_OUTFLAGS    = DEF(DEFAULT_WIN_ASL_OUTFLAGS)\r
+*_VS2012x86_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)\r
+*_VS2012x86_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)\r
+*_VS2012x86_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)\r
+\r
+##################\r
+# IA32 definitions\r
+##################\r
+*_VS2012x86_IA32_*_DLL        = DEF(VS2012x86_DLL)\r
+\r
+*_VS2012x86_IA32_MAKE_PATH    = DEF(VS2012x86_BIN)\nmake.exe\r
+*_VS2012x86_IA32_CC_PATH      = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86_IA32_VFRPP_PATH   = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86_IA32_ASLCC_PATH   = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86_IA32_ASLPP_PATH   = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86_IA32_SLINK_PATH   = DEF(VS2012x86_BIN)\lib.exe\r
+*_VS2012x86_IA32_DLINK_PATH   = DEF(VS2012x86_BIN)\link.exe\r
+*_VS2012x86_IA32_ASLDLINK_PATH= DEF(VS2012x86_BIN)\link.exe\r
+*_VS2012x86_IA32_APP_PATH     = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86_IA32_PP_PATH      = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86_IA32_ASM_PATH     = DEF(VS2012x86_BIN)\ml.exe\r
+\r
+      *_VS2012x86_IA32_MAKE_FLAGS  = /nologo\r
+  DEBUG_VS2012x86_IA32_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm\r
+RELEASE_VS2012x86_IA32_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012x86_IA32_CC_FLAGS      = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012x86_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+RELEASE_VS2012x86_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd\r
+NOOPT_VS2012x86_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+\r
+  DEBUG_VS2012x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012x86_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# X64 definitions\r
+##################\r
+*_VS2012x86_X64_*_DLL         = DEF(VS2012x86_DLL)\r
+\r
+*_VS2012x86_X64_CC_PATH       = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86_X64_PP_PATH       = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86_X64_APP_PATH      = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86_X64_VFRPP_PATH    = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86_X64_ASLCC_PATH    = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86_X64_ASLPP_PATH    = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86_X64_ASM_PATH      = DEF(VS2012x86_BINX64)\ml64.exe\r
+*_VS2012x86_X64_SLINK_PATH    = DEF(VS2012x86_BINX64)\lib.exe\r
+*_VS2012x86_X64_DLINK_PATH    = DEF(VS2012x86_BINX64)\link.exe\r
+*_VS2012x86_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe\r
+\r
+  DEBUG_VS2012x86_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
+RELEASE_VS2012x86_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012x86_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012x86_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+RELEASE_VS2012x86_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd\r
+NOOPT_VS2012x86_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi\r
\r
+  DEBUG_VS2012x86_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012x86_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012x86_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2012x86_EBC_*_FAMILY            = INTEL\r
+*_VS2012x86_EBC_*_DLL               = DEF(VS2012x86_DLL)\r
+\r
+*_VS2012x86_EBC_MAKE_PATH           = DEF(VS2012x86_BIN)\nmake.exe\r
+*_VS2012x86_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2012x86_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe\r
+*_VS2012x86_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2012x86_EBC_SLINK_PATH          = DEF(VS2012x86_BIN)\link.exe\r
+*_VS2012x86_EBC_DLINK_PATH          = DEF(VS2012x86_BIN)\link.exe\r
+\r
+*_VS2012x86_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2012x86_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012x86_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2012x86_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2012x86_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2012x86_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
+\r
+####################################################################################\r
+#   VS2012x86xASL     - Microsoft Visual Studio 2012 (x86) professional with Microsoft ASL\r
+#   ASL  - Microsoft ACPI Source Language Compiler (asl.exe)\r
+####################################################################################\r
+*_VS2012x86xASL_*_*_FAMILY        = MSFT\r
+\r
+*_VS2012x86xASL_*_MAKE_PATH       = DEF(VS2012x86_BIN)\nmake.exe\r
+*_VS2012x86xASL_*_MAKE_FLAG       = /nologo\r
+*_VS2012x86xASL_*_RC_PATH         = DEF(WINSDK_BIN)\rc.exe\r
+\r
+*_VS2012x86xASL_*_MAKE_FLAGS      = /nologo\r
+*_VS2012x86xASL_*_SLINK_FLAGS     = /NOLOGO /LTCG\r
+*_VS2012x86xASL_*_APP_FLAGS       = /nologo /E /TC\r
+*_VS2012x86xASL_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012x86xASL_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+\r
+*_VS2012x86xASL_*_ASM16_PATH      = DEF(VS2012x86_BIN)\ml.exe\r
+\r
+##################\r
+# ASL definitions\r
+##################\r
+*_VS2012x86xASL_*_ASL_PATH        = DEF(WIN_ASL_BIN)\r
+*_VS2012x86xASL_*_ASL_FLAGS       = DEF(MS_ASL_FLAGS)\r
+*_VS2012x86xASL_*_ASL_OUTFLAGS    = DEF(MS_ASL_OUTFLAGS)\r
+*_VS2012x86xASL_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)\r
+*_VS2012x86xASL_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)\r
+*_VS2012x86xASL_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)\r
+\r
+##################\r
+# IA32 definitions\r
+##################\r
+*_VS2012x86xASL_IA32_*_DLL        = DEF(VS2012x86_DLL)\r
+\r
+*_VS2012x86xASL_IA32_MAKE_PATH    = DEF(VS2012x86_BIN)\nmake.exe\r
+*_VS2012x86xASL_IA32_CC_PATH      = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86xASL_IA32_VFRPP_PATH   = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86xASL_IA32_ASLCC_PATH   = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86xASL_IA32_ASLPP_PATH   = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86xASL_IA32_SLINK_PATH   = DEF(VS2012x86_BIN)\lib.exe\r
+*_VS2012x86xASL_IA32_DLINK_PATH   = DEF(VS2012x86_BIN)\link.exe\r
+*_VS2012x86xASL_IA32_ASLDLINK_PATH= DEF(VS2012x86_BIN)\link.exe\r
+*_VS2012x86xASL_IA32_APP_PATH     = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86xASL_IA32_PP_PATH      = DEF(VS2012x86_BIN)\cl.exe\r
+*_VS2012x86xASL_IA32_ASM_PATH     = DEF(VS2012x86_BIN)\ml.exe\r
+\r
+      *_VS2012x86xASL_IA32_MAKE_FLAGS  = /nologo\r
+  DEBUG_VS2012x86xASL_IA32_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm\r
+RELEASE_VS2012x86xASL_IA32_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012x86xASL_IA32_CC_FLAGS      = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012x86xASL_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+RELEASE_VS2012x86xASL_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd\r
+NOOPT_VS2012x86xASL_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi\r
+\r
+  DEBUG_VS2012x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012x86xASL_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# X64 definitions\r
+##################\r
+*_VS2012x86xASL_X64_*_DLL         = DEF(VS2012x86_DLL)\r
+\r
+*_VS2012x86xASL_X64_CC_PATH       = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86xASL_X64_PP_PATH       = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86xASL_X64_APP_PATH      = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86xASL_X64_VFRPP_PATH    = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86xASL_X64_ASLCC_PATH    = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86xASL_X64_ASLPP_PATH    = DEF(VS2012x86_BINX64)\cl.exe\r
+*_VS2012x86xASL_X64_ASM_PATH      = DEF(VS2012x86_BINX64)\ml64.exe\r
+*_VS2012x86xASL_X64_SLINK_PATH    = DEF(VS2012x86_BINX64)\lib.exe\r
+*_VS2012x86xASL_X64_DLINK_PATH    = DEF(VS2012x86_BINX64)\link.exe\r
+*_VS2012x86xASL_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe\r
+\r
+  DEBUG_VS2012x86xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm\r
+RELEASE_VS2012x86xASL_X64_CC_FLAGS     = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF\r
+NOOPT_VS2012x86xASL_X64_CC_FLAGS       = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od\r
+\r
+  DEBUG_VS2012x86xASL_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+RELEASE_VS2012x86xASL_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd\r
+NOOPT_VS2012x86xASL_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi\r
+\r
+  DEBUG_VS2012x86xASL_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+RELEASE_VS2012x86xASL_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text\r
+NOOPT_VS2012x86xASL_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG\r
+\r
+##################\r
+# EBC definitions\r
+##################\r
+*_VS2012x86xASL_EBC_*_FAMILY            = INTEL\r
+*_VS2012x86xASL_EBC_*_DLL               = DEF(VS2012x86_DLL)\r
+\r
+*_VS2012x86xASL_EBC_MAKE_PATH           = DEF(VS2012x86_BIN)\nmake.exe\r
+*_VS2012x86xASL_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2012x86xASL_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe\r
+*_VS2012x86xASL_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe\r
+*_VS2012x86xASL_EBC_SLINK_PATH          = DEF(VS2012x86_BIN)\link.exe\r
+*_VS2012x86xASL_EBC_DLINK_PATH          = DEF(VS2012x86_BIN)\link.exe\r
+\r
+*_VS2012x86xASL_EBC_MAKE_FLAGS          = /nologo\r
+*_VS2012x86xASL_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h\r
+*_VS2012x86xASL_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)\r
+*_VS2012x86xASL_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h\r
+*_VS2012x86xASL_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC\r
+*_VS2012x86xASL_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER\r
+\r
 \r
 ####################################################################################\r
 #\r
@@ -2541,9 +3127,11 @@ DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar -fno-strict-aliasing -
 DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe\r
 DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe\r
 DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency\r
-DEFINE GCC_ARMGCC_CC_FLAGS         = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char  -ffunction-sections -fdata-sections -fomit-frame-pointer\r
+DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address\r
+DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address\r
 DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie\r
 DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections\r
+DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)\r
 DEFINE GCC_IA32_X64_DLINK_FLAGS    = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 DEFINE GCC_IPF_DLINK_FLAGS         = -nostdlib -O2 --gc-sections --dll -static --entry $(IMAGE_ENTRY_POINT) --undefined $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
@@ -2555,9 +3143,11 @@ DEFINE GCC_VFRPP_FLAGS             = -x c -E -P -DVFRCOMPILE --include $(DEST_DI
 DEFINE GCC_ASLPP_FLAGS             = -x c -E -P\r
 DEFINE GCC_ASLCC_FLAGS             = -x c\r
 DEFINE GCC_WINDRES_FLAGS           = -J rc -O coff\r
-DEFINE GCC_IA32_RC_FLAGS           = -I binary -O elf32-i386        -B i386 --rename-section .data=.hii\r
-DEFINE GCC_X64_RC_FLAGS            = -I binary -O elf64-x86-64      -B i386 --rename-section .data=.hii\r
-DEFINE GCC_IPF_RC_FLAGS            = -I binary -O elf64-ia64-little -B ia64 --rename-section .data=.hii\r
+DEFINE GCC_IA32_RC_FLAGS           = -I binary -O elf32-i386          -B i386    --rename-section .data=.hii\r
+DEFINE GCC_X64_RC_FLAGS            = -I binary -O elf64-x86-64        -B i386    --rename-section .data=.hii\r
+DEFINE GCC_IPF_RC_FLAGS            = -I binary -O elf64-ia64-little   -B ia64    --rename-section .data=.hii\r
+DEFINE GCC_ARM_RC_FLAGS            = -I binary -O elf32-littlearm     -B arm     --rename-section .data=.hii\r
+DEFINE GCC_AARCH64_RC_FLAGS        = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii\r
 \r
 DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-stack-protector -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings\r
 DEFINE GCC44_IA32_CC_FLAGS           = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -D EFI32\r
@@ -2583,6 +3173,23 @@ DEFINE GCC46_IA32_X64_ASLDLINK_FLAGS = DEF(GCC45_IA32_X64_ASLDLINK_FLAGS)
 DEFINE GCC46_IA32_X64_DLINK_FLAGS    = DEF(GCC45_IA32_X64_DLINK_FLAGS)\r
 DEFINE GCC46_X64_DLINK_FLAGS         = DEF(GCC45_X64_DLINK_FLAGS)\r
 DEFINE GCC46_ASM_FLAGS               = DEF(GCC45_ASM_FLAGS)\r
+DEFINE GCC46_ARM_ASM_FLAGS           = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian\r
+DEFINE GCC46_ARM_CC_FLAGS            = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -mno-unaligned-access -Wno-address -fomit-frame-pointer\r
+DEFINE GCC46_ARM_DLINK_FLAGS         = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm\r
+\r
+DEFINE GCC47_IA32_CC_FLAGS           = DEF(GCC46_IA32_CC_FLAGS)\r
+DEFINE GCC47_X64_CC_FLAGS            = DEF(GCC46_X64_CC_FLAGS)\r
+DEFINE GCC47_IA32_X64_DLINK_COMMON   = DEF(GCC46_IA32_X64_DLINK_COMMON)\r
+DEFINE GCC47_IA32_X64_ASLDLINK_FLAGS = DEF(GCC46_IA32_X64_ASLDLINK_FLAGS)\r
+DEFINE GCC47_IA32_X64_DLINK_FLAGS    = DEF(GCC46_IA32_X64_DLINK_FLAGS)\r
+DEFINE GCC47_X64_DLINK_FLAGS         = DEF(GCC46_X64_DLINK_FLAGS)\r
+DEFINE GCC47_ASM_FLAGS               = DEF(GCC46_ASM_FLAGS)\r
+DEFINE GCC47_ARM_ASM_FLAGS           = DEF(GCC46_ARM_ASM_FLAGS)\r
+DEFINE GCC47_AARCH64_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian\r
+DEFINE GCC47_ARM_CC_FLAGS            = DEF(GCC46_ARM_CC_FLAGS)\r
+DEFINE GCC47_AARCH64_CC_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address\r
+DEFINE GCC47_ARM_DLINK_FLAGS         = DEF(GCC46_ARM_DLINK_FLAGS)\r
+DEFINE GCC47_AARCH64_DLINK_FLAGS     = DEF(GCC_ARM_AARCH64_DLINK_COMMON)\r
 \r
 ####################################################################################\r
 #\r
@@ -2865,6 +3472,150 @@ DEFINE GCC46_ASM_FLAGS               = DEF(GCC45_ASM_FLAGS)
 *_GCC46_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)\r
 *_GCC46_X64_OBJCOPY_FLAGS        = \r
 \r
+##################\r
+# GCC46 ARM definitions\r
+##################\r
+*_GCC46_ARM_OBJCOPY_PATH         = echo\r
+*_GCC46_ARM_CC_PATH              = ENV(GCC46_ARM_PREFIX)gcc\r
+*_GCC46_ARM_SLINK_PATH           = ENV(GCC46_ARM_PREFIX)ar\r
+*_GCC46_ARM_DLINK_PATH           = ENV(GCC46_ARM_PREFIX)ld\r
+*_GCC46_ARM_ASLDLINK_PATH        = ENV(GCC46_ARM_PREFIX)ld\r
+*_GCC46_ARM_ASM_PATH             = ENV(GCC46_ARM_PREFIX)gcc\r
+*_GCC46_ARM_PP_PATH              = ENV(GCC46_ARM_PREFIX)gcc\r
+*_GCC46_ARM_VFRPP_PATH           = ENV(GCC46_ARM_PREFIX)gcc\r
+*_GCC46_ARM_ASLCC_PATH           = ENV(GCC46_ARM_PREFIX)gcc\r
+*_GCC46_ARM_ASLPP_PATH           = ENV(GCC46_ARM_PREFIX)gcc\r
+*_GCC46_ARM_RC_PATH              = ENV(GCC46_ARM_PREFIX)objcopy\r
+\r
+*_GCC46_ARM_ARCHCC_FLAGS         = -mthumb\r
+*_GCC46_ARM_PLATFORM_FLAGS       = -march=armv7-a\r
+\r
+*_GCC46_ARM_ASM_FLAGS            = DEF(GCC46_ARM_ASM_FLAGS)\r
+*_GCC46_ARM_DLINK_FLAGS          = DEF(GCC46_ARM_DLINK_FLAGS)\r
+*_GCC46_ARM_PLATFORM_FLAGS       = -march=armv7-a\r
+*_GCC46_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)\r
+*_GCC46_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)\r
+*_GCC46_ARM_VFRPP_FLAGS          = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)\r
+\r
+  DEBUG_GCC46_ARM_CC_FLAGS       = DEF(GCC46_ARM_CC_FLAGS) -O0\r
+RELEASE_GCC46_ARM_CC_FLAGS       = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-variable\r
+\r
+####################################################################################\r
+#\r
+# GCC 4.7 - This configuration is used to compile under Linux to produce\r
+#           PE/COFF binaries using GCC 4.7.\r
+#\r
+####################################################################################\r
+*_GCC47_*_*_FAMILY               = GCC\r
+\r
+*_GCC47_*_MAKE_PATH                    = make\r
+*_GCC47_*_ASL_PATH                     = DEF(UNIX_IASL_BIN)\r
+\r
+*_GCC47_*_PP_FLAGS                     = DEF(GCC_PP_FLAGS)\r
+*_GCC47_*_ASLPP_FLAGS                  = DEF(GCC_ASLPP_FLAGS)\r
+*_GCC47_*_ASLCC_FLAGS                  = DEF(GCC_ASLCC_FLAGS)\r
+*_GCC47_*_VFRPP_FLAGS                  = DEF(GCC_VFRPP_FLAGS)\r
+*_GCC47_*_APP_FLAGS                    =\r
+*_GCC47_*_ASL_FLAGS                    = DEF(IASL_FLAGS)\r
+*_GCC47_*_ASL_OUTFLAGS                 = DEF(IASL_OUTFLAGS)\r
+\r
+##################\r
+# GCC47 IA32 definitions\r
+##################\r
+*_GCC47_IA32_OBJCOPY_PATH         = DEF(GCC47_IA32_PREFIX)objcopy\r
+*_GCC47_IA32_CC_PATH              = DEF(GCC47_IA32_PREFIX)gcc\r
+*_GCC47_IA32_SLINK_PATH           = DEF(GCC47_IA32_PREFIX)ar\r
+*_GCC47_IA32_DLINK_PATH           = DEF(GCC47_IA32_PREFIX)ld\r
+*_GCC47_IA32_ASLDLINK_PATH        = DEF(GCC47_IA32_PREFIX)ld\r
+*_GCC47_IA32_ASM_PATH             = DEF(GCC47_IA32_PREFIX)gcc\r
+*_GCC47_IA32_PP_PATH              = DEF(GCC47_IA32_PREFIX)gcc\r
+*_GCC47_IA32_VFRPP_PATH           = DEF(GCC47_IA32_PREFIX)gcc\r
+*_GCC47_IA32_ASLCC_PATH           = DEF(GCC47_IA32_PREFIX)gcc\r
+*_GCC47_IA32_ASLPP_PATH           = DEF(GCC47_IA32_PREFIX)gcc\r
+*_GCC47_IA32_RC_PATH              = DEF(GCC47_IA32_PREFIX)objcopy\r
+\r
+*_GCC47_IA32_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m32\r
+*_GCC47_IA32_ASLDLINK_FLAGS       = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS) -m elf_i386\r
+*_GCC47_IA32_ASM_FLAGS            = DEF(GCC47_ASM_FLAGS) -m32 -march=i386\r
+*_GCC47_IA32_CC_FLAGS             = DEF(GCC47_IA32_CC_FLAGS) -Os\r
+*_GCC47_IA32_DLINK_FLAGS          = DEF(GCC47_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386\r
+*_GCC47_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)\r
+*_GCC47_IA32_OBJCOPY_FLAGS        = \r
+\r
+##################\r
+# GCC47 X64 definitions\r
+##################\r
+*_GCC47_X64_OBJCOPY_PATH         = DEF(GCC47_X64_PREFIX)objcopy\r
+*_GCC47_X64_CC_PATH              = DEF(GCC47_X64_PREFIX)gcc\r
+*_GCC47_X64_SLINK_PATH           = DEF(GCC47_X64_PREFIX)ar\r
+*_GCC47_X64_DLINK_PATH           = DEF(GCC47_X64_PREFIX)ld\r
+*_GCC47_X64_ASLDLINK_PATH        = DEF(GCC47_X64_PREFIX)ld\r
+*_GCC47_X64_ASM_PATH             = DEF(GCC47_X64_PREFIX)gcc\r
+*_GCC47_X64_PP_PATH              = DEF(GCC47_X64_PREFIX)gcc\r
+*_GCC47_X64_VFRPP_PATH           = DEF(GCC47_X64_PREFIX)gcc\r
+*_GCC47_X64_ASLCC_PATH           = DEF(GCC47_X64_PREFIX)gcc\r
+*_GCC47_X64_ASLPP_PATH           = DEF(GCC47_X64_PREFIX)gcc\r
+*_GCC47_X64_RC_PATH              = DEF(GCC47_X64_PREFIX)objcopy\r
+\r
+*_GCC47_X64_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m64\r
+*_GCC47_X64_ASLDLINK_FLAGS       = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64\r
+*_GCC47_X64_ASM_FLAGS            = DEF(GCC47_ASM_FLAGS) -m64\r
+*_GCC47_X64_CC_FLAGS             = DEF(GCC47_X64_CC_FLAGS)\r
+*_GCC47_X64_DLINK_FLAGS          = DEF(GCC47_X64_DLINK_FLAGS)\r
+*_GCC47_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)\r
+*_GCC47_X64_OBJCOPY_FLAGS        = \r
+\r
+##################\r
+# GCC47 ARM definitions\r
+##################\r
+*_GCC47_ARM_CC_PATH              = ENV(GCC47_ARM_PREFIX)gcc\r
+*_GCC47_ARM_SLINK_PATH           = ENV(GCC47_ARM_PREFIX)ar\r
+*_GCC47_ARM_DLINK_PATH           = ENV(GCC47_ARM_PREFIX)ld\r
+*_GCC47_ARM_ASLDLINK_PATH        = ENV(GCC47_ARM_PREFIX)ld\r
+*_GCC47_ARM_ASM_PATH             = ENV(GCC47_ARM_PREFIX)gcc\r
+*_GCC47_ARM_PP_PATH              = ENV(GCC47_ARM_PREFIX)gcc\r
+*_GCC47_ARM_VFRPP_PATH           = ENV(GCC47_ARM_PREFIX)gcc\r
+*_GCC47_ARM_ASLCC_PATH           = ENV(GCC47_ARM_PREFIX)gcc\r
+*_GCC47_ARM_ASLPP_PATH           = ENV(GCC47_ARM_PREFIX)gcc\r
+*_GCC47_ARM_RC_PATH              = ENV(GCC47_ARM_PREFIX)objcopy\r
+\r
+*_GCC46_ARM_ARCHCC_FLAGS         = -mthumb\r
+*_GCC46_ARM_PLATFORM_FLAGS       = -march=armv7-a\r
+\r
+*_GCC47_ARM_ASM_FLAGS            = DEF(GCC47_ARM_ASM_FLAGS)\r
+*_GCC47_ARM_DLINK_FLAGS          = DEF(GCC47_ARM_DLINK_FLAGS)\r
+*_GCC47_ARM_PLATFORM_FLAGS       = -march=armv7-a\r
+*_GCC47_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)\r
+*_GCC47_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)\r
+*_GCC47_ARM_VFRPP_FLAGS          = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)\r
+\r
+  DEBUG_GCC47_ARM_CC_FLAGS       = DEF(GCC47_ARM_CC_FLAGS) -O0\r
+RELEASE_GCC47_ARM_CC_FLAGS       = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-variable\r
+\r
+##################\r
+# GCC47 AARCH64 definitions\r
+##################\r
+*_GCC47_AARCH64_CC_PATH          = ENV(GCC47_AARCH64_PREFIX)gcc\r
+*_GCC47_AARCH64_SLINK_PATH       = ENV(GCC47_AARCH64_PREFIX)ar\r
+*_GCC47_AARCH64_DLINK_PATH       = ENV(GCC47_AARCH64_PREFIX)ld\r
+*_GCC47_AARCH64_ASLDLINK_PATH    = ENV(GCC47_AARCH64_PREFIX)ld\r
+*_GCC47_AARCH64_ASM_PATH         = ENV(GCC47_AARCH64_PREFIX)gcc\r
+*_GCC47_AARCH64_PP_PATH          = ENV(GCC47_AARCH64_PREFIX)gcc\r
+*_GCC47_AARCH64_VFRPP_PATH       = ENV(GCC47_AARCH64_PREFIX)gcc\r
+*_GCC47_AARCH64_ASLCC_PATH       = ENV(GCC47_AARCH64_PREFIX)gcc\r
+*_GCC47_AARCH64_ASLPP_PATH       = ENV(GCC47_AARCH64_PREFIX)gcc\r
+*_GCC47_AARCH64_RC_PATH          = ENV(GCC47_AARCH64_PREFIX)objcopy\r
+\r
+*_GCC47_AARCH64_ASM_FLAGS        = DEF(GCC47_AARCH64_ASM_FLAGS)\r
+*_GCC47_AARCH64_DLINK_FLAGS      = DEF(GCC47_AARCH64_DLINK_FLAGS)\r
+*_GCC47_AARCH64_PLATFORM_FLAGS   =\r
+*_GCC47_AARCH64_PP_FLAGS         = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)\r
+*_GCC47_AARCH64_RC_FLAGS         = DEF(GCC_AARCH64_RC_FLAGS)\r
+*_GCC47_AARCH64_VFRPP_FLAGS      = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)\r
+\r
+  DEBUG_GCC47_AARCH64_CC_FLAGS   = DEF(GCC47_AARCH64_CC_FLAGS) -O0\r
+RELEASE_GCC47_AARCH64_CC_FLAGS   = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable\r
+\r
 ####################################################################################\r
 #\r
 # Cygwin GCC And Intel ACPI Compiler\r
@@ -3106,9 +3857,9 @@ DEFINE GCC46_ASM_FLAGS               = DEF(GCC45_ASM_FLAGS)
 *_ELFGCC_IA32_ASM_PATH              = DEF(ELFGCC_BIN)/gcc\r
 *_ELFGCC_IA32_PP_PATH               = DEF(ELFGCC_BIN)/gcc\r
 *_ELFGCC_IA32_VFRPP_PATH            = DEF(ELFGCC_BIN)/gcc\r
-*_ELFGCC32_IA32_ASLCC_PATH          = DEF(ELFGCC_BIN)/gcc\r
-*_ELFGCC32_IA32_ASLPP_PATH          = DEF(ELFGCC_BIN)/gcc\r
-*_ELFGCC32_IA32_ASLDLINK_PATH       = DEF(ELFGCC_BIN)/ld\r
+*_ELFGCC_IA32_ASLCC_PATH            = DEF(ELFGCC_BIN)/gcc\r
+*_ELFGCC_IA32_ASLPP_PATH            = DEF(ELFGCC_BIN)/gcc\r
+*_ELFGCC_IA32_ASLDLINK_PATH         = DEF(ELFGCC_BIN)/ld\r
 *_ELFGCC_IA32_RC_PATH               = DEF(ELFGCC_BIN)/objcopy\r
 \r
 *_ELFGCC_IA32_CC_FLAGS              = -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings\r
@@ -4628,7 +5379,8 @@ RELEASE_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c    -Os
 #\r
 ####################################################################################\r
 \r
-DEFINE RVCT_ALL_CC_FLAGS   = --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167 --diag_style=ide\r
+DEFINE RVCT_ALL_ASM_FLAGS   = --diag_suppress=1786 --diag_error=warning --apcs /interwork\r
+DEFINE RVCT_ALL_CC_FLAGS   = --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_suppress=186 --diag_warning 167 --diag_error=warning --diag_style=ide\r
 DEFINE RVCT_ALL_DLINK_FLAGS   = --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --diag_style=ide\r
 \r
 ####################################################################################\r
@@ -4652,13 +5404,13 @@ DEFINE RVCT_ALL_DLINK_FLAGS   = --ro-base 0 --no_scanlib --reloc --no_exceptions
 RELEASE_RVCT_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map \r
 \r
 \r
-*_RVCT_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) --apcs /interwork\r
+*_RVCT_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)\r
 *_RVCT_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E\r
 *_RVCT_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
 *_RVCT_ARM_MAKE_PATH       = nmake /NOLOGO\r
 *_RVCT_ARM_SLINK_FLAGS     = --partial -o\r
   DEBUG_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g\r
-RELEASE_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O2\r
+RELEASE_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2\r
 \r
 ##################\r
 # ARM definitions\r
@@ -4680,6 +5432,8 @@ RELEASE_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_F
 *_RVCTLINUX_*_*_FAMILY               = RVCT\r
 *_RVCTLINUX_*_*_BUILDRULEFAMILY      = RVCTLINUX\r
 \r
+*_RVCTLINUX_*_MAKE_PATH       = make\r
+\r
 #\r
 # Use default values, or override in DSC file\r
 #\r
@@ -4691,13 +5445,12 @@ RELEASE_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_F
 DEBUG_RVCTLINUX_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map \r
 RELEASE_RVCTLINUX_ARM_DLINK_FLAGS   = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 \r
-*_RVCTLINUX_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) --apcs /interwork\r
+*_RVCTLINUX_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)\r
 *_RVCTLINUX_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E\r
 *_RVCTLINUX_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
-*_RVCTLINUX_ARM_MAKE_PATH       = make\r
 *_RVCTLINUX_ARM_SLINK_FLAGS     = --partial -o\r
   DEBUG_RVCTLINUX_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g\r
-RELEASE_RVCTLINUX_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O2\r
+RELEASE_RVCTLINUX_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2\r
 \r
 ##################\r
 # ARM definitions\r
@@ -4739,13 +5492,13 @@ RELEASE_RVCTLINUX_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL
   DEBUG_RVCTCYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` \r
 RELEASE_RVCTCYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` \r
  \r
-*_RVCTCYGWIN_ARM_ASM_FLAGS       = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) --apcs /interwork\r
+*_RVCTCYGWIN_ARM_ASM_FLAGS       = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)\r
 *_RVCTCYGWIN_ARM_PP_FLAGS        = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E\r
 *_RVCTCYGWIN_ARM_VFRPP_FLAGS     = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`\r
 *_RVCTCYGWIN_ARM_MAKE_PATH       = make\r
 *_RVCTCYGWIN_ARM_SLINK_FLAGS     = "$(SLINKPATH_FLAG)" --partial -o\r
   DEBUG_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g\r
-RELEASE_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O2\r
+RELEASE_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2\r
 \r
 ##################\r
 # ARM definitions\r
@@ -4785,16 +5538,16 @@ RELEASE_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_F
 # ARM definitions\r
 ##################\r
 \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
+*_ARMGCC_ARM_ASLCC_PATH      = ENV(CROSS_COMPILE)gcc\r
+*_ARMGCC_ARM_ASLDLINK_PATH   = ENV(CROSS_COMPILE)ld\r
+*_ARMGCC_ARM_ASLPP_PATH      = ENV(CROSS_COMPILE)gcc\r
 \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
+*_ARMGCC_ARM_CC_PATH         = ENV(CROSS_COMPILE)gcc\r
+*_ARMGCC_ARM_SLINK_PATH      = ENV(CROSS_COMPILE)ar\r
+*_ARMGCC_ARM_DLINK_PATH      = ENV(CROSS_COMPILE)ld\r
+*_ARMGCC_ARM_ASM_PATH        = ENV(CROSS_COMPILE)as\r
+*_ARMGCC_ARM_PP_PATH         = ENV(CROSS_COMPILE)gcc\r
+*_ARMGCC_ARM_VFRPP_PATH      = ENV(CROSS_COMPILE)gcc\r
 \r
 #\r
 # Use default values, or override in DSC file\r
@@ -4813,8 +5566,44 @@ RELEASE_ARMGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-end
 *_ARMGCC_ARM_SLINK_FLAGS =  -rc\r
 *_ARMGCC_ARM_DLINK_FLAGS =  $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 \r
-  DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -O0\r
-RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -Wno-unused\r
+  DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -O0\r
+RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -Wno-unused\r
+\r
+######################\r
+# AArch64 definitions\r
+######################\r
+# AARCH64 64bit ARM Bare-metal GCC (ARM Architecture 64)\r
+\r
+*_ARMGCC_AARCH64_ASLCC_PATH      = ENV(CROSS_COMPILE)gcc\r
+*_ARMGCC_AARCH64_ASLDLINK_PATH   = ENV(CROSS_COMPILE)ld\r
+*_ARMGCC_AARCH64_ASLPP_PATH      = ENV(CROSS_COMPILE)gcc\r
+\r
+*_ARMGCC_AARCH64_CC_PATH         = ENV(CROSS_COMPILE)gcc\r
+*_ARMGCC_AARCH64_SLINK_PATH      = ENV(CROSS_COMPILE)ar\r
+*_ARMGCC_AARCH64_DLINK_PATH      = ENV(CROSS_COMPILE)ld\r
+*_ARMGCC_AARCH64_ASM_PATH        = ENV(CROSS_COMPILE)as\r
+*_ARMGCC_AARCH64_PP_PATH         = ENV(CROSS_COMPILE)gcc\r
+*_ARMGCC_AARCH64_VFRPP_PATH      = ENV(CROSS_COMPILE)gcc\r
+\r
+#\r
+# Use default values, or override in DSC file\r
+#\r
+*_ARMGCC_AARCH64_ARCHCC_FLAGS    =\r
+*_ARMGCC_AARCH64_ARCHASM_FLAGS   =\r
+*_ARMGCC_AARCH64_ARCHDLINK_FLAGS =\r
+*_ARMGCC_AARCH64_PLATFORM_FLAGS  =\r
+\r
+  DEBUG_ARMGCC_AARCH64_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -g\r
+RELEASE_ARMGCC_AARCH64_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS)\r
+\r
+*_ARMGCC_AARCH64_PP_FLAGS    = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h\r
+*_ARMGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
+\r
+*_ARMGCC_AARCH64_SLINK_FLAGS =  -rc\r
+*_ARMGCC_AARCH64_DLINK_FLAGS =  $(ARCHDLINK_FLAGS) -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+\r
+  DEBUG_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0\r
+RELEASE_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable\r
 \r
 ####################################################################################\r
 #\r
@@ -4871,8 +5660,44 @@ RELEASE_ARMLINUXGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittl
 *_ARMLINUXGCC_ARM_SLINK_FLAGS =  -rc\r
 *_ARMLINUXGCC_ARM_DLINK_FLAGS =  $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 \r
-  DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -O0\r
-RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable\r
+  DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -mno-unaligned-access -O0\r
+RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector  -mno-unaligned-access -Wno-unused-but-set-variable\r
+\r
+######################\r
+# AArch64 definitions\r
+######################\r
+# AARCH64 64bit ARM GNU/Linux GCC (ARM Architecture 64)\r
+\r
+*_ARMLINUXGCC_AARCH64_ASLCC_PATH      = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc\r
+*_ARMLINUXGCC_AARCH64_ASLDLINK_PATH   = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-ld\r
+*_ARMLINUXGCC_AARCH64_ASLPP_PATH      = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc\r
+\r
+*_ARMLINUXGCC_AARCH64_CC_PATH         = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc\r
+*_ARMLINUXGCC_AARCH64_SLINK_PATH      = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-ar\r
+*_ARMLINUXGCC_AARCH64_DLINK_PATH      = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-ld\r
+*_ARMLINUXGCC_AARCH64_ASM_PATH        = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-as\r
+*_ARMLINUXGCC_AARCH64_PP_PATH         = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc\r
+*_ARMLINUXGCC_AARCH64_VFRPP_PATH      = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc\r
+\r
+#\r
+# Use default values, or override in DSC file\r
+#\r
+*_ARMLINUXGCC_AARCH64_ARCHCC_FLAGS    =\r
+*_ARMLINUXGCC_AARCH64_ARCHASM_FLAGS   =\r
+*_ARMLINUXGCC_AARCH64_ARCHDLINK_FLAGS =\r
+*_ARMLINUXGCC_AARCH64_PLATFORM_FLAGS  =\r
+\r
+  DEBUG_ARMLINUXGCC_AARCH64_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -g\r
+RELEASE_ARMLINUXGCC_AARCH64_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS)\r
+\r
+*_ARMLINUXGCC_AARCH64_PP_FLAGS    = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h\r
+*_ARMLINUXGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
+\r
+*_ARMLINUXGCC_AARCH64_SLINK_FLAGS =  -rc\r
+*_ARMLINUXGCC_AARCH64_DLINK_FLAGS =  $(ARCHDLINK_FLAGS) -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+\r
+  DEBUG_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0\r
+RELEASE_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable\r
 \r
 #################\r
 # ASM 16 linker defintions\r
diff --git a/BaseTools/Contributions.txt b/BaseTools/Contributions.txt
new file mode 100644 (file)
index 0000000..667ca10
--- /dev/null
@@ -0,0 +1,188 @@
+\r
+======================\r
+= Code Contributions =\r
+======================\r
+\r
+To make a contribution to a TianoCore project, follow these steps.\r
+1. Create a change description in the format specified below to\r
+   use in the source control commit log.\r
+2. Your commit message must include your "Signed-off-by" signature,\r
+   and "Contributed-under" message.\r
+3. Your "Contributed-under" message explicitly states that the\r
+   contribution is made under the terms of the specified\r
+   contribution agreement.  Your "Contributed-under" message\r
+   must include the name of contribution agreement and version.\r
+   For example: Contributed-under: TianoCore Contribution Agreement 1.0\r
+   The "TianoCore Contribution Agreement" is included below in\r
+   this document.\r
+4. Submit your code to the TianoCore project using the process\r
+   that the project documents on its web page.  If the process is\r
+   not documented, then submit the code on development email list\r
+   for the project.\r
+\r
+=======================================\r
+= Change Description / Commit Message =\r
+=======================================\r
+\r
+Your change description should use the standard format for a\r
+commit message, and must include your "Signed-off-by" signature\r
+and the "Contributed-under" message.\r
+\r
+== Sample Change Description / Commit Message =\r
+\r
+=== Definitions for sample change description ===\r
+\r
+* "CodeModule" is a short idenfier for the affected code.  For\r
+  example MdePkg, or MdeModulePkg UsbBusDxe.\r
+* "Brief-single-line-summary" is a short summary of the change.\r
+* The entire first line should be less than ~70 characters.\r
+* "Full-commit-message" a verbose multiple line comment describing\r
+  the change.  Each line should be less than ~70 characters.\r
+* "Contributed-under" explicitely states that the contribution is\r
+  made under the terms of the contribtion agreement.  This\r
+  agreement is included below in this document.\r
+* "Signed-off-by" is the contributor's signature identifying them\r
+  by their real/legal name and their email address.\r
+\r
+=== Start of sample change description / commit message ===\r
+CodeModule: Brief-single-line-summary\r
+\r
+Full-commit-message\r
+\r
+Contributed-under: TianoCore Contribution Agreement 1.0\r
+Signed-off-by: Contributor Name <contributor@email.server>\r
+=== End of sample change description / commit message ===\r
+\r
+========================================\r
+= TianoCore Contribution Agreement 1.0 =\r
+========================================\r
+\r
+INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION,\r
+INFORMATION AND/OR OTHER MATERIALS FOR USE IN THE TIANOCORE OPEN SOURCE\r
+PROJECT (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE\r
+TERMS AND CONDITIONS OF THIS AGREEMENT BETWEEN YOU AND INTEL AND/OR THE\r
+TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR\r
+REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE\r
+CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS\r
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\r
+BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS\r
+AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE\r
+AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT\r
+USE THE CONTENT.\r
+\r
+Unless otherwise indicated, all Content made available on the TianoCore\r
+site is provided to you under the terms and conditions of the BSD\r
+License ("BSD"). A copy of the BSD License is available at\r
+http://opensource.org/licenses/bsd-license.php\r
+or when applicable, in the associated License.txt file.\r
+\r
+Certain other content may be made available under other licenses as\r
+indicated in or with such Content. (For example, in a License.txt file.)\r
+\r
+You accept and agree to the following terms and conditions for Your\r
+present and future Contributions submitted to TianoCore site. Except\r
+for the license granted to Intel hereunder, You reserve all right,\r
+title, and interest in and to Your Contributions.\r
+\r
+== SECTION 1: Definitions ==\r
+* "You" or "Contributor" shall mean the copyright owner or legal\r
+  entity authorized by the copyright owner that is making a\r
+  Contribution hereunder. All other entities that control, are\r
+  controlled by, or are under common control with that entity are\r
+  considered to be a single Contributor. For the purposes of this\r
+  definition, "control" means (i) the power, direct or indirect, to\r
+  cause the direction or management of such entity, whether by\r
+  contract or otherwise, or (ii) ownership of fifty percent (50%)\r
+  or more of the outstanding shares, or (iii) beneficial ownership\r
+  of such entity.\r
+* "Contribution" shall mean any original work of authorship,\r
+  including any modifications or additions to an existing work,\r
+  that is intentionally submitted by You to the TinaoCore site for\r
+  inclusion in, or documentation of, any of the Content. For the\r
+  purposes of this definition, "submitted" means any form of\r
+  electronic, verbal, or written communication sent to the\r
+  TianoCore site or its representatives, including but not limited\r
+  to communication on electronic mailing lists, source code\r
+  control systems, and issue tracking systems that are managed by,\r
+  or on behalf of, the TianoCore site for the purpose of\r
+  discussing and improving the Content, but excluding\r
+  communication that is conspicuously marked or otherwise\r
+  designated in writing by You as "Not a Contribution."\r
+\r
+== SECTION 2: License for Contributions ==\r
+* Contributor hereby agrees that redistribution and use of the\r
+  Contribution in source and binary forms, with or without\r
+  modification, are permitted provided that the following\r
+  conditions are met:\r
+** Redistributions of source code must retain the Contributor's\r
+   copyright notice, this list of conditions and the following\r
+   disclaimer.\r
+** Redistributions in binary form must reproduce the Contributor's\r
+   copyright notice, this list of conditions and the following\r
+   disclaimer in the documentation and/or other materials provided\r
+   with the distribution.\r
+* Disclaimer. None of the names of Contributor, Intel, or the names\r
+  of their respective contributors may be used to endorse or\r
+  promote products derived from this software without specific\r
+  prior written permission.\r
+* Contributor grants a license (with the right to sublicense) under\r
+  claims of Contributor's patents that Contributor can license that\r
+  are infringed by the Contribution (as delivered by Contributor) to\r
+  make, use, distribute, sell, offer for sale, and import the\r
+  Contribution and derivative works thereof solely to the minimum\r
+  extent necessary for licensee to exercise the granted copyright\r
+  license; this patent license applies solely to those portions of\r
+  the Contribution that are unmodified. No hardware per se is\r
+  licensed.\r
+* EXCEPT AS EXPRESSLY SET FORTH IN SECTION 3 BELOW, THE\r
+  CONTRIBUTION IS PROVIDED BY THE CONTRIBUTOR "AS IS" AND ANY\r
+  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
+  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r
+  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r
+  CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\r
+  CONTRIBUTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\r
+  DAMAGE.\r
+\r
+== SECTION 3: Representations ==\r
+* You represent that You are legally entitled to grant the above\r
+  license. If your employer(s) has rights to intellectual property\r
+  that You create that includes Your Contributions, You represent\r
+  that You have received permission to make Contributions on behalf\r
+  of that employer, that Your employer has waived such rights for\r
+  Your Contributions.\r
+* You represent that each of Your Contributions is Your original\r
+  creation (see Section 4 for submissions on behalf of others).\r
+  You represent that Your Contribution submissions include complete\r
+  details of any third-party license or other restriction\r
+  (including, but not limited to, related patents and trademarks)\r
+  of which You are personally aware and which are associated with\r
+  any part of Your Contributions.\r
+\r
+== SECTION 4: Third Party Contributions ==\r
+* Should You wish to submit work that is not Your original creation,\r
+  You may submit it to TianoCore site separately from any\r
+  Contribution, identifying the complete details of its source\r
+  and of any license or other restriction (including, but not\r
+  limited to, related patents, trademarks, and license agreements)\r
+  of which You are personally aware, and conspicuously marking the\r
+  work as "Submitted on behalf of a third-party: [named here]".\r
+\r
+== SECTION 5: Miscellaneous ==\r
+* Applicable Laws. Any claims arising under or relating to this\r
+  Agreement shall be governed by the internal substantive laws of\r
+  the State of Delaware or federal courts located in Delaware,\r
+  without regard to principles of conflict of laws.\r
+* Language. This Agreement is in the English language only, which\r
+  language shall be controlling in all respects, and all versions\r
+  of this Agreement in any other language shall be for accommodation\r
+  only and shall not be binding. All communications and notices made\r
+  or given pursuant to this Agreement, and all documentation and\r
+  support to be provided, unless otherwise noted, shall be in the\r
+  English language.\r
+\r
index a3fa905c907420892e557ccd776b6a444657e78e..790d33a2f3749cf7b32afba5c0d353281feda401 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for Base Tools project build.\r
+# GNU/Linux makefile for Base Tools project build.\r
 #\r
 # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
diff --git a/BaseTools/License.txt b/BaseTools/License.txt
new file mode 100644 (file)
index 0000000..160be01
--- /dev/null
@@ -0,0 +1,25 @@
+Copyright (c) 2013, Intel Corporation. All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions\r
+are met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in\r
+  the documentation and/or other materials provided with the\r
+  distribution.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\r
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGE.\r
index beda3a81a61ce8d8977e21a94b14289fcf21efbb..858b124db8769701d655a075677b622ecab26fef 100644 (file)
@@ -33,7 +33,7 @@ the base directory of the project.
 On Ubuntu, the following command should install all the necessary build\r
 packages to build all the C BaseTools:\r
 \r
-  sudo apt-get install build-essentials uuid-dev\r
+  sudo apt-get install build-essential uuid-dev\r
 \r
 === Python sqlite3 module ===\r
 On Windows, the cx_freeze will not copy the sqlite3.dll to the frozen \r
@@ -43,10 +43,4 @@ Please copy it manually from <PythonHome>\DLLs.
 The Python distributed with most recent Linux will have sqlite3 module\r
 built in. If not, please install sqlit3 package separately.\r
 \r
-2. The binary tools will be updated only after passing developer testing.\r
-\r
-Current state of the tools is Proto-Type - not all tool functions have been implemented\r
-and there may be bugs in these tools.  These tools are under constant development at\r
-this time.\r
-\r
 26-OCT-2011\r
index d71dd9ca82ff840a040eed150508ea20fff02f63..68b2767590aca075a354bd088f5c3967a51f6aa3 100644 (file)
@@ -18,6 +18,10 @@ SECTIONS
     )\r
     . = ALIGN(0x20);\r
   }\r
+  .eh_frame ALIGN(0x20) :\r
+  {\r
+    KEEP (*(.eh_frame))\r
+  }\r
   .got ALIGN(0x20) :\r
   {\r
     *(.got .got.*)\r
index 7703928dfc5581c77374e745873698392fbf860e..5f7cb98461a3e4c58203785c44da41d7bf3f08fc 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'BootSectImage' module build.\r
+# GNU/Linux makefile for 'BootSectImage' module build.\r
 #\r
 # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 816f309f66a7041462fded0b1ba444abd6177263..afb45df40b8486ec2383780cd88fb6753be1262e 100644 (file)
@@ -3,6 +3,7 @@
   Functions to get info and load PE/COFF image.\r
 \r
 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Portions Copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -79,6 +80,14 @@ PeCoffLoaderRelocateArmImage (
   IN UINT64      Adjust\r
   );\r
 \r
+RETURN_STATUS\r
+PeCoffLoaderRelocateAArch64Image (\r
+  IN UINT16      *Reloc,\r
+  IN OUT CHAR8   *Fixup,\r
+  IN OUT CHAR8   **FixupData,\r
+  IN UINT64      Adjust\r
+  );\r
+\r
 STATIC\r
 RETURN_STATUS\r
 PeCoffLoaderGetPeHeader (\r
@@ -194,7 +203,8 @@ Returns:
       ImageContext->Machine != EFI_IMAGE_MACHINE_IA64 && \\r
       ImageContext->Machine != EFI_IMAGE_MACHINE_X64  && \\r
       ImageContext->Machine != EFI_IMAGE_MACHINE_ARMT && \\r
-      ImageContext->Machine != EFI_IMAGE_MACHINE_EBC) {\r
+      ImageContext->Machine != EFI_IMAGE_MACHINE_EBC  && \\r
+      ImageContext->Machine != EFI_IMAGE_MACHINE_AARCH64) {\r
     if (ImageContext->Machine == IMAGE_FILE_MACHINE_ARM) {\r
       //\r
       // There are two types of ARM images. Pure ARM and ARM/Thumb. \r
@@ -791,6 +801,9 @@ Returns:
         case EFI_IMAGE_MACHINE_IA64:\r
           Status = PeCoffLoaderRelocateIpfImage (Reloc, Fixup, &FixupData, Adjust);\r
           break;\r
+        case EFI_IMAGE_MACHINE_AARCH64:\r
+          Status = PeCoffLoaderRelocateAArch64Image (Reloc, Fixup, &FixupData, Adjust);\r
+          break;\r
         default:\r
           Status = RETURN_UNSUPPORTED;\r
           break;\r
index 1aade7f7b8f3f2cb8068c84439ba725170b228d3..a19355781749a24ee58247a9ae0812cb8f8749de 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'Common' module build.\r
+# GNU/Linux makefile for 'Common' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 2afd441845c4f45d1af191db7f3b3d9096f83c56..8d6b3961f5272243de53cfdc053ef0b566ce2102 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Portions Copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -15,7 +16,7 @@ Module Name:
 \r
 Abstract:\r
 \r
-    IA32, X64 and IPF Specific relocation fixups\r
+    IA32, X64, IPF, ARM and AArch64 Specific relocation fixups\r
 \r
 Revision History\r
 \r
@@ -25,6 +26,7 @@ Revision History
 #include <IndustryStandard/PeImage.h>\r
 #include "PeCoffLib.h"\r
 #include "CommonLib.h"\r
+#include "EfiUtilityMsgs.h"\r
 \r
 \r
 #define EXT_IMM64(Value, Address, Size, InstPos, ValPos)  \\r
@@ -472,3 +474,43 @@ PeCoffLoaderRelocateArmImage (
 \r
   return RETURN_SUCCESS;\r
 }\r
+\r
+RETURN_STATUS\r
+PeCoffLoaderRelocateAArch64Image (\r
+  IN     UINT16       *Reloc,\r
+  IN OUT CHAR8        *Fixup,\r
+  IN OUT CHAR8        **FixupData,\r
+  IN     UINT64       Adjust\r
+  )\r
+/**\r
+  Performs an AArch64 specific relocation fixup\r
+\r
+  @param Reloc        Pointer to the relocation record\r
+  @param Fixup        Pointer to the address to fix up\r
+  @param FixupData    Pointer to a buffer to log the fixups\r
+  @param Adjust       The offset to adjust the fixup\r
+\r
+  @retval RETURN_SUCCESS      Success to perform relocation\r
+  @retval RETURN_UNSUPPORTED  Unsupported.\r
+**/\r
+{\r
+  UINT64      *F64;\r
+\r
+  switch ((*Reloc) >> 12) {\r
+\r
+    case EFI_IMAGE_REL_BASED_DIR64:\r
+      F64 = (UINT64 *) Fixup;\r
+      *F64 = *F64 + (UINT64) Adjust;\r
+      if (*FixupData != NULL) {\r
+        *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
+        *(UINT64 *)(*FixupData) = *F64;\r
+        *FixupData = *FixupData + sizeof(UINT64);\r
+      }\r
+      break;\r
+\r
+    default:\r
+      return RETURN_UNSUPPORTED;\r
+  }\r
+\r
+  return RETURN_SUCCESS;\r
+}\r
index e33b97866c173822fd837216e6a67655c1f8d361..99f786f370bd0fa1d599599b25a01f726ea4d65b 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'EfiLdrImage' module build.\r
+# GNU/Linux makefile for 'EfiLdrImage' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index eb76913713dccbfa16581b3b6d7fef182a8ef09c..433c126cf21e696e7747e596098b1d96c1ed0bed 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'EfiRom' module build.\r
+# GNU/Linux makefile for 'EfiRom' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index e0dde3e08507c1109ce0e8a1f8e5db6a24c8c1de..ae07509496b6e9209e3c2dd710e3f8b56302b1c6 100644 (file)
@@ -1,5 +1,5 @@
 ## @file
-#  GNU Make makefile for C tools build.
+#  GNU/Linux makefile for C tools build.
 #
 #  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
 #
index 169d81e031d695c893c68921b9251ad0e7bd55e3..f102ee139af4d1004ecedb479c375e93d061dd35 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, 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
@@ -542,8 +542,7 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("%s v%d.%d %s -Utility to retrieve and update the boot sector or MBR.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 2009 - 2010 Intel Corporation. All rights reserved.\n");\r
+  printf ("%s Version %d.%d Build%s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
 }\r
 \r
 VOID\r
@@ -551,18 +550,27 @@ PrintUsage (
   void\r
   )\r
 {\r
-  Version();\r
-  printf ("\nUsage: \n\\r
-   GenBootSector\n\\r
-     [-l, --list list disks]\n\\r
-     [-i, --input Filename]\n\\r
-     [-o, --output Filename]\n\\r
-     [-m, --mbr process the MBR also]\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
+  printf ("Usage: GenBootSector [options] --cfg-file CFG_FILE\n\n\\r
+Copyright (c) 2009 - 2013, Intel Corporation.  All rights reserved.\n\n\\r
+  Utility to retrieve and update the boot sector or MBR.\n\n\\r
+optional arguments:\n\\r
+  -h, --help            Show this help message and exit\n\\r
+  --version             Show program's version number and exit\n\\r
+  -d [DEBUG], --debug [DEBUG]\n\\r
+                        Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\\r
+                        - 9 (max)\n\\r
+  -v, --verbose         Print informational statements\n\\r
+  -q, --quiet           Returns the exit code, error messages will be\n\\r
+                        displayed\n\\r
+  -s, --silent          Returns only the exit code; informational and error\n\\r
+                        messages are not displayed\n\\r
+  -l, --list            List disk drives\n\\r
+  -i INPUT_FILENAME, --input INPUT_FILENAME\n\\r
+                        Input file name\n\\r
+  -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\\r
+                        Output file name\n\\r
+  -m, --mbr             Also process the MBR\n\\r
+  --sfo                 Reserved for future use\n");\r
 \r
 }\r
 \r
index 4f055c9b4eef36926d9bf9cbb68633b482e38cd8..15b4dad4b54c9083c14b0d7af918bf21d656404a 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenCrc32' module build.\r
+# GNU/Linux makefile for 'GenCrc32' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 681fe4f1e67a375848ebc23bad7de5d677803da0..8ece9a841268cd3bc18ee71504d45332b47940f1 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, 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
@@ -55,7 +55,7 @@ Returns:
 \r
 --*/\r
 {\r
-  fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
+  fprintf (stdout, "%s Version %d.%d Build %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
 }\r
 \r
 VOID\r
@@ -81,26 +81,32 @@ Returns:
   //\r
   // Summary usage\r
   //\r
-  fprintf (stdout, "\nUsage: %s -e|-d [options] <input_file>\n\n", UTILITY_NAME);\r
+  fprintf (stdout, "Usage: GenCrc32 -e|-d [options] <input_file>\n\n");\r
   \r
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
   //\r
-  fprintf (stdout, "Options:\n");\r
-  fprintf (stdout, "  -o FileName, --output FileName\n\\r
-                        File will be created to store the ouput content.\n");\r
-  fprintf (stdout, "  -e, --encode          Calculate CRC32 value for the input file.\n");\r
-  fprintf (stdout, "  -d, --decode          Verify CRC32 value for the input file.\n");\r
-  fprintf (stdout, "  -v, --verbose         Turn on verbose output with informational messages.\n");\r
-  fprintf (stdout, "  -q, --quiet           Disable all messages except key message and fatal error\n");\r
-  fprintf (stdout, "  --debug level         Enable debug messages, at input debug level.\n");\r
-  fprintf (stdout, "  --version             Show program's version number and exit.\n");\r
-  fprintf (stdout, "  -h, --help            Show this help message and exit.\n"); \r
+  fprintf (stdout, "optional arguments:\n");\r
+  fprintf (stdout, "  -h, --help            Show this help message and exit\n");\r
+  fprintf (stdout, "  --version             Show program's version number and exit\n");\r
+  fprintf (stdout, "  --debug [DEBUG]       Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\\r
+                        - 9 (max)\n");\r
+  fprintf (stdout, "  -v, --verbose         Print informational statements\n");\r
+  fprintf (stdout, "  -q, --quiet           Returns the exit code, error messages will be\n\\r
+                        displayed\n");\r
+  fprintf (stdout, "  -s, --silent          Returns only the exit code; informational and error\n\\r
+                        messages are not displayed\n");\r
+  fprintf (stdout, "  -e, --encode          Calculate CRC32 value for the input file\n");\r
+  fprintf (stdout, "  -d, --decode          Verify CRC32 value for the input file\n");\r
+  fprintf (stdout, "  -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\\r
+                        Output file name\n");\r
+  fprintf (stdout, "  --sfo                 Reserved for future use\n");\r
+  \r
 }\r
 \r
 int\r
@@ -164,7 +170,6 @@ Returns:
   argv ++;\r
 \r
   if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {\r
-    Version ();\r
     Usage ();\r
     return STATUS_SUCCESS;    \r
   }\r
index 2dc4159744365de816f0e3951b1d5bb8303fba49..04f5bb83f98c44b0d790b855e111ae5dc12741e5 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenFfs' module build.\r
+# GNU/Linux makefile for 'GenFfs' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 6ecf4bcca6de90b26737df765d52e441c4a57b2a..58ad16ce61d0f08ec6a5b8af5830d8f0a11a9a2b 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenFv' module build.\r
+# GNU/Linux makefile for 'GenFv' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index c01e504cbed99323738fbce6d105fe8818363786..dd0e9ec3be6ae53dedc4ac863da387d686898a31 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
 \r
 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Portions Copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -1580,6 +1581,11 @@ Returns:
     // Since the ARM reset vector is in the FV Header you really don't need a\r
     // Volume Top File, but if you have one for some reason don't crash...\r
     //\r
+  } else if (MachineType == EFI_IMAGE_MACHINE_AARCH64) {\r
+    //\r
+    // Since the AArch64 reset vector is in the FV Header you really don't need a\r
+    // Volume Top File, but if you have one for some reason don't crash...\r
+    //\r
   } else {\r
     Error (NULL, 0, 3000, "Invalid", "machine type=0x%X in PEI core.", MachineType);\r
     return EFI_ABORTED;\r
@@ -1617,9 +1623,11 @@ Routine Description:
   This parses the FV looking for SEC and patches that address into the \r
   beginning of the FV header.\r
 \r
-  For ARM the reset vector is at 0x00000000 or 0xFFFF0000.\r
+  For ARM32 the reset vector is at 0x00000000 or 0xFFFF0000.\r
+  For AArch64 the reset vector is at 0x00000000.\r
+\r
   This would commonly map to the first entry in the ROM. \r
-  ARM Exceptions:\r
+  ARM32 Exceptions:\r
   Reset            +0    \r
   Undefined        +4\r
   SWI              +8\r
@@ -1633,11 +1641,10 @@ Routine Description:
   2) Reset vector is data bytes FDF file and that code branches to reset vector \r
     in the beginning of the FV (fixed size offset).\r
 \r
-\r
   Need to have the jump for the reset vector at location zero.\r
   We also need to store the address or PEI (if it exists).\r
   We stub out a return from interrupt in case the debugger \r
-   is using SWI.\r
+   is using SWI (not done for AArch64, not enough space in struct).\r
   The optional entry to the common exception handler is \r
    to support full featured exception handling from ROM and is currently \r
     not support by this tool.\r
@@ -1664,10 +1671,14 @@ Returns:
   UINT16                    MachineType;\r
   EFI_PHYSICAL_ADDRESS      PeiCorePhysicalAddress;\r
   EFI_PHYSICAL_ADDRESS      SecCorePhysicalAddress;\r
-  INT32                     ResetVector[4]; // 0 - is branch relative to SEC entry point\r
+  INT32                     ResetVector[4]; // ARM32:\r
+                                            // 0 - is branch relative to SEC entry point\r
                                             // 1 - PEI Entry Point\r
                                             // 2 - movs pc,lr for a SWI handler\r
                                             // 3 - Place holder for Common Exception Handler\r
+                                            // AArch64: Used as UINT64 ResetVector[2]\r
+                                            // 0 - is branch relative to SEC entry point\r
+                                            // 1 - PEI Entry Point\r
 \r
   //\r
   // Verify input parameters\r
@@ -1727,7 +1738,7 @@ Returns:
       PeiCorePhysicalAddress += EntryPoint;\r
       DebugMsg (NULL, 0, 9, "PeiCore physical entry point address", "Address = 0x%llX", (unsigned long long) PeiCorePhysicalAddress);\r
 \r
-      if (MachineType == EFI_IMAGE_MACHINE_ARMT) {\r
+      if (MachineType == EFI_IMAGE_MACHINE_ARMT || MachineType == EFI_IMAGE_MACHINE_AARCH64) {\r
         memset (ResetVector, 0, sizeof (ResetVector));\r
         // Address of PEI Core, if we have one\r
         ResetVector[1] = (UINT32)PeiCorePhysicalAddress;\r
@@ -1767,7 +1778,7 @@ Returns:
     return EFI_ABORTED;\r
   }\r
   \r
-  if (MachineType != EFI_IMAGE_MACHINE_ARMT) {\r
+  if ((MachineType != EFI_IMAGE_MACHINE_ARMT) && (MachineType != EFI_IMAGE_MACHINE_AARCH64)) {\r
     //\r
     // If SEC is not ARM we have nothing to do\r
     //\r
@@ -1821,31 +1832,60 @@ Returns:
     DebugMsg (NULL, 0, 9, "PeiCore physical entry point address", "Address = 0x%llX", (unsigned long long) PeiCorePhysicalAddress);\r
   }\r
   \r
+  if (MachineType == EFI_IMAGE_MACHINE_ARMT) {\r
+    // B SecEntryPoint - signed_immed_24 part +/-32MB offset\r
+    // on ARM, the PC is always 8 ahead, so we're not really jumping from the base address, but from base address + 8\r
+    ResetVector[0] = (INT32)(SecCorePhysicalAddress - FvInfo->BaseAddress - 8) >> 2;\r
+\r
+    if (ResetVector[0] > 0x00FFFFFF) {\r
+      Error (NULL, 0, 3000, "Invalid", "SEC Entry point must be within 32MB of the start of the FV");\r
+      return EFI_ABORTED;\r
+    }\r
   \r
-  // B SecEntryPoint - signed_immed_24 part +/-32MB offset\r
-  // on ARM, the PC is always 8 ahead, so we're not really jumping from the base address, but from base address + 8\r
-  ResetVector[0] = (INT32)(SecCorePhysicalAddress - FvInfo->BaseAddress - 8) >> 2;\r
-  \r
-  if (ResetVector[0] > 0x00FFFFFF) {\r
-    Error (NULL, 0, 3000, "Invalid", "SEC Entry point must be within 32MB of the start of the FV");\r
-    return EFI_ABORTED;    \r
-  }\r
-  \r
-  // Add opcode for an uncondional branch with no link. AKA B SecEntryPoint\r
-  ResetVector[0] |= 0xEB000000;\r
+    // Add opcode for an uncondional branch with no link. AKA B SecEntryPoint\r
+    ResetVector[0] |= 0xEB000000;\r
   \r
   \r
-  // Address of PEI Core, if we have one\r
-  ResetVector[1] = (UINT32)PeiCorePhysicalAddress;\r
+    // Address of PEI Core, if we have one\r
+    ResetVector[1] = (UINT32)PeiCorePhysicalAddress;\r
   \r
-  // SWI handler movs   pc,lr. Just in case a debugger uses SWI\r
-  ResetVector[2] = 0xE1B0F07E;\r
+    // SWI handler movs   pc,lr. Just in case a debugger uses SWI\r
+    ResetVector[2] = 0xE1B0F07E;\r
   \r
-  // Place holder to support a common interrupt handler from ROM. \r
-  // Currently not suppprted. For this to be used the reset vector would not be in this FV\r
-  // and the exception vectors would be hard coded in the ROM and just through this address \r
-  // to find a common handler in the a module in the FV.\r
-  ResetVector[3] = 0;\r
+    // Place holder to support a common interrupt handler from ROM.\r
+    // Currently not suppprted. For this to be used the reset vector would not be in this FV\r
+    // and the exception vectors would be hard coded in the ROM and just through this address\r
+    // to find a common handler in the a module in the FV.\r
+    ResetVector[3] = 0;\r
+  } else if (MachineType == EFI_IMAGE_MACHINE_AARCH64) {\r
+\r
+  /* NOTE:\r
+    ARMT above has an entry in ResetVector[2] for SWI. The way we are using the ResetVector\r
+    array at the moment, for AArch64, does not allow us space for this as the header only\r
+    allows for a fixed amount of bytes at the start. If we are sure that UEFI will live\r
+    within the first 4GB of addressable RAM we could potensioally adopt the same ResetVector\r
+    layout as above. But for the moment we replace the four 32bit vectors with two 64bit\r
+    vectors in the same area of the Image heasder. This allows UEFI to start from a 64bit\r
+    base.\r
+  */\r
+\r
+    ((UINT64*)ResetVector)[0] = (UINT64)(SecCorePhysicalAddress - FvInfo->BaseAddress) >> 2;\r
+\r
+    // B SecEntryPoint - signed_immed_26 part +/-128MB offset\r
+    if ( ((UINT64*)ResetVector)[0] > 0x03FFFFFF) {\r
+      Error (NULL, 0, 3000, "Invalid", "SEC Entry point must be within 128MB of the start of the FV");\r
+      return EFI_ABORTED;\r
+    }\r
+    // Add opcode for an uncondional branch with no link. AKA B SecEntryPoint\r
+    ((UINT64*)ResetVector)[0] |= 0x14000000;\r
+\r
+    // Address of PEI Core, if we have one\r
+    ((UINT64*)ResetVector)[1] = (UINT64)PeiCorePhysicalAddress;\r
+\r
+  } else {\r
+    Error (NULL, 0, 3000, "Invalid", "Unknown ARM machine type");\r
+    return EFI_ABORTED;\r
+  }\r
 \r
   //\r
   // Copy to the beginning of the FV \r
@@ -1948,8 +1988,8 @@ Returns:
   //\r
   // Verify machine type is supported\r
   //\r
-  if (*MachineType != EFI_IMAGE_MACHINE_IA32 && *MachineType != EFI_IMAGE_MACHINE_IA64 && *MachineType != EFI_IMAGE_MACHINE_X64 && *MachineType != EFI_IMAGE_MACHINE_EBC && \r
-      *MachineType != EFI_IMAGE_MACHINE_ARMT) {\r
+  if ((*MachineType != EFI_IMAGE_MACHINE_IA32) && (*MachineType != EFI_IMAGE_MACHINE_IA64) && (*MachineType != EFI_IMAGE_MACHINE_X64) && (*MachineType != EFI_IMAGE_MACHINE_EBC) && \r
+      (*MachineType != EFI_IMAGE_MACHINE_ARMT) && (*MachineType != EFI_IMAGE_MACHINE_AARCH64)) {\r
     Error (NULL, 0, 3000, "Invalid", "Unrecognized machine type in the PE32 file.");\r
     return EFI_UNSUPPORTED;\r
   }\r
@@ -2895,7 +2935,8 @@ Returns:
       return Status;\r
     }\r
 \r
-    if (ImageContext.Machine == EFI_IMAGE_MACHINE_ARMT) {\r
+    if ( (ImageContext.Machine == EFI_IMAGE_MACHINE_ARMT) ||\r
+         (ImageContext.Machine == EFI_IMAGE_MACHINE_AARCH64) ) {\r
       mArm = TRUE;\r
     }\r
 \r
@@ -3163,7 +3204,8 @@ Returns:
       return Status;\r
     }\r
 \r
-    if (ImageContext.Machine == EFI_IMAGE_MACHINE_ARMT) {\r
+    if ( (ImageContext.Machine == EFI_IMAGE_MACHINE_ARMT) ||\r
+         (ImageContext.Machine == EFI_IMAGE_MACHINE_AARCH64) ) {\r
       mArm = TRUE;\r
     }\r
 \r
index e7c5d4997a1dc971c37cc041016c2d093de98273..72d6cd16d786f7e8674888c9da648012cbf6f5a6 100644 (file)
@@ -1,6 +1,7 @@
 /** @file
 
 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
 
 This program and the accompanying materials are licensed and made available
 under the terms and conditions of the BSD License which accompanies this
@@ -146,8 +147,8 @@ InitializeElf64 (
     Error (NULL, 0, 3000, "Unsupported", "ELF e_type not ET_EXEC or ET_DYN");
     return FALSE;
   }
-  if (!((mEhdr->e_machine == EM_X86_64))) {
-    Error (NULL, 0, 3000, "Unsupported", "ELF e_machine not EM_X86_64");
+  if (!((mEhdr->e_machine == EM_X86_64) || (mEhdr->e_machine == EM_AARCH64))) {
+    Error (NULL, 0, 3000, "Unsupported", "ELF e_machine not EM_X86_64 or EM_AARCH64");
     return FALSE;
   }
   if (mEhdr->e_version != EV_CURRENT) {
@@ -269,6 +270,7 @@ ScanSections64 (
   switch (mEhdr->e_machine) {
   case EM_X86_64:
   case EM_IA_64:
+  case EM_AARCH64:
     mCoffOffset += sizeof (EFI_IMAGE_NT_HEADERS64);
   break;
   default:
@@ -412,6 +414,10 @@ ScanSections64 (
     NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_IPF;
     NtHdr->Pe32Plus.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
     break;
+  case EM_AARCH64:
+    NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_AARCH64;
+    NtHdr->Pe32Plus.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
+    break;
   default:
     VerboseMsg ("%s unknown e_machine type. Assume X64", (UINTN)mEhdr->e_machine);
     NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_X64;
@@ -542,22 +548,55 @@ WriteSections64 (
   //
   VerboseMsg ("Applying Relocations...");
   for (Idx = 0; Idx < mEhdr->e_shnum; Idx++) {
+    //
+    // Determine if this is a relocation section.
+    //
     Elf_Shdr *RelShdr = GetShdrByIndex(Idx);
     if ((RelShdr->sh_type != SHT_REL) && (RelShdr->sh_type != SHT_RELA)) {
       continue;
     }
+
+    //
+    // Relocation section found.  Now extract section information that the relocations
+    // apply to in the ELF data and the new COFF data.
+    //
     SecShdr = GetShdrByIndex(RelShdr->sh_info);
     SecOffset = mCoffSectionsOffset[RelShdr->sh_info];
+
+    //
+    // Only process relocations for the current filter type.
+    //
     if (RelShdr->sh_type == SHT_RELA && (*Filter)(SecShdr)) {
       UINT64 RelIdx;
+
+      //
+      // Determine the symbol table referenced by the relocation data.
+      //
       Elf_Shdr *SymtabShdr = GetShdrByIndex(RelShdr->sh_link);
       UINT8 *Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
+
+      //
+      // Process all relocation entries for this section.
+      //
       for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += (UINT32) RelShdr->sh_entsize) {
+
+        //
+        // Set pointer to relocation entry
+        //
         Elf_Rela *Rel = (Elf_Rela *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
+
+        //
+        // Set pointer to symbol table entry associated with the relocation entry.
+        //
         Elf_Sym  *Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
+
         Elf_Shdr *SymShdr;
         UINT8    *Targ;
 
+        //
+        // Check section header index found in symbol table and get the section
+        // header location.
+        //
         if (Sym->st_shndx == SHN_UNDEF
             || Sym->st_shndx == SHN_ABS
             || Sym->st_shndx > mEhdr->e_shnum) {
@@ -566,11 +605,20 @@ WriteSections64 (
         SymShdr = GetShdrByIndex(Sym->st_shndx);
 
         //
-        // Note: r_offset in a memory address.
-        //  Convert it to a pointer in the coff file.
+        // Convert the relocation data to a pointer into the coff file.
+        //
+        // Note:
+        //   r_offset is the virtual address of the storage unit to be relocated.
+        //   sh_addr is the virtual address for the base of the section.
+        //
+        //   r_offset in a memory address.
+        //   Convert it to a pointer in the coff file.
         //
         Targ = mCoffFile + SecOffset + (Rel->r_offset - SecShdr->sh_addr);
 
+        //
+        // Determine how to handle each relocation type based on the machine type.
+        //
         if (mEhdr->e_machine == EM_X86_64) {
           switch (ELF_R_TYPE(Rel->r_info)) {
           case R_X86_64_NONE:
@@ -618,8 +666,51 @@ WriteSections64 (
           default:
             Error (NULL, 0, 3000, "Invalid", "%s unsupported ELF EM_X86_64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
           }
+        } else if (mEhdr->e_machine == EM_AARCH64) {
+
+          // AARCH64 GCC uses RELA relocation, so all relocations have to be fixed up.
+          // As opposed to ARM32 using REL.
+
+          switch (ELF_R_TYPE(Rel->r_info)) {
+
+          case R_AARCH64_LD_PREL_LO19:
+            if  (Rel->r_addend != 0 ) { /* TODO */
+              Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_LD_PREL_LO19 Need to fixup with addend!.");
+            }
+            break;
+
+          case R_AARCH64_CALL26:
+            if  (Rel->r_addend != 0 ) { /* TODO */
+              Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_CALL26 Need to fixup with addend!.");
+            }
+            break;
+
+          case R_AARCH64_JUMP26:
+            if  (Rel->r_addend != 0 ) { /* TODO : AArch64 '-O2' optimisation. */
+              Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_JUMP26 Need to fixup with addend!.");
+            }
+            break;
+
+          case R_AARCH64_ADR_PREL_PG_HI21:
+            // TODO : AArch64 'small' memory model.
+            Error (NULL, 0, 3000, "Invalid", "WriteSections64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADR_PREL_PG_HI21.", mInImageName);
+            break;
+
+          case R_AARCH64_ADD_ABS_LO12_NC:
+            // TODO : AArch64 'small' memory model.
+            Error (NULL, 0, 3000, "Invalid", "WriteSections64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADD_ABS_LO12_NC.", mInImageName);
+            break;
+
+          // Absolute relocations.
+          case R_AARCH64_ABS64:
+            *(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx];
+            break;
+
+          default:
+            Error (NULL, 0, 3000, "Invalid", "WriteSections64(): %s unsupported ELF EM_AARCH64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
+          }
         } else {
-          Error (NULL, 0, 3000, "Invalid", "Not EM_X86_X64");
+          Error (NULL, 0, 3000, "Invalid", "Not a supported machine type");
         }
       }
     }
@@ -673,6 +764,45 @@ WriteRelocations64 (
             default:
               Error (NULL, 0, 3000, "Invalid", "%s unsupported ELF EM_X86_64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
             }
+          } else if (mEhdr->e_machine == EM_AARCH64) {
+            // AArch64 GCC uses RELA relocation, so all relocations has to be fixed up. ARM32 uses REL.
+            switch (ELF_R_TYPE(Rel->r_info)) {
+            case R_AARCH64_LD_PREL_LO19:
+              break;
+
+            case R_AARCH64_CALL26:
+              break;
+
+            case R_AARCH64_JUMP26:
+              break;
+
+            case R_AARCH64_ADR_PREL_PG_HI21:
+              // TODO : AArch64 'small' memory model.
+              Error (NULL, 0, 3000, "Invalid", "WriteRelocations64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADR_PREL_PG_HI21.", mInImageName);
+              break;
+
+            case R_AARCH64_ADD_ABS_LO12_NC:
+              // TODO : AArch64 'small' memory model.
+              Error (NULL, 0, 3000, "Invalid", "WriteRelocations64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADD_ABS_LO12_NC.", mInImageName);
+              break;
+
+            case R_AARCH64_ABS64:
+              CoffAddFixup(
+                (UINT32) ((UINT64) mCoffSectionsOffset[RelShdr->sh_info]
+                + (Rel->r_offset - SecShdr->sh_addr)),
+                EFI_IMAGE_REL_BASED_DIR64);
+              break;
+
+            case R_AARCH64_ABS32:
+              CoffAddFixup(
+                (UINT32) ((UINT64) mCoffSectionsOffset[RelShdr->sh_info]
+                + (Rel->r_offset - SecShdr->sh_addr)),
+                EFI_IMAGE_REL_BASED_HIGHLOW);
+             break;
+
+            default:
+                Error (NULL, 0, 3000, "Invalid", "WriteRelocations64(): %s unsupported ELF EM_AARCH64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
+            }
           } else {
             Error (NULL, 0, 3000, "Not Supported", "This tool does not support relocations for ELF with e_machine %u (processor type).", (unsigned) mEhdr->e_machine);
           }
index 2a0f058b86f8c0b7202e8b356671139932a8d267..ec5b87265fdce87e73ff7845ffd217632a4e2255 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenFw' module build.\r
+# GNU/Linux makefile for 'GenFw' module build.\r
 #\r
 # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 9618d48524395cf876af7807fc2d35afa6f18362..df22472dc2247a38225ccab43a0eca3fd9978c6d 100644 (file)
@@ -2,6 +2,7 @@
 Ported ELF include files from FreeBSD
 
 Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
+Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -183,6 +184,7 @@ typedef struct {
 #define EM_TINYJ       61      /* Advanced Logic Corp. TinyJ processor. */
 #define EM_X86_64      62      /* Advanced Micro Devices x86-64 */
 #define        EM_AMD64        EM_X86_64       /* Advanced Micro Devices x86-64 (compat) */
+#define EM_AARCH64     183     /* ARM 64bit Architecture */
 
 /* Non-standard or deprecated. */
 #define EM_486         6       /* Intel i486. */
@@ -543,6 +545,135 @@ typedef struct {
 #define        R_386_TLS_DTPOFF32      36      /* GOT entry containing TLS offset */
 #define        R_386_TLS_TPOFF32       37      /* GOT entry of -ve static TLS offset */
 
+/* Null relocation */
+#define        R_AARCH64_NONE                          256     /* No relocation */
+/* Static AArch64 relocations */
+ /* Static data relocations */
+#define        R_AARCH64_ABS64                         257     /* S + A */
+#define        R_AARCH64_ABS32                         258     /* S + A */
+#define        R_AARCH64_ABS16                         259     /* S + A */
+#define        R_AARCH64_PREL64                        260     /* S + A - P */
+#define        R_AARCH64_PREL32                        261     /* S + A - P */
+#define        R_AARCH64_PREL16                        262     /* S + A - P */
+ /* Group relocations to create a 16, 32, 48, or 64 bit unsigned data value or address inline */
+#define        R_AARCH64_MOVW_UABS_G0                  263     /* S + A */
+#define        R_AARCH64_MOVW_UABS_G0_NC               264     /* S + A */
+#define        R_AARCH64_MOVW_UABS_G1                  265     /* S + A */
+#define        R_AARCH64_MOVW_UABS_G1_NC               266     /* S + A */
+#define        R_AARCH64_MOVW_UABS_G2                  267     /* S + A */
+#define        R_AARCH64_MOVW_UABS_G2_NC               268     /* S + A */
+#define        R_AARCH64_MOVW_UABS_G3                  269     /* S + A */
+ /* Group relocations to create a 16, 32, 48, or 64 bit signed data or offset value inline */
+#define        R_AARCH64_MOVW_SABS_G0                  270     /* S + A */
+#define        R_AARCH64_MOVW_SABS_G1                  271     /* S + A */
+#define        R_AARCH64_MOVW_SABS_G2                  272     /* S + A */
+ /* Relocations to generate 19, 21 and 33 bit PC-relative addresses */
+#define        R_AARCH64_LD_PREL_LO19                  273     /* S + A - P */
+#define        R_AARCH64_ADR_PREL_LO21                 274     /* S + A - P */
+#define        R_AARCH64_ADR_PREL_PG_HI21              275     /* Page(S+A) - Page(P) */
+#define        R_AARCH64_ADR_PREL_PG_HI21_NC           276     /* Page(S+A) - Page(P) */
+#define        R_AARCH64_ADD_ABS_LO12_NC               277     /* S + A */
+#define        R_AARCH64_LDST8_ABS_LO12_NC             278     /* S + A */
+#define        R_AARCH64_LDST16_ABS_LO12_NC            284     /* S + A */
+#define        R_AARCH64_LDST32_ABS_LO12_NC            285     /* S + A */
+#define        R_AARCH64_LDST64_ABS_LO12_NC            286     /* S + A */
+#define        R_AARCH64_LDST128_ABS_LO12_NC           299     /* S + A */
+ /* Relocations for control-flow instructions - all offsets are a multiple of 4 */
+#define        R_AARCH64_TSTBR14                       279     /* S+A-P */
+#define        R_AARCH64_CONDBR19                      280     /* S+A-P */
+#define        R_AARCH64_JUMP26                        282     /* S+A-P */
+#define        R_AARCH64_CALL26                        283     /* S+A-P */
+ /* Group relocations to create a 16, 32, 48, or 64 bit PC-relative offset inline */
+#define        R_AARCH64_MOVW_PREL_G0                  287     /* S+A-P */
+#define        R_AARCH64_MOVW_PREL_G0_NC               288     /* S+A-P */
+#define        R_AARCH64_MOVW_PREL_G1                  289     /* S+A-P */
+#define        R_AARCH64_MOVW_PREL_G1_NC               290     /* S+A-P */
+#define        R_AARCH64_MOVW_PREL_G2                  291     /* S+A-P */
+#define        R_AARCH64_MOVW_PREL_G2_NC               292     /* S+A-P */
+#define        R_AARCH64_MOVW_PREL_G3                  293     /* S+A-P */
+ /* Group relocations to create a 16, 32, 48, or 64 bit GOT-relative offsets inline */
+#define        R_AARCH64_MOVW_GOTOFF_G0                300     /* G(S)-GOT */
+#define        R_AARCH64_MOVW_GOTOFF_G0_NC             301     /* G(S)-GOT */
+#define        R_AARCH64_MOVW_GOTOFF_G1                302     /* G(S)-GOT */
+#define        R_AARCH64_MOVW_GOTOFF_G1_NC             303     /* G(S)-GOT */
+#define        R_AARCH64_MOVW_GOTOFF_G2                304     /* G(S)-GOT */
+#define        R_AARCH64_MOVW_GOTOFF_G2_NC             305     /* G(S)-GOT */
+#define        R_AARCH64_MOVW_GOTOFF_G3                306     /* G(S)-GOT */
+ /*  GOT-relative data relocations */
+#define        R_AARCH64_GOTREL64                      307     /* S+A-GOT */
+#define        R_AARCH64_GOTREL32                      308     /* S+A-GOT */
+ /* GOT-relative instruction relocations */
+#define        R_AARCH64_GOT_LD_PREL19                 309     /* G(S)-P */
+#define        R_AARCH64_LD64_GOTOFF_LO15              310     /* G(S)-GOT */
+#define        R_AARCH64_ADR_GOT_PAGE                  311     /* Page(G(S))-Page(P) */
+#define        R_AARCH64_LD64_GOT_LO12_NC              312     /* G(S) */
+#define        R_AARCH64_LD64_GOTPAGE_LO15             313     /* G(S)-Page(GOT) */
+/* Relocations for thread-local storage */
+ /* General Dynamic TLS relocations */
+#define        R_AARCH64_TLSGD_ADR_PREL21              512     /* G(TLSIDX(S+A)) - P */
+#define        R_AARCH64_TLSGD_ADR_PAGE21              513     /* Page(G(TLSIDX(S+A))) - Page(P) */
+#define        R_AARCH64_TLSGD_ADD_LO12_NC             514     /* G(TLSIDX(S+A)) */
+#define        R_AARCH64_TLSGD_MOVW_G1                 515     /* G(TLSIDX(S+A)) - GOT */
+#define        R_AARCH64_TLSGD_MOVW_G0_NC              516     /* G(TLSIDX(S+A)) - GOT */
+ /* Local Dynamic TLS relocations */
+#define        R_AARCH64_TLSLD_ADR_PREL21              517     /* G(LDM(S))) - P */
+#define        R_AARCH64_TLSLD_ADR_PAGE21              518     /* Page(G(LDM(S)))-Page(P) */
+#define        R_AARCH64_TLSLD_ADD_LO12_NC             519     /* G(LDM(S)) */
+#define        R_AARCH64_TLSLD_MOVW_G1                 520     /* G(LDM(S)) - GOT */
+#define        R_AARCH64_TLSLD_MOVW_G0_NC              521     /* G(LDM(S)) - GOT */
+#define        R_AARCH64_TLSLD_LD_PREL19               522     /* G(LDM(S)) - P */
+#define        R_AARCH64_TLSLD_MOVW_DTPREL_G2          523     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_MOVW_DTPREL_G1          524     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC       525     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_MOVW_DTPREL_G0          526     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC       527     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_ADD_DTPREL_HI12         528     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_ADD_DTPREL_LO12         529     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC      530     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST8_DTPREL_LO12       531     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC    532     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST16_DTPREL_LO12      533     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC   534     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST32_DTPREL_LO12      535     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC   536     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST64_DTPREL_LO12      537     /* DTPREL(S+A) */
+#define        R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC   538     /* DTPREL(S+A) */
+ /* Initial Exec TLS relocations */
+#define        R_AARCH64_TLSIE_MOVW_GOTTPREL_G1        539     /* G(TPREL(S+A)) - GOT */
+#define        R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC     540     /* G(TPREL(S+A)) - GOT */
+#define        R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21     541     /* Page(G(TPREL(S+A))) - Page(P) */
+#define        R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC   542     /* G(TPREL(S+A)) */
+#define        R_AARCH64_TLSIE_LD_GOTTPREL_PREL19      543     /* G(TPREL(S+A)) - P */
+ /* Local Exec TLS relocations */
+#define        R_AARCH64_TLSLE_MOVW_TPREL_G2           544     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_MOVW_TPREL_G1           545     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_MOVW_TPREL_G1_NC        546     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_MOVW_TPREL_G0           547     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_MOVW_TPREL_G0_NC        548     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_ADD_TPREL_HI12          549     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_ADD_TPREL_LO12          550     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_ADD_TPREL_LO12_NC       551     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST8_TPREL_LO12        552     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC     553     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST16_TPREL_LO12       554     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC    555     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST32_TPREL_LO12       556     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC    557     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST64_TPREL_LO12       558     /* TPREL(S+A) */
+#define        R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC    559     /* TPREL(S+A) */
+/* Dynamic relocations */
+ /* Dynamic relocations */
+#define        R_AARCH64_COPY                          1024
+#define        R_AARCH64_GLOB_DAT                      1025    /* S + A */
+#define        R_AARCH64_JUMP_SLOT                     1026    /* S + A */
+#define        R_AARCH64_RELATIVE                      1027    /* Delta(S) + A , Delta(P) + A */
+#define        R_AARCH64_TLS_DTPREL64                  1028    /* DTPREL(S+A) */
+#define        R_AARCH64_TLS_DTPMOD64                  1029    /* LDM(S) */
+#define        R_AARCH64_TLS_TPREL64                   1030    /* TPREL(S+A) */
+#define        R_AARCH64_TLS_DTPREL32                  1031    /* DTPREL(S+A) */
+#define        R_AARCH64_TLS_DTPMOD32                  1032    /* LDM(S) */
+#define        R_AARCH64_TLS_TPREL32                   1033    /* DTPREL(S+A) */
+
 #define        R_ALPHA_NONE            0       /* No reloc */
 #define        R_ALPHA_REFLONG         1       /* Direct 32 bit */
 #define        R_ALPHA_REFQUAD         2       /* Direct 64 bit */
index 11ee11562297786f326c71d02c5fa9d549a39489..e1eab8747c117c2087b9e656ff2ed54e725a9a6f 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenPage' module build.\r
+# GNU/Linux makefile for 'GenPage' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 6c24a2f9ec4af3e35aef42568093dce098cc2d4c..78047ba9bee5184b0a755354c8cc95e9922486f7 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, 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
@@ -91,8 +91,7 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("%s v%d.%d %s -Utility to generate the EfiLoader image containing page table.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 2008 - 2011 Intel Corporation. All rights reserved.\n");\r
+  printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
 }\r
 \r
 VOID\r
@@ -100,25 +99,29 @@ Usage (
   void\r
   )\r
 {\r
-  Version();\r
-  printf ("\nUsage: \n\\r
-   GenPage\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
+  printf ("Usage: GenPage.exe [options] EfiLoaderImageName \n\n\\r
+Copyright (c) 2008 - 2013, Intel Corporation.  All rights reserved.\n\n\\r
+  Utility to generate the EfiLoader image containing a page table.\n\n\\r
+optional arguments:\n\\r
+  -h, --help            Show this help message and exit\n\\r
+  --version             Show program's version number and exit\n\\r
+  -d [DEBUG], --debug [DEBUG]\n\\r
+                        Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\\r
+                        - 9 (max)\n\\r
+  -v, --verbose         Print informational statements\n\\r
+  -q, --quiet           Returns the exit code, error messages will be\n\\r
+                        displayed\n\\r
+  -s, --silent          Returns only the exit code; informational and error\n\\r
+                        messages are not displayed\n\\r
+  -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\\r
+                        Output file contain both the non-page table part and\n\\r
+                        the page table\n\\r
+  -b BASE_ADDRESS, --baseaddr BASE_ADDRESS\n\\r
                         The page table location\n\\r
-     [-f, --offset offset]\n\\r
+  -f OFFSET, --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
+  --sfo                 Reserved for future use\n");\r
 \r
 }\r
 \r
index d41e9dc9a787c599a27a40eeb4e45b347482dd4a..c2d289cd2037a32c1a514f5045e3365afd2f02ce 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenSec' module build.\r
+# GNU/Linux makefile for 'GenSec' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 7ff752bf1117268e518706fc3db1e90463129404..ff6599f1c9881a9c67d87ca76c9a6af9e52499a1 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GenVtf' module build.\r
+# GNU/Linux makefile for 'GenVtf' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index f9888704f91f18c3d1675b5e9980960c19d304f6..e9d32f819571e128eabdce42b3b27cd6f3a1f93c 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'GnuGenBootSector' module build.\r
+# GNU/Linux makefile for 'GnuGenBootSector' module build.\r
 #\r
 # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
diff --git a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
new file mode 100644 (file)
index 0000000..4d184c4
--- /dev/null
@@ -0,0 +1,159 @@
+/** @file\r
+  Processor or Compiler specific defines and types for AArch64.\r
+\r
+  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Portions copyright (c) 2013, ARM Ltd. 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
+  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
+#ifndef __PROCESSOR_BIND_H__\r
+#define __PROCESSOR_BIND_H__\r
+\r
+///\r
+/// Define the processor type so other code can make processor based choices\r
+///\r
+#define MDE_CPU_AARCH64\r
+\r
+//\r
+// Make sure we are using the correct packing rules per EFI specification\r
+//\r
+#ifndef __GNUC__\r
+#pragma pack()\r
+#endif\r
+\r
+#if _MSC_EXTENSIONS\r
+  //\r
+  // use Microsoft* C complier dependent integer width types \r
+  //\r
+  typedef unsigned __int64    UINT64;\r
+  typedef __int64             INT64;\r
+  typedef unsigned __int32    UINT32;\r
+  typedef __int32             INT32;\r
+  typedef unsigned short      UINT16;\r
+  typedef unsigned short      CHAR16;\r
+  typedef short               INT16;\r
+  typedef unsigned char       BOOLEAN;\r
+  typedef unsigned char       UINT8;\r
+  typedef char                CHAR8;\r
+  typedef signed char         INT8;\r
+#else\r
+  //\r
+  // Assume standard AARCH64 alignment.\r
+  //\r
+  typedef unsigned long long  UINT64;\r
+  typedef long long           INT64;\r
+  typedef unsigned int        UINT32;\r
+  typedef int                 INT32;\r
+  typedef unsigned short      UINT16;\r
+  typedef unsigned short      CHAR16;\r
+  typedef short               INT16;\r
+  typedef unsigned char       BOOLEAN;\r
+  typedef unsigned char       UINT8;\r
+  typedef char                CHAR8;\r
+  typedef signed char         INT8;\r
+\r
+  #define UINT8_MAX 0xff\r
+#endif\r
+\r
+///\r
+/// Unsigned value of native width.  (4 bytes on supported 32-bit processor instructions,\r
+/// 8 bytes on supported 64-bit processor instructions)\r
+///\r
+typedef UINT64  UINTN;\r
+\r
+///\r
+/// Signed value of native width.  (4 bytes on supported 32-bit processor instructions,\r
+/// 8 bytes on supported 64-bit processor instructions)\r
+///\r
+typedef INT64   INTN;\r
+\r
+//\r
+// Processor specific defines\r
+//\r
+\r
+///\r
+/// A value of native width with the highest bit set.\r
+///\r
+#define MAX_BIT      0x8000000000000000\r
+\r
+///\r
+/// A value of native width with the two highest bits set.\r
+///\r
+#define MAX_2_BITS   0xC000000000000000\r
+\r
+///\r
+/// Maximum legal AARCH64  address\r
+///\r
+#define MAX_ADDRESS  0xFFFFFFFFFFFFFFFF\r
+\r
+///\r
+/// The stack alignment required for AARCH64\r
+///\r
+#define CPU_STACK_ALIGNMENT  16\r
+\r
+//\r
+// Modifier to ensure that all protocol member functions and EFI intrinsics\r
+// use the correct C calling convention. All protocol member functions and\r
+// EFI intrinsics are required to modify their member functions with EFIAPI.\r
+//\r
+#define EFIAPI\r
+\r
+#if defined(__GNUC__)\r
+  ///\r
+  /// For GNU assembly code, .global or .globl can declare global symbols.\r
+  /// Define this macro to unify the usage.\r
+  ///\r
+  #define ASM_GLOBAL .globl\r
+\r
+  #if !defined(__APPLE__)\r
+    ///\r
+    /// ARM EABI defines that the linker should not manipulate call relocations\r
+    /// (do bl/blx conversion) unless the target symbol has function type.\r
+    /// CodeSourcery 2010.09 started requiring the .type to function properly\r
+    ///\r
+    #define INTERWORK_FUNC(func__)   .type ASM_PFX(func__), %function\r
+\r
+    #define GCC_ASM_EXPORT(func__)  \\r
+             .global  _CONCATENATE (__USER_LABEL_PREFIX__, func__)    ;\\r
+             .type ASM_PFX(func__), %function  \r
+\r
+    #define GCC_ASM_IMPORT(func__)  \\r
+             .extern  _CONCATENATE (__USER_LABEL_PREFIX__, func__)\r
+             \r
+  #else\r
+    //\r
+    // .type not supported by Apple Xcode tools \r
+    //\r
+    #define INTERWORK_FUNC(func__)  \r
+\r
+    #define GCC_ASM_EXPORT(func__)  \\r
+             .globl  _CONCATENATE (__USER_LABEL_PREFIX__, func__)    \\r
+  \r
+    #define GCC_ASM_IMPORT(name)  \r
+\r
+  #endif\r
+#endif\r
+\r
+/**\r
+  Return the pointer to the first instruction of a function given a function pointer.\r
+  On ARM CPU architectures, these two pointer values are the same,\r
+  so the implementation of this macro is very simple.\r
+\r
+  @param  FunctionPointer   A pointer to a function.\r
+\r
+  @return The pointer to the first instruction of a function given a function pointer.\r
+\r
+**/\r
+#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)\r
+\r
+#endif\r
+\r
diff --git a/BaseTools/Source/C/Include/Arm/ProcessorBind.h b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
new file mode 100644 (file)
index 0000000..1ca26ab
--- /dev/null
@@ -0,0 +1,158 @@
+/** @file
+  Processor or Compiler specific defines and types for ARM.
+
+  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+  This program and the accompanying materials                          
+  are licensed and made available under the terms and conditions of the BSD License         
+  which accompanies this distribution.  The full text of the license may be found at        
+  http://opensource.org/licenses/bsd-license.php                                            
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+**/
+
+#ifndef __PROCESSOR_BIND_H__
+#define __PROCESSOR_BIND_H__
+
+///
+/// Define the processor type so other code can make processor based choices
+///
+#define MDE_CPU_ARM
+
+//
+// Make sure we are using the correct packing rules per EFI specification
+//
+#ifndef __GNUC__
+#pragma pack()
+#endif
+
+#if _MSC_EXTENSIONS 
+  //
+  // use Microsoft* C complier dependent integer width types 
+  //
+  typedef unsigned __int64    UINT64;
+  typedef __int64             INT64;
+  typedef unsigned __int32    UINT32;
+  typedef __int32             INT32;
+  typedef unsigned short      UINT16;
+  typedef unsigned short      CHAR16;
+  typedef short               INT16;
+  typedef unsigned char       BOOLEAN;
+  typedef unsigned char       UINT8;
+  typedef char                CHAR8;
+  typedef signed char         INT8;
+#else
+  //
+  // Assume standard ARM alignment. 
+  //
+  typedef unsigned long long  UINT64;
+  typedef long long           INT64;
+  typedef unsigned int        UINT32;
+  typedef int                 INT32;
+  typedef unsigned short      UINT16;
+  typedef unsigned short      CHAR16;
+  typedef short               INT16;
+  typedef unsigned char       BOOLEAN;
+  typedef unsigned char       UINT8;
+  typedef char                CHAR8;
+  typedef signed char         INT8;
+
+  #define UINT8_MAX 0xff
+#endif
+
+///
+/// Unsigned value of native width.  (4 bytes on supported 32-bit processor instructions,
+/// 8 bytes on supported 64-bit processor instructions)
+///
+typedef UINT32  UINTN;
+
+///
+/// Signed value of native width.  (4 bytes on supported 32-bit processor instructions,
+/// 8 bytes on supported 64-bit processor instructions)
+///
+typedef INT32   INTN;
+
+//
+// Processor specific defines
+//
+
+///
+/// A value of native width with the highest bit set.
+///
+#define MAX_BIT      0x80000000
+
+///
+/// A value of native width with the two highest bits set.
+///
+#define MAX_2_BITS   0xC0000000
+
+///
+/// Maximum legal ARM address
+///
+#define MAX_ADDRESS  0xFFFFFFFF
+
+///
+/// The stack alignment required for ARM
+///
+#define CPU_STACK_ALIGNMENT  sizeof(UINT64)
+
+//
+// Modifier to ensure that all protocol member functions and EFI intrinsics
+// use the correct C calling convention. All protocol member functions and
+// EFI intrinsics are required to modify their member functions with EFIAPI.
+//
+#define EFIAPI    
+
+#if defined(__GNUC__)
+  ///
+  /// For GNU assembly code, .global or .globl can declare global symbols.
+  /// Define this macro to unify the usage.
+  ///
+  #define ASM_GLOBAL .globl
+
+  #if !defined(__APPLE__)
+    ///
+    /// ARM EABI defines that the linker should not manipulate call relocations
+    /// (do bl/blx conversion) unless the target symbol has function type.
+    /// CodeSourcery 2010.09 started requiring the .type to function properly
+    ///
+    #define INTERWORK_FUNC(func__)   .type ASM_PFX(func__), %function
+
+    #define GCC_ASM_EXPORT(func__)  \
+             .global  _CONCATENATE (__USER_LABEL_PREFIX__, func__)    ;\
+             .type ASM_PFX(func__), %function  
+
+    #define GCC_ASM_IMPORT(func__)  \
+             .extern  _CONCATENATE (__USER_LABEL_PREFIX__, func__)
+             
+  #else
+    //
+    // .type not supported by Apple Xcode tools 
+    //
+    #define INTERWORK_FUNC(func__)  
+
+    #define GCC_ASM_EXPORT(func__)  \
+             .globl  _CONCATENATE (__USER_LABEL_PREFIX__, func__)    \
+  
+    #define GCC_ASM_IMPORT(name)  
+
+  #endif
+#endif
+
+/**
+  Return the pointer to the first instruction of a function given a function pointer.
+  On ARM CPU architectures, these two pointer values are the same, 
+  so the implementation of this macro is very simple.
+  
+  @param  FunctionPointer   A pointer to a function.
+
+  @return The pointer to the first instruction of a function given a function pointer.
+  
+**/
+#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
+
+#endif
+
+
index 5b50a5c28e711fcf6c22c61716545d87ab6a64d4..764bebfa933a494bda06034717520a3d7cbbaef8 100644 (file)
@@ -14,4 +14,4 @@
 \r
 **/\r
 \r
-#define __BUILD_VERSION "Build 2524"\r
+#define __BUILD_VERSION ""\r
index 82d391ce3ad0328ac09dc9db1164546b8426dbec..3cd22d134739908270d5603c393435554a55ab39 100644 (file)
@@ -783,9 +783,9 @@ typedef struct _EFI_IFR_IMAGE {
   EFI_IMAGE_ID             Id;\r
 } EFI_IFR_IMAGE;\r
 \r
-typedef struct _EFI_IFR_MODAL {\r
+typedef struct _EFI_IFR_MODAL_TAG {\r
   EFI_IFR_OP_HEADER        Header;\r
-} EFI_IFR_MODAL;\r
+} EFI_IFR_MODAL_TAG;\r
 \r
 typedef struct _EFI_IFR_LOCKED {\r
   EFI_IFR_OP_HEADER        Header;\r
@@ -803,6 +803,12 @@ typedef struct _EFI_IFR_DEFAULT {
   EFI_IFR_TYPE_VALUE       Value;\r
 } EFI_IFR_DEFAULT;\r
 \r
+typedef struct _EFI_IFR_DEFAULT_2 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT16                   DefaultId;\r
+  UINT8                    Type;\r
+} EFI_IFR_DEFAULT_2;\r
+\r
 typedef struct _EFI_IFR_VALUE {\r
   EFI_IFR_OP_HEADER        Header;\r
 } EFI_IFR_VALUE;\r
index 11c587e862642c26e9c2a9a73a8f7950b54096d5..7c487471a8a277447d4fb300baa8c314f1dd2a89 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, 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
@@ -117,9 +117,9 @@ typedef struct _WIN_CERTIFICATE {
 // WIN_CERTIFICATE_UEFI_GUID.CertData\r
 // \r
 typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {\r
-  UINT32  HashType;\r
-  UINT8   PublicKey[256];\r
-  UINT8   Signature[256];\r
+  EFI_GUID  HashType;\r
+  UINT8     PublicKey[256];\r
+  UINT8     Signature[256];\r
 } EFI_CERT_BLOCK_RSA_2048_SHA256;\r
 \r
 \r
@@ -127,7 +127,7 @@ typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
    \r
   @param Hdr  This is the standard WIN_CERTIFICATE header, where\r
               wCertificateType is set to\r
-              WIN_CERT_TYPE_UEFI_GUID.\r
+              WIN_CERT_TYPE_EFI_GUID.\r
 \r
   @param CertType   This is the unique id which determines the\r
                     format of the CertData. In this case, the\r
index 20d559e2fd362f7b6d95328d680716bdac8d01df..f1ed522b421e29674ab7af2b8666689c01cf7b37 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Processor or Compiler specific defines and types for x64.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, 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
@@ -70,7 +70,7 @@
   #if _MSC_EXTENSIONS \r
     \r
     //\r
-    // use Microsoft* C complier dependent interger width types \r
+    // use Microsoft* C complier dependent integer width types \r
     //\r
     typedef unsigned __int64    UINT64;\r
     typedef __int64             INT64;\r
index 8eaf4c3e78a92c911940b0f812d9a123d8cae02d..7e7c0ea46a3140dea722f42c4a16d259fa80e351 100644 (file)
@@ -5,6 +5,7 @@
   @bug Fix text - doc as defined in MSFT EFI specification.\r
 \r
   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Portions copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -48,6 +49,7 @@
 #define IMAGE_FILE_MACHINE_X64      0x8664\r
 #define IMAGE_FILE_MACHINE_ARM      0x01c0  // Thumb only\r
 #define IMAGE_FILE_MACHINE_ARMT     0x01c2  // 32bit Mixed ARM and Thumb/Thumb 2  Little Endian\r
+#define IMAGE_FILE_MACHINE_ARM64    0xAA64  // 64bit ARM Architecture, Little Endian\r
 \r
 //\r
 // Support old names for backward compatible\r
@@ -58,6 +60,7 @@
 #define EFI_IMAGE_MACHINE_EBC       IMAGE_FILE_MACHINE_EBC  \r
 #define EFI_IMAGE_MACHINE_X64       IMAGE_FILE_MACHINE_X64\r
 #define EFI_IMAGE_MACHINE_ARMT      IMAGE_FILE_MACHINE_ARMT\r
+#define EFI_IMAGE_MACHINE_AARCH64   IMAGE_FILE_MACHINE_ARM64\r
 \r
 #define EFI_IMAGE_DOS_SIGNATURE     0x5A4D      // MZ\r
 #define EFI_IMAGE_OS2_SIGNATURE     0x454E      // NE\r
index 0bc02f043a30be70a54530bbd91036eae28211bc..6f03dfa67d4f7bac91f380a2d1a92db3f4484a54 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64).\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, 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
@@ -73,7 +73,7 @@
     \r
 \r
     //\r
-    // use Microsoft C complier dependent interger width types \r
+    // use Microsoft C complier dependent integer width types \r
     //\r
     typedef unsigned __int64    UINT64;\r
     typedef __int64             INT64;\r
index 07f0a90b60b3bd03870b48d28685bc3b5ecc1d62..21c75ef7df5dc3124754ecf7c29f4ba1df02ca1d 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'LzmaCompress' module build.\r
+# GNU/Linux makefile for 'LzmaCompress' module build.\r
 #\r
 # Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 9aa83c03901aa26aa272496649811e285be4a926..6895f98c6ee6a8b15a048c17f028b66b6f45b88e 100644 (file)
@@ -4,6 +4,7 @@
 # ARCH = x86_64 or x64 for EM64T build\r
 # ARCH = ia32 or IA32 for IA32 build\r
 # ARCH = ia64 or IA64 for IA64 build\r
+# ARCH = Arm or ARM for ARM build\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
@@ -34,6 +35,10 @@ ifeq ($(ARCH), X64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/\r
 endif\r
 \r
+ifeq ($(ARCH), ARM)\r
+ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/\r
+endif\r
+\r
 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) \r
 CPPFLAGS = $(INCLUDE)\r
 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g\r
index 2c62a270cb34e6c158eb18888d767564a4e5c6f8..e38a01f8c13450098b6698d3c7eb843b2f13ba75 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'Split' module build.\r
+# GNU/Linux makefile for 'Split' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index e58b89bc83e91b732cb354a5d15690a5f139b43c..e4f3a69638bfce654bef1633d27f5b475f3656b7 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'TianoCompress' module build.\r
+# GNU/Linux makefile for 'TianoCompress' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index aad9417156091d3954bccf2023a3f2450da72556..4b9aed0adb425444c61c3b519f88d28313893292 100644 (file)
@@ -38,6 +38,8 @@ Abstract:
 #define EFI_STRING_ID_INVALID    0x0\r
 #define EFI_IMAGE_ID_INVALID     0xFFFF\r
 \r
+#define EFI_IFR_MAX_DEFAULT_TYPE 0x10\r
+\r
 typedef enum {\r
   QUESTION_NORMAL,\r
   QUESTION_DATE,\r
index 7f18e78eb6f9751ffdee999a7275738b5de1c2c8..82005e11f1fe16333b05e77c5828564e0eb2b6bd 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'VfrCompile' module build.\r
+# GNU/Linux makefile for 'VfrCompile' module build.\r
 #\r
 # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 58be497230ff55eeeb7e8255917212843ea49c3e..da8c52989417ef220ba420bc25a89f5a91c99cb9 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler main class and main function.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
@@ -82,6 +82,7 @@ CVfrCompiler::OptionInitialization (
   mOptions.CPreprocessorOptions          = NULL;\r
   mOptions.CompatibleMode                = FALSE;\r
   mOptions.HasOverrideClassGuid          = FALSE;\r
+  mOptions.WarningAsError                = FALSE;\r
   memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));\r
   \r
   if (Argc == 1) {\r
@@ -153,6 +154,8 @@ CVfrCompiler::OptionInitialization (
         goto Fail;\r
       }\r
       mOptions.HasOverrideClassGuid = TRUE;\r
+    } else if (stricmp(Argv[Index], "-w") == 0 || stricmp(Argv[Index], "--warning-as-error") == 0) {\r
+      mOptions.WarningAsError = TRUE;\r
     } else {\r
       DebugError (NULL, 0, 1000, "Unknown option", "unrecognized option %s", Argv[Index]);\r
       goto Fail;\r
@@ -425,6 +428,8 @@ CVfrCompiler::Usage (
     "  -g, --guid",\r
     "                 override class guid input",\r
     "                 format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",\r
+    "  -w  --warning-as-error",\r
+    "                 treat warning as an error",\r
     NULL\r
     };\r
   for (Index = 0; Help[Index] != NULL; Index++) {\r
@@ -516,6 +521,7 @@ CVfrCompiler::Compile (
   InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName;\r
 \r
   gCVfrErrorHandle.SetInputFile (InFileName);\r
+  gCVfrErrorHandle.SetWarningAsError(mOptions.WarningAsError);\r
 \r
   if ((pInFile = fopen (InFileName, "r")) == NULL) {\r
     DebugError (NULL, 0, 0001, "Error opening the input file", InFileName);\r
@@ -553,12 +559,55 @@ Fail:
   }\r
 }\r
 \r
+VOID\r
+CVfrCompiler::UpdateInfoForDynamicOpcode (\r
+  VOID\r
+  )\r
+{\r
+  SIfrRecord          *pRecord;\r
+\r
+  if (!gNeedAdjustOpcode) {\r
+    return;\r
+  }\r
+  \r
+  //\r
+  // Base on the original offset info to update the record list.\r
+  //\r
+  if (!gCIfrRecordInfoDB.IfrAdjustDynamicOpcodeInRecords()) {\r
+    DebugError (NULL, 0, 1001, "Error parsing vfr file", "Can find the offset in the record.");\r
+  }\r
+\r
+  //\r
+  // Base on the opcode binary length to recalculate the offset for each opcode.\r
+  //\r
+  gCIfrRecordInfoDB.IfrAdjustOffsetForRecord();\r
+\r
+  //\r
+  // Base on the offset to find the binary address.\r
+  //\r
+  pRecord = gCIfrRecordInfoDB.GetRecordInfoFromOffset(gAdjustOpcodeOffset);\r
+  while (pRecord != NULL) {\r
+    pRecord->mIfrBinBuf = gCFormPkg.GetBufAddrBaseOnOffset(pRecord->mOffset);\r
+    if (pRecord->mIfrBinBuf == NULL) {\r
+      DebugError (NULL, 0, 0001, "Error parsing vfr file", " 0x%X. offset not allocated.", pRecord->mOffset);\r
+    }\r
+    pRecord = pRecord->mNext;\r
+  }\r
+}\r
+\r
 VOID\r
 CVfrCompiler::AdjustBin (\r
   VOID\r
   )\r
 {\r
   EFI_VFR_RETURN_CODE Status;\r
+\r
+  if (!IS_RUN_STATUS(STATUS_COMPILEED)) {\r
+    return;\r
+  }\r
+\r
+  UpdateInfoForDynamicOpcode ();\r
+\r
   //\r
   // Check Binary Code consistent between Form and IfrRecord\r
   //\r
@@ -759,6 +808,8 @@ main (
   )\r
 {\r
   COMPILER_RUN_STATUS  Status;\r
+\r
+  SetPrintLevel(WARNING_LOG_LEVEL);\r
   CVfrCompiler         Compiler(Argc, Argv);\r
   \r
   Compiler.PreProcess();\r
index 1c83e87f5f5cf315726ff70d45248d809ab18d24..fe29f7e3af3c3e4f6573ef4ec9b3fbcb21e4a91c 100644 (file)
@@ -57,6 +57,7 @@ typedef struct {
   BOOLEAN CompatibleMode;\r
   BOOLEAN HasOverrideClassGuid;\r
   EFI_GUID OverrideClassGuid;\r
+  BOOLEAN WarningAsError;\r
 } OPTIONS;\r
 \r
 typedef enum {\r
@@ -87,6 +88,7 @@ private:
 \r
   VOID    SET_RUN_STATUS (IN COMPILER_RUN_STATUS);\r
   BOOLEAN IS_RUN_STATUS (IN COMPILER_RUN_STATUS);\r
+  VOID    UpdateInfoForDynamicOpcode (VOID);\r
 \r
 public:\r
   COMPILER_RUN_STATUS RunStatus (VOID) {\r
index b0f9197e36334084fa6248900f291b1f942ade4d..71305364f69ad2d2e4e7c185bcb8ed930b098ff9 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler error handler.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -45,17 +45,24 @@ static SVFR_ERROR_HANDLE VFR_ERROR_HANDLE_TABLE [] = {
   { VFR_RETURN_DATA_STRING_ERROR, ": data field string error or not support"},\r
   { VFR_RETURN_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},\r
   { VFR_RETURN_CONSTANT_ONLY, ": only constant is allowed in the expression"},\r
+  { VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR, ": Varstore name is defined by more than one varstores, it can't be referred as varstore, only varstore strucure name could be used."},\r
   { VFR_RETURN_CODEUNDEFINED, ": undefined Error Code" }\r
 };\r
 \r
+static SVFR_WARNING_HANDLE VFR_WARNING_HANDLE_TABLE [] = {\r
+  { VFR_WARNING_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},\r
+  { VFR_WARNING_CODEUNDEFINED, ": undefined Warning Code" }\r
+};\r
+\r
 CVfrErrorHandle::CVfrErrorHandle (\r
   VOID\r
   )\r
 {\r
-  mInputFileName       = NULL;\r
-  mScopeRecordListHead = NULL;\r
-  mScopeRecordListTail = NULL;\r
-  mVfrErrorHandleTable = VFR_ERROR_HANDLE_TABLE;\r
+  mInputFileName         = NULL;\r
+  mScopeRecordListHead   = NULL;\r
+  mScopeRecordListTail   = NULL;\r
+  mVfrErrorHandleTable   = VFR_ERROR_HANDLE_TABLE;\r
+  mVfrWarningHandleTable = VFR_WARNING_HANDLE_TABLE;\r
 }\r
 \r
 CVfrErrorHandle::~CVfrErrorHandle (\r
@@ -74,9 +81,18 @@ CVfrErrorHandle::~CVfrErrorHandle (
     delete pNode;\r
   }\r
 \r
-  mScopeRecordListHead = NULL;\r
-  mScopeRecordListTail = NULL;\r
-  mVfrErrorHandleTable = NULL;\r
+  mScopeRecordListHead   = NULL;\r
+  mScopeRecordListTail   = NULL;\r
+  mVfrErrorHandleTable   = NULL;\r
+  mVfrWarningHandleTable = NULL;\r
+}\r
+\r
+VOID\r
+CVfrErrorHandle::SetWarningAsError (\r
+  IN BOOLEAN  WarningAsError\r
+  )\r
+{\r
+  mWarningAsError = WarningAsError;\r
 }\r
 \r
 VOID\r
@@ -242,4 +258,41 @@ CVfrErrorHandle::HandleError (
   }\r
 }\r
 \r
+UINT8\r
+CVfrErrorHandle::HandleWarning (\r
+  IN EFI_VFR_WARNING_CODE WarningCode,\r
+  IN UINT32               LineNum,\r
+  IN CHAR8                *TokName\r
+  )\r
+{\r
+  UINT32                 Index;\r
+  CHAR8                  *FileName = NULL;\r
+  UINT32                 FileLine;\r
+  CONST CHAR8            *WarningMsg = NULL;\r
+\r
+  if (mVfrWarningHandleTable == NULL) {\r
+    return 1;\r
+  }\r
+\r
+  GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
+\r
+  if (mWarningAsError) {\r
+    Error (FileName, FileLine, 0x2220, "warning treated as error", NULL);\r
+  }\r
+\r
+  for (Index = 0; mVfrWarningHandleTable[Index].mWarningCode != VFR_WARNING_CODEUNDEFINED; Index++) {\r
+    if (WarningCode == mVfrWarningHandleTable[Index].mWarningCode) {\r
+      WarningMsg = mVfrWarningHandleTable[Index].mWarningMsg;\r
+      break;\r
+    }\r
+  }\r
+\r
+  if (WarningMsg != NULL) {\r
+    Warning (FileName, FileLine, 0, TokName, (CHAR8 *) "\t%s\n", (CHAR8 *) WarningMsg);\r
+    return 1;\r
+  } else {\r
+    return 0;\r
+  }\r
+}\r
+\r
 CVfrErrorHandle gCVfrErrorHandle;\r
index 258ae9b8af4ece7548ec23f104d5e601ff74c2be..8e73e2e99732cffabc682555c8b0caf39b0ac617 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler Error definition\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -43,14 +43,25 @@ typedef enum {
   VFR_RETURN_DATA_STRING_ERROR,\r
   VFR_RETURN_DEFAULT_VALUE_REDEFINED,\r
   VFR_RETURN_CONSTANT_ONLY,\r
+  VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR,\r
   VFR_RETURN_CODEUNDEFINED\r
 } EFI_VFR_RETURN_CODE;\r
 \r
+typedef enum {\r
+  VFR_WARNING_DEFAULT_VALUE_REDEFINED = 0,\r
+  VFR_WARNING_CODEUNDEFINED\r
+} EFI_VFR_WARNING_CODE;\r
+\r
 typedef struct _SVFR_ERROR_HANDLE {\r
   EFI_VFR_RETURN_CODE    mErrorCode;\r
   CONST CHAR8            *mErrorMsg;\r
 } SVFR_ERROR_HANDLE;\r
 \r
+typedef struct _SVFR_WARNING_HANDLE {\r
+  EFI_VFR_WARNING_CODE    mWarningCode;\r
+  CONST CHAR8            *mWarningMsg;\r
+} SVFR_WARNING_HANDLE;\r
+\r
 struct SVfrFileScopeRecord {\r
   CHAR8                 *mFileName;\r
   UINT32                mWholeScopeLine;\r
@@ -65,17 +76,21 @@ class CVfrErrorHandle {
 private:\r
   CHAR8               *mInputFileName;\r
   SVFR_ERROR_HANDLE   *mVfrErrorHandleTable;\r
+  SVFR_WARNING_HANDLE *mVfrWarningHandleTable;\r
   SVfrFileScopeRecord *mScopeRecordListHead;\r
   SVfrFileScopeRecord *mScopeRecordListTail;\r
+  BOOLEAN             mWarningAsError;\r
 \r
 public:\r
   CVfrErrorHandle (VOID);\r
   ~CVfrErrorHandle (VOID);\r
 \r
+  VOID  SetWarningAsError (IN BOOLEAN);\r
   VOID  SetInputFile (IN CHAR8 *);\r
   VOID  ParseFileScopeRecord (IN CHAR8 *, IN UINT32);\r
   VOID  GetFileNameLineNum (IN UINT32, OUT CHAR8 **, OUT UINT32 *);\r
   UINT8 HandleError (IN EFI_VFR_RETURN_CODE, IN UINT32 LineNum = 0, IN CHAR8 *TokName = NULL);\r
+  UINT8 HandleWarning (IN EFI_VFR_WARNING_CODE, IN UINT32 LineNum = 0, IN CHAR8 *TokName = NULL);\r
   VOID  PrintMsg (IN UINT32 LineNum = 0, IN CHAR8 *TokName = NULL, IN CONST CHAR8 *MsgType = "Error", IN CONST CHAR8 *ErrorMsg = "");\r
 };\r
 \r
index 2e859b8dfa626826c668d2697bc6de921af26bd2..7cadf0f42b892654f10ea291add71a999b288b04 100644 (file)
@@ -2,7 +2,7 @@
   \r
   The definition of CFormPkg's member function\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -152,12 +152,39 @@ CFormPkg::~CFormPkg ()
   PendingAssignList = NULL;\r
 }\r
 \r
+SBufferNode *\r
+CFormPkg::CreateNewNode (\r
+  VOID\r
+  )\r
+{\r
+  SBufferNode *Node;\r
+\r
+  Node = new SBufferNode;\r
+  if (Node == NULL) {\r
+    return NULL;\r
+  }\r
+\r
+  Node->mBufferStart = new CHAR8[mBufferSize];\r
+  if (Node->mBufferStart == NULL) {\r
+    delete Node;\r
+    return NULL;\r
+  } else {\r
+    memset (Node->mBufferStart, 0, mBufferSize);\r
+    Node->mBufferEnd  = Node->mBufferStart + mBufferSize;\r
+    Node->mBufferFree = Node->mBufferStart;\r
+    Node->mNext       = NULL;\r
+  }\r
+\r
+  return Node;\r
+}\r
+\r
 CHAR8 *\r
 CFormPkg::IfrBinBufferGet (\r
   IN UINT32 Len\r
   )\r
 {\r
-  CHAR8 *BinBuffer = NULL;\r
+  CHAR8       *BinBuffer = NULL;\r
+  SBufferNode *Node      = NULL;\r
 \r
   if ((Len == 0) || (Len > mBufferSize)) {\r
     return NULL;\r
@@ -167,24 +194,11 @@ CFormPkg::IfrBinBufferGet (
     BinBuffer = mCurrBufferNode->mBufferFree;\r
     mCurrBufferNode->mBufferFree += Len;\r
   } else {\r
-    SBufferNode *Node;\r
-\r
-    Node = new SBufferNode;\r
+    Node = CreateNewNode ();\r
     if (Node == NULL) {\r
       return NULL;\r
     }\r
 \r
-    Node->mBufferStart = new CHAR8[mBufferSize];\r
-    if (Node->mBufferStart == NULL) {\r
-      delete Node;\r
-      return NULL;\r
-    } else {\r
-      memset (Node->mBufferStart, 0, mBufferSize);\r
-      Node->mBufferEnd  = Node->mBufferStart + mBufferSize;\r
-      Node->mBufferFree = Node->mBufferStart;\r
-      Node->mNext       = NULL;\r
-    }\r
-\r
     if (mBufferNodeQueueTail == NULL) {\r
       mBufferNodeQueueHead = mBufferNodeQueueTail = Node;\r
     } else {\r
@@ -245,7 +259,7 @@ CFormPkg::Read (
   }\r
 \r
   if (mReadBufferNode == NULL) {\r
-       return 0;\r
+    return 0;\r
   }\r
 \r
   for (Index = 0; Index < Size; Index++) {\r
@@ -256,7 +270,7 @@ CFormPkg::Read (
         return Index;\r
       } else {\r
         mReadBufferOffset = 0;\r
-        Buffer[Index] = mReadBufferNode->mBufferStart[mReadBufferOffset++];\r
+        Index --;\r
       }\r
     }\r
   }\r
@@ -402,6 +416,9 @@ CFormPkg::_WRITE_PKG_END (
 }\r
 \r
 #define BYTES_PRE_LINE 0x10\r
+UINT32   gAdjustOpcodeOffset = 0;\r
+BOOLEAN  gNeedAdjustOpcode   = FALSE;\r
+UINT32   gAdjustOpcodeLen    = 0;\r
 \r
 EFI_VFR_RETURN_CODE \r
 CFormPkg::GenCFile (\r
@@ -548,13 +565,236 @@ CFormPkg::PendingAssignPrintAll (
   }\r
 }\r
 \r
+SBufferNode *\r
+CFormPkg::GetBinBufferNodeForAddr (\r
+  IN CHAR8              *BinBuffAddr\r
+  )\r
+{\r
+  SBufferNode *TmpNode;\r
+\r
+  TmpNode = mBufferNodeQueueHead;\r
+\r
+  while (TmpNode != NULL) {\r
+    if (TmpNode->mBufferStart <= BinBuffAddr && TmpNode->mBufferFree >= BinBuffAddr) {\r
+      return TmpNode;\r
+    }\r
+\r
+    TmpNode = TmpNode->mNext;\r
+  }\r
+\r
+  return NULL;\r
+}\r
+\r
+SBufferNode *\r
+CFormPkg::GetNodeBefore(\r
+  IN SBufferNode *CurrentNode\r
+  )\r
+{\r
+  SBufferNode *FirstNode   = mBufferNodeQueueHead;\r
+  SBufferNode *LastNode    = mBufferNodeQueueHead;\r
+\r
+  while (FirstNode != NULL) {\r
+    if (FirstNode == CurrentNode) {\r
+      break;\r
+    }\r
+\r
+    LastNode    = FirstNode;\r
+    FirstNode   = FirstNode->mNext;\r
+  }\r
+\r
+  if (FirstNode == NULL) {\r
+    LastNode = NULL;\r
+  }\r
+\r
+  return LastNode;\r
+}\r
+\r
+EFI_VFR_RETURN_CODE\r
+CFormPkg::InsertNodeBefore(\r
+  IN SBufferNode *CurrentNode,\r
+  IN SBufferNode *NewNode\r
+  )\r
+{\r
+  SBufferNode *LastNode = GetNodeBefore (CurrentNode);\r
+\r
+  if (LastNode == NULL) {\r
+    return VFR_RETURN_MISMATCHED;\r
+  }\r
+\r
+  NewNode->mNext = LastNode->mNext;\r
+  LastNode->mNext = NewNode;\r
+\r
+  return VFR_RETURN_SUCCESS;\r
+}\r
+\r
+CHAR8 *\r
+CFormPkg::GetBufAddrBaseOnOffset (\r
+  IN UINT32      Offset\r
+  )\r
+{\r
+  SBufferNode *TmpNode;\r
+  UINT32      TotalBufLen;\r
+  UINT32      CurrentBufLen;\r
+\r
+  TotalBufLen = 0;\r
+\r
+  for (TmpNode = mBufferNodeQueueHead; TmpNode != NULL; TmpNode = TmpNode->mNext) {\r
+    CurrentBufLen = TmpNode->mBufferFree - TmpNode->mBufferStart;\r
+    if (Offset >= TotalBufLen && Offset < TotalBufLen + CurrentBufLen) {\r
+      return TmpNode->mBufferStart + (Offset - TotalBufLen);\r
+    }\r
+\r
+    TotalBufLen += CurrentBufLen;\r
+  }\r
+\r
+  return NULL;\r
+}\r
+\r
+EFI_VFR_RETURN_CODE\r
+CFormPkg::AdjustDynamicInsertOpcode (\r
+  IN CHAR8              *LastFormEndAddr,\r
+  IN CHAR8              *InsertOpcodeAddr\r
+  )\r
+{\r
+  SBufferNode *LastFormEndNode;\r
+  SBufferNode *InsertOpcodeNode;\r
+  SBufferNode *NewRestoreNodeBegin;\r
+  SBufferNode *NewRestoreNodeEnd;\r
+  SBufferNode *NewLastEndNode;\r
+  SBufferNode *TmpNode;\r
+  UINT32      NeedRestoreCodeLen;\r
+\r
+  NewRestoreNodeEnd = NULL;\r
+\r
+  LastFormEndNode  = GetBinBufferNodeForAddr(LastFormEndAddr);\r
+  InsertOpcodeNode = GetBinBufferNodeForAddr(InsertOpcodeAddr);\r
+\r
+  if (LastFormEndNode == InsertOpcodeNode) {\r
+    //\r
+    // Create New Node to save the restore opcode.\r
+    //\r
+    NeedRestoreCodeLen = InsertOpcodeAddr - LastFormEndAddr;\r
+    gAdjustOpcodeLen   = NeedRestoreCodeLen;\r
+    NewRestoreNodeBegin = CreateNewNode ();\r
+    if (NewRestoreNodeBegin == NULL) {\r
+      return VFR_RETURN_OUT_FOR_RESOURCES;\r
+    }\r
+    memcpy (NewRestoreNodeBegin->mBufferFree, LastFormEndAddr, NeedRestoreCodeLen);\r
+    NewRestoreNodeBegin->mBufferFree += NeedRestoreCodeLen;\r
+\r
+    //\r
+    // Override the restore buffer data.\r
+    //\r
+    memcpy (LastFormEndAddr, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr);\r
+    InsertOpcodeNode->mBufferFree -= NeedRestoreCodeLen;\r
+    memset (InsertOpcodeNode->mBufferFree, 0, NeedRestoreCodeLen);\r
+  } else {\r
+    //\r
+    // Create New Node to save the restore opcode.\r
+    //\r
+    NeedRestoreCodeLen = LastFormEndNode->mBufferFree - LastFormEndAddr;\r
+    gAdjustOpcodeLen   = NeedRestoreCodeLen;\r
+    NewRestoreNodeBegin = CreateNewNode ();\r
+    if (NewRestoreNodeBegin == NULL) {\r
+      return VFR_RETURN_OUT_FOR_RESOURCES;\r
+    }\r
+    memcpy (NewRestoreNodeBegin->mBufferFree, LastFormEndAddr, NeedRestoreCodeLen);\r
+    NewRestoreNodeBegin->mBufferFree += NeedRestoreCodeLen;\r
+    //\r
+    // Override the restore buffer data.\r
+    //\r
+    LastFormEndNode->mBufferFree -= NeedRestoreCodeLen;\r
+    //\r
+    // Link the restore data to new node.\r
+    //\r
+    NewRestoreNodeBegin->mNext = LastFormEndNode->mNext;\r
+\r
+    //\r
+    // Count the Adjust opcode len.\r
+    //\r
+    TmpNode = LastFormEndNode->mNext;\r
+    while (TmpNode != InsertOpcodeNode) {\r
+      gAdjustOpcodeLen += TmpNode->mBufferFree - TmpNode->mBufferStart;\r
+      TmpNode = TmpNode->mNext;\r
+    }\r
+\r
+    //\r
+    // Create New Node to save the last node of restore opcode.\r
+    //\r
+    NeedRestoreCodeLen = InsertOpcodeAddr - InsertOpcodeNode->mBufferStart;\r
+    gAdjustOpcodeLen  += NeedRestoreCodeLen;\r
+    if (NeedRestoreCodeLen > 0) {\r
+      NewRestoreNodeEnd = CreateNewNode ();\r
+      if (NewRestoreNodeEnd == NULL) {\r
+        return VFR_RETURN_OUT_FOR_RESOURCES;\r
+      }\r
+      memcpy (NewRestoreNodeEnd->mBufferFree, InsertOpcodeNode->mBufferStart, NeedRestoreCodeLen);\r
+      NewRestoreNodeEnd->mBufferFree += NeedRestoreCodeLen;\r
+      //\r
+      // Override the restore buffer data.\r
+      //\r
+      memcpy (InsertOpcodeNode->mBufferStart, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr);\r
+      InsertOpcodeNode->mBufferFree -= InsertOpcodeAddr - InsertOpcodeNode->mBufferStart;\r
+\r
+      //\r
+      // Insert the last restore data node.\r
+      //\r
+      TmpNode = GetNodeBefore (InsertOpcodeNode);\r
+      if (TmpNode == LastFormEndNode) {\r
+        NewRestoreNodeBegin->mNext = NewRestoreNodeEnd;\r
+      } else {\r
+        TmpNode->mNext = NewRestoreNodeEnd;\r
+      }\r
+      //\r
+      // Connect the dynamic opcode node to the node before last form end node.\r
+      //\r
+      LastFormEndNode->mNext = InsertOpcodeNode;\r
+    }\r
+  }\r
+\r
+  if (mBufferNodeQueueTail->mBufferFree - mBufferNodeQueueTail->mBufferStart > 2) {\r
+    //\r
+    // End form set opcode all in the mBufferNodeQueueTail node.\r
+    //\r
+    NewLastEndNode = CreateNewNode ();\r
+    if (NewLastEndNode == NULL) {\r
+      return VFR_RETURN_OUT_FOR_RESOURCES;\r
+    }\r
+    NewLastEndNode->mBufferStart[0] = 0x29;\r
+    NewLastEndNode->mBufferStart[1] = 0x02;\r
+    NewLastEndNode->mBufferFree += 2;\r
+\r
+    mBufferNodeQueueTail->mBufferFree -= 2;\r
+\r
+    mBufferNodeQueueTail->mNext = NewRestoreNodeBegin;\r
+    if (NewRestoreNodeEnd != NULL) {\r
+      NewRestoreNodeEnd->mNext = NewLastEndNode;\r
+    } else {\r
+      NewRestoreNodeBegin->mNext = NewLastEndNode;\r
+    }\r
+\r
+    mBufferNodeQueueTail = NewLastEndNode;\r
+  } else if (mBufferNodeQueueTail->mBufferFree - mBufferNodeQueueTail->mBufferStart == 2) {\r
+    TmpNode = GetNodeBefore(mBufferNodeQueueTail);\r
+    TmpNode->mNext = NewRestoreNodeBegin;\r
+    if (NewRestoreNodeEnd != NULL) {\r
+      NewRestoreNodeEnd->mNext = mBufferNodeQueueTail;\r
+    } else {\r
+      NewRestoreNodeBegin->mNext = mBufferNodeQueueTail;\r
+    }\r
+  }\r
+\r
+  return VFR_RETURN_SUCCESS;\r
+}\r
+\r
 EFI_VFR_RETURN_CODE\r
 CFormPkg::DeclarePendingQuestion (\r
   IN CVfrVarDataTypeDB   &lCVfrVarDataTypeDB,\r
   IN CVfrDataStorage     &lCVfrDataStorage,\r
   IN CVfrQuestionDB      &lCVfrQuestionDB,\r
   IN EFI_GUID            *LocalFormSetGuid,\r
-  IN UINT32 LineNo\r
+  IN UINT32              LineNo,\r
+  OUT CHAR8              **InsertOpcodeAddr\r
   )\r
 {\r
   SPendingAssign *pNode;\r
@@ -563,8 +803,10 @@ CFormPkg::DeclarePendingQuestion (
   CHAR8          FName[MAX_NAME_LEN];\r
   CHAR8          *SName;\r
   CHAR8          *NewStr;\r
+  UINT32         ShrinkSize;\r
   EFI_VFR_RETURN_CODE  ReturnCode;\r
   EFI_VFR_VARSTORE_TYPE VarStoreType  = EFI_VFR_VARSTORE_INVALID;\r
+  EFI_VARSTORE_ID       VarStoreId    = EFI_VARSTORE_ID_INVALID;\r
 \r
   //\r
   // Declare all questions as Numeric in DisableIf True\r
@@ -572,6 +814,7 @@ CFormPkg::DeclarePendingQuestion (
   // DisableIf\r
   CIfrDisableIf DIObj;\r
   DIObj.SetLineNo (LineNo);\r
+  *InsertOpcodeAddr = DIObj.GetObjBinAddr ();\r
   \r
   //TrueOpcode\r
   CIfrTrue TObj (LineNo);\r
@@ -581,7 +824,7 @@ CFormPkg::DeclarePendingQuestion (
     if (pNode->mFlag == PENDING) {\r
       CIfrNumeric CNObj;\r
       EFI_VARSTORE_INFO Info; \r
-         EFI_QUESTION_ID   QId   = EFI_QUESTION_ID_INVALID;\r
+      EFI_QUESTION_ID   QId   = EFI_QUESTION_ID_INVALID;\r
 \r
       CNObj.SetLineNo (LineNo);\r
       CNObj.SetPrompt (0x0);\r
@@ -611,7 +854,7 @@ CFormPkg::DeclarePendingQuestion (
       //\r
       // Get VarStoreType\r
       //\r
-      ReturnCode = lCVfrDataStorage.GetVarStoreType (FName, VarStoreType);\r
+      ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId);\r
       if (ReturnCode == VFR_RETURN_UNDEFINED) {\r
         lCVfrDataStorage.DeclareBufferVarStore (\r
                            FName, \r
@@ -621,18 +864,13 @@ CFormPkg::DeclarePendingQuestion (
                            EFI_VARSTORE_ID_INVALID,\r
                            FALSE\r
                            );\r
-        ReturnCode = lCVfrDataStorage.GetVarStoreType (FName, VarStoreType);  \r
+        ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId, LocalFormSetGuid); \r
       }\r
       if (ReturnCode != VFR_RETURN_SUCCESS) {\r
         gCVfrErrorHandle.PrintMsg (pNode->mLineNo, FName, "Error", "Var Store Type is not defined");\r
         return ReturnCode;\r
       }\r
-      \r
-      ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId);\r
-      if (ReturnCode != VFR_RETURN_SUCCESS) {\r
-        gCVfrErrorHandle.PrintMsg (pNode->mLineNo, FName, "Error", "Var Store Type is not defined");\r
-        return ReturnCode;\r
-      }\r
+      VarStoreType = lCVfrDataStorage.GetVarStoreType (Info.mVarStoreId); \r
 \r
       if (*VarStr == '\0' && ArrayIdx != INVALID_ARRAY_INDEX) {\r
         ReturnCode = lCVfrDataStorage.GetNameVarStoreInfo (&Info, ArrayIdx);\r
@@ -642,7 +880,7 @@ CFormPkg::DeclarePendingQuestion (
         } else if (VarStoreType == EFI_VFR_VARSTORE_BUFFER) {\r
           VarStr = pNode->mKey;\r
           //convert VarStr with store name to VarStr with structure name\r
-          ReturnCode = lCVfrDataStorage.GetBufferVarStoreDataTypeName (FName, &SName);\r
+          ReturnCode = lCVfrDataStorage.GetBufferVarStoreDataTypeName (Info.mVarStoreId, &SName);\r
           if (ReturnCode == VFR_RETURN_SUCCESS) {\r
             NewStr = new CHAR8[strlen (VarStr) + strlen (SName) + 1];\r
             NewStr[0] = '\0';\r
@@ -676,19 +914,24 @@ CFormPkg::DeclarePendingQuestion (
       switch (Info.mVarType) {\r
       case EFI_IFR_TYPE_NUM_SIZE_64:\r
         CNObj.SetMinMaxStepData ((UINT64) 0, (UINT64) -1 , (UINT64) 0);\r
+        ShrinkSize = 0;\r
         break;\r
       case EFI_IFR_TYPE_NUM_SIZE_32:\r
         CNObj.SetMinMaxStepData ((UINT32) 0, (UINT32) -1 , (UINT32) 0);\r
+        ShrinkSize = 12;\r
         break;\r
       case EFI_IFR_TYPE_NUM_SIZE_16:\r
         CNObj.SetMinMaxStepData ((UINT16) 0, (UINT16) -1 , (UINT16) 0);\r
+        ShrinkSize = 18;\r
         break;\r
       case EFI_IFR_TYPE_NUM_SIZE_8:\r
         CNObj.SetMinMaxStepData ((UINT8) 0, (UINT8) -1 , (UINT8) 0);\r
+        ShrinkSize = 21;\r
         break;\r
       default:\r
         break;\r
       }\r
+      CNObj.ShrinkBinSize (ShrinkSize);\r
 \r
       //\r
       // For undefined Efi VarStore type question\r
@@ -698,7 +941,7 @@ CFormPkg::DeclarePendingQuestion (
         CIfrVarEqName CVNObj (QId, Info.mInfo.mVarName);\r
         CVNObj.SetLineNo (LineNo);\r
       }\r
-      \r
+\r
       //\r
       // End for Numeric\r
       //\r
@@ -983,6 +1226,94 @@ CIfrRecordInfoDB::GetOpcodeQuestionId (
   return QuestionHead->QuestionId;\r
 }\r
 \r
+SIfrRecord *\r
+CIfrRecordInfoDB::GetRecordInfoFromOffset (\r
+  IN UINT32 Offset\r
+  )\r
+{\r
+  SIfrRecord *pNode = NULL;\r
+\r
+  for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {\r
+    if (pNode->mOffset == Offset) {\r
+      return pNode;\r
+    }\r
+  }\r
+\r
+  return pNode;\r
+}\r
+\r
+/*\r
+  Add just the op code position.\r
+\r
+  From\r
+  \r
+  | form end opcode + end of if opcode for form ... + Dynamic opcode + form set end opcode |\r
+  \r
+  To\r
+  \r
+  | Dynamic opcode + form end opcode + end of if opcode for form ... + form set end opcode |\r
+\r
+*/\r
+BOOLEAN\r
+CIfrRecordInfoDB::IfrAdjustDynamicOpcodeInRecords (\r
+  VOID\r
+  )\r
+{\r
+  UINT32             OpcodeOffset;\r
+  SIfrRecord         *pNode, *pPreNode;\r
+  SIfrRecord         *pStartNode, *pNodeBeforeStart;\r
+  SIfrRecord         *pEndNode;\r
+  \r
+  pStartNode = NULL;\r
+  pEndNode   = NULL;\r
+  OpcodeOffset = 0;\r
+\r
+  //\r
+  // Base on the offset info to get the node.\r
+  //\r
+  for (pNode = mIfrRecordListHead; pNode->mNext != NULL; pPreNode = pNode,pNode = pNode->mNext) {\r
+    if (OpcodeOffset == gAdjustOpcodeOffset) {\r
+      pStartNode       = pNode;\r
+      pNodeBeforeStart = pPreNode;\r
+    } else if (OpcodeOffset == gAdjustOpcodeOffset + gAdjustOpcodeLen) {\r
+      pEndNode = pPreNode;\r
+    }\r
+\r
+    OpcodeOffset += pNode->mBinBufLen;\r
+  }\r
+\r
+  //\r
+  // Check the value.\r
+  //\r
+  if (pEndNode == NULL || pStartNode == NULL) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // Adjust the node. pPreNode save the Node before mIfrRecordListTail\r
+  //\r
+  pNodeBeforeStart->mNext = pEndNode->mNext;\r
+  pPreNode->mNext = pStartNode;\r
+  pEndNode->mNext = mIfrRecordListTail;\r
+\r
+  return TRUE;\r
+}\r
+\r
+VOID\r
+CIfrRecordInfoDB::IfrAdjustOffsetForRecord (\r
+  VOID\r
+  )\r
+{\r
+  UINT32             OpcodeOffset;\r
+  SIfrRecord         *pNode;\r
+\r
+  OpcodeOffset = 0;\r
+  for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {\r
+    pNode->mOffset = OpcodeOffset;\r
+    OpcodeOffset += pNode->mBinBufLen;\r
+  }\r
+}\r
+\r
 EFI_VFR_RETURN_CODE\r
 CIfrRecordInfoDB::IfrRecordAdjust (\r
   VOID\r
@@ -1195,11 +1526,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
   // Update Ifr Opcode Offset\r
   //\r
   if (Status == VFR_RETURN_SUCCESS) {\r
-    OpcodeOffset = 0;\r
-    for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {\r
-      pNode->mOffset = OpcodeOffset;\r
-      OpcodeOffset += pNode->mBinBufLen;\r
-    }\r
+    IfrAdjustOffsetForRecord ();\r
   }\r
   return Status;\r
 }\r
@@ -1344,7 +1671,7 @@ 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_MODAL_TAG), 0},            // EFI_IFR_MODAL_TAG_OP - 0x61\r
   { sizeof (EFI_IFR_REFRESH_ID), 0},           // EFI_IFR_REFRESH_ID_OP - 0x62\r
 };\r
 \r
@@ -1368,7 +1695,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",   "EFI_IFR_MODAL",                "EFI_IFR_REFRESH_ID",\r
+  "EFI_IFR_SECURITY",   "EFI_IFR_MODAL_TAG",            "EFI_IFR_REFRESH_ID",\r
 };\r
 \r
 VOID\r
index 5f4d87aa0ab7e09dd174d3cb21a802732db5dddb..614471060d7b16a1169bc5d8bf0c94a2617099a0 100644 (file)
@@ -2,7 +2,7 @@
   \r
   The definition of CFormPkg's member function\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -115,6 +115,10 @@ private:
 \r
   VOID                _WRITE_PKG_LINE (IN FILE *, IN UINT32 , IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);\r
   VOID                _WRITE_PKG_END (IN FILE *, IN UINT32 , IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);\r
+  SBufferNode *       GetBinBufferNodeForAddr (IN CHAR8 *);\r
+  SBufferNode *       CreateNewNode ();\r
+  SBufferNode *       GetNodeBefore (IN SBufferNode *);\r
+  EFI_VFR_RETURN_CODE InsertNodeBefore (IN SBufferNode *, IN SBufferNode *);\r
 \r
 private:\r
   SPendingAssign      *PendingAssignList;\r
@@ -145,12 +149,22 @@ public:
     IN CVfrDataStorage     &lCVfrDataStorage,\r
     IN CVfrQuestionDB      &lCVfrQuestionDB,\r
     IN EFI_GUID            *LocalFormSetGuid,\r
-    IN UINT32 LineNo\r
+    IN UINT32              LineNo,\r
+    OUT CHAR8              **InsertOpcodeAddr\r
+    );\r
+  EFI_VFR_RETURN_CODE AdjustDynamicInsertOpcode (\r
+    IN CHAR8              *LastFormEndAddr,\r
+    IN CHAR8              *InsertOpcodeAddr\r
+    );\r
+  CHAR8 *             GetBufAddrBaseOnOffset (\r
+    IN UINT32             Offset\r
     );\r
 };\r
 \r
 extern CFormPkg       gCFormPkg;\r
 extern CVfrStringDB   gCVfrStringDB;\r
+extern UINT32         gAdjustOpcodeOffset;\r
+extern BOOLEAN        gNeedAdjustOpcode;\r
 \r
 struct SIfrRecord {\r
   UINT32     mLineNo;\r
@@ -189,6 +203,10 @@ public:
     mSwitch = FALSE;\r
   }\r
 \r
+  SIfrRecord * GetRecordInfoFromOffset (IN UINT32);\r
+  VOID        IfrAdjustOffsetForRecord (VOID);\r
+  BOOLEAN     IfrAdjustDynamicOpcodeInRecords (VOID);\r
+\r
   UINT32      IfrRecordRegister (IN UINT32, IN CHAR8 *, IN UINT8, IN UINT32);\r
   VOID        IfrRecordInfoUpdate (IN UINT32, IN UINT32, IN CHAR8*, IN UINT8, IN UINT32);\r
   VOID        IfrRecordOutput (IN FILE *, IN UINT32 LineNo);\r
@@ -227,6 +245,10 @@ public:
     return mObjBinBuf;\r
   }\r
 \r
+  inline UINT32 GetObjBinOffset (VOID) {\r
+    return mPkgOffset;\r
+  }\r
+\r
   inline UINT8   GetObjBinLen (VOID) {\r
     return mObjBinLen;\r
   }\r
@@ -411,6 +433,10 @@ public:
 \r
     return _FLAGS_ZERO (Flags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;\r
   }\r
+\r
+  VOID UpdateCIfrQuestionHeader (IN EFI_IFR_QUESTION_HEADER *Header) {\r
+    mHeader = Header;\r
+  }\r
 };\r
 \r
 /*\r
@@ -561,6 +587,10 @@ public:
   BOOLEAN IsNumericOpcode () {\r
     return IsNumeric;\r
   }\r
+\r
+  VOID UpdateCIfrMinMaxStepData (IN MINMAXSTEP_DATA *MinMaxStepData) {\r
+    mMinMaxStepData = MinMaxStepData;\r
+  }\r
 };\r
 \r
 static CIfrQuestionHeader *gCurrentQuestion  = NULL;\r
@@ -858,7 +888,7 @@ public:
 \r
 class CIfrModal : public CIfrObj, public CIfrOpHeader {\r
 private:\r
-  EFI_IFR_MODAL *mModal;\r
+  EFI_IFR_MODAL_TAG *mModal;\r
 \r
 public:\r
   CIfrModal () : CIfrObj (EFI_IFR_MODAL_TAG_OP, (CHAR8 **)&mModal),\r
@@ -900,14 +930,15 @@ private:
 \r
 public:\r
   CIfrDefault (\r
+    IN UINT8              Size,\r
     IN UINT16             DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD,\r
     IN UINT8              Type      = EFI_IFR_TYPE_OTHER,\r
     IN EFI_IFR_TYPE_VALUE Value     = gZeroEfiIfrTypeValue\r
-    ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault),\r
-        CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header) {\r
+    ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault, Size),\r
+        CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, Size) {\r
     mDefault->Type      = Type;\r
-    mDefault->Value     = Value;\r
     mDefault->DefaultId = DefaultId;\r
+    memcpy (&(mDefault->Value), &Value, Size - OFFSET_OF (EFI_IFR_DEFAULT, Value));\r
   }\r
 \r
   VOID SetDefaultId (IN UINT16 DefaultId) {\r
@@ -919,7 +950,30 @@ public:
   }\r
 \r
   VOID SetValue (IN EFI_IFR_TYPE_VALUE Value) {\r
-    mDefault->Value = Value;\r
+    memcpy (&mDefault->Value, &Value, mDefault->Header.Length - OFFSET_OF (EFI_IFR_DEFAULT, Value));\r
+  }\r
+};\r
+\r
+class CIfrDefault2 : public CIfrObj, public CIfrOpHeader {\r
+private:\r
+  EFI_IFR_DEFAULT_2 *mDefault;\r
+\r
+public:\r
+  CIfrDefault2 (\r
+    IN UINT16             DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD,\r
+    IN UINT8              Type      = EFI_IFR_TYPE_OTHER\r
+    ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault, sizeof (EFI_IFR_DEFAULT_2)),\r
+        CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, sizeof (EFI_IFR_DEFAULT_2)) {\r
+    mDefault->Type      = Type;\r
+    mDefault->DefaultId = DefaultId;\r
+  }\r
+\r
+  VOID SetDefaultId (IN UINT16 DefaultId) {\r
+    mDefault->DefaultId = DefaultId;\r
+  }\r
+\r
+  VOID SetType (IN UINT8 Type) {\r
+    mDefault->Type = Type;\r
   }\r
 };\r
 \r
@@ -1254,7 +1308,7 @@ private:
   EFI_IFR_NUMERIC *mNumeric;\r
 \r
 public:\r
-  CIfrNumeric () : CIfrObj (EFI_IFR_NUMERIC_OP, (CHAR8 **)&mNumeric),\r
+  CIfrNumeric () : CIfrObj (EFI_IFR_NUMERIC_OP, (CHAR8 **)&mNumeric, sizeof (EFI_IFR_NUMERIC), TRUE),\r
                    CIfrOpHeader (EFI_IFR_NUMERIC_OP, &mNumeric->Header),\r
                    CIfrQuestionHeader (&mNumeric->Question),\r
                    CIfrMinMaxStepData (&mNumeric->data, TRUE) {\r
@@ -1268,6 +1322,27 @@ public:
     gCurrentMinMaxData = NULL;\r
   }\r
 \r
+  VOID ShrinkBinSize (IN UINT16 Size) {\r
+    //\r
+    // Update the buffer size which is truly be used later.\r
+    //\r
+    ShrinkObjBin(Size);\r
+    DecLength(Size);\r
+\r
+    //\r
+    // Allocate buffer in gCFormPkg.\r
+    //\r
+    _EMIT_PENDING_OBJ();\r
+\r
+    //\r
+    // Update the buffer pointer used by other class.\r
+    //\r
+    mNumeric = (EFI_IFR_NUMERIC *) GetObjBinAddr();\r
+    UpdateHeader (&mNumeric->Header);\r
+    UpdateCIfrQuestionHeader(&mNumeric->Question);\r
+    UpdateCIfrMinMaxStepData(&mNumeric->data);\r
+  }\r
+\r
   EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {\r
     EFI_VFR_RETURN_CODE Ret;\r
 \r
@@ -1290,7 +1365,7 @@ private:
   EFI_IFR_ONE_OF *mOneOf;\r
 \r
 public:\r
-  CIfrOneOf () : CIfrObj (EFI_IFR_ONE_OF_OP, (CHAR8 **)&mOneOf),\r
+  CIfrOneOf () : CIfrObj (EFI_IFR_ONE_OF_OP, (CHAR8 **)&mOneOf, sizeof (EFI_IFR_ONE_OF), TRUE),\r
                  CIfrOpHeader (EFI_IFR_ONE_OF_OP, &mOneOf->Header),\r
                  CIfrQuestionHeader (&mOneOf->Question),\r
                  CIfrMinMaxStepData (&mOneOf->data) {\r
@@ -1319,6 +1394,27 @@ public:
     }\r
     return VFR_RETURN_SUCCESS;\r
   }\r
+\r
+  VOID ShrinkBinSize (IN UINT16 Size) {\r
+    //\r
+    // Update the buffer size which is truly be used later.\r
+    //\r
+    ShrinkObjBin(Size);\r
+    DecLength(Size);\r
+\r
+    //\r
+    // Allocate buffer in gCFormPkg.\r
+    //\r
+    _EMIT_PENDING_OBJ();\r
+\r
+    //\r
+    // Update the buffer pointer used by other class.\r
+    //\r
+    mOneOf = (EFI_IFR_ONE_OF *) GetObjBinAddr();\r
+    UpdateHeader (&mOneOf->Header);\r
+    UpdateCIfrQuestionHeader(&mOneOf->Question);\r
+    UpdateCIfrMinMaxStepData(&mOneOf->data);\r
+  }\r
 };\r
 \r
 class CIfrString : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {\r
@@ -1581,12 +1677,12 @@ private:
   EFI_IFR_ONE_OF_OPTION *mOneOfOption;\r
 \r
 public:\r
-  CIfrOneOfOption () : CIfrObj (EFI_IFR_ONE_OF_OPTION_OP, (CHAR8 **)&mOneOfOption),\r
-                       CIfrOpHeader (EFI_IFR_ONE_OF_OPTION_OP, &mOneOfOption->Header) {\r
+  CIfrOneOfOption (UINT8 Size) : CIfrObj (EFI_IFR_ONE_OF_OPTION_OP, (CHAR8 **)&mOneOfOption, Size),\r
+                       CIfrOpHeader (EFI_IFR_ONE_OF_OPTION_OP, &mOneOfOption->Header, Size) {\r
     mOneOfOption->Flags  = 0;\r
     mOneOfOption->Option = EFI_STRING_ID_INVALID;\r
     mOneOfOption->Type   = EFI_IFR_TYPE_OTHER;\r
-    memset (&mOneOfOption->Value, 0, sizeof (mOneOfOption->Value));\r
+    memset (&mOneOfOption->Value, 0, Size - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));\r
   }\r
 \r
   VOID SetOption (IN EFI_STRING_ID Option) {\r
@@ -1639,7 +1735,7 @@ public:
   }\r
 \r
   VOID SetValue (IN EFI_IFR_TYPE_VALUE Value) {\r
-    mOneOfOption->Value = Value;\r
+    memcpy (&mOneOfOption->Value, &Value, mOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));\r
   }\r
 \r
   UINT8 GetFlags (VOID) {\r
index d55a80672be10fac8b3804492d06b81fe848538c..253834508ac42a49c61dfcedb548120735d6e010 100644 (file)
@@ -1,5 +1,5 @@
 /*++\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -494,6 +494,7 @@ vfrFormSetDefinition :
      UINT8       ClassGuidNum = 0;\r
      CIfrFormSet *FSObj = NULL;\r
      UINT16      C, SC;\r
+     CHAR8*      InsertOpcodeAddr = NULL;\r
   >>\r
   L:FormSet\r
   Uuid "=" guidDefinition[Guid] ","\r
@@ -585,7 +586,38 @@ vfrFormSetDefinition :
                                                         //\r
                                                         _DeclareDefaultFrameworkVarStore (GET_LINENO(E));\r
                                                       }\r
-                                                      CRT_END_OP (E); if (FSObj != NULL) delete FSObj;\r
+                                                      \r
+                                                      //\r
+                                                      // Declare undefined Question so that they can be used in expression.\r
+                                                      //\r
+                                                      if (gCFormPkg.HavePendingUnassigned()) {\r
+                                                        mParserStatus += gCFormPkg.DeclarePendingQuestion (\r
+                                                                    gCVfrVarDataTypeDB,\r
+                                                                    mCVfrDataStorage,\r
+                                                                    mCVfrQuestionDB,\r
+                                                                    &mFormsetGuid,\r
+                                                                    E->getLine(),\r
+                                                                    &InsertOpcodeAddr\r
+                                                                  );\r
+                                                        gNeedAdjustOpcode = TRUE;\r
+                                                      }\r
+\r
+                                                      CRT_END_OP (E);\r
+\r
+                                                      //\r
+                                                      // Adjust the pending question position.\r
+                                                      // Move the position from current to before the end of the last form in the form set.\r
+                                                      //\r
+                                                      if (gNeedAdjustOpcode) {\r
+                                                        gCFormPkg.AdjustDynamicInsertOpcode (\r
+                                                          mLastFormEndAddr,\r
+                                                          InsertOpcodeAddr\r
+                                                        );\r
+                                                      }\r
+\r
+                                                      if (FSObj != NULL) {\r
+                                                        delete FSObj;\r
+                                                      }\r
                                                     >>\r
   ";"\r
   ;\r
@@ -866,7 +898,7 @@ vfrStatementVarStoreLinear :
                                                                                   VarStoreId\r
                                                                                   ), LineNum);\r
                                                        VSObj.SetGuid (&Guid);\r
-                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId), SN);\r
+                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId, &Guid), SN);\r
                                                        VSObj.SetVarStoreId (VarStoreId);\r
                                                        _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);\r
                                                        VSObj.SetSize ((UINT16) Size);\r
@@ -952,7 +984,7 @@ vfrStatementVarStoreEfi :
                                                                                   TypeName,\r
                                                                                   VarStoreId\r
                                                                                   ), LineNum);                                                        \r
-                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId), SN);\r
+                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId, &Guid), SN);\r
                                                          _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);\r
                                                        } else {\r
                                                         _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (\r
@@ -962,7 +994,7 @@ vfrStatementVarStoreEfi :
                                                                                   TypeName,\r
                                                                                   VarStoreId\r
                                                                                   ), LineNum);                                                      \r
-                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId(TN->getText(), &VarStoreId), VN);\r
+                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId(TN->getText(), &VarStoreId, &Guid), VN);\r
                                                          _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), N->getLine());\r
                                                        }\r
                                                        VSEObj.SetGuid (&Guid);                                                       \r
@@ -995,7 +1027,7 @@ vfrStatementVarStoreNameValue :
   Uuid "=" guidDefinition[Guid]                     << _PCATCH(mCVfrDataStorage.DeclareNameVarStoreEnd (&Guid), SN); >>\r
                                                     <<\r
                                                        VSNVObj.SetGuid (&Guid);\r
-                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
+                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId, &Guid), SN);\r
                                                        VSNVObj.SetVarStoreId (VarStoreId);\r
                                                     >>\r
   ";"\r
@@ -1069,9 +1101,14 @@ vfrStatementHeader[CIfrStatementHeader *SHObj] :
 vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_NORMAL]:\r
   <<\r
      EFI_VARSTORE_INFO Info;\r
+     Info.mVarType               = EFI_IFR_TYPE_OTHER;\r
+     Info.mVarTotalSize          = 0;\r
+     Info.mInfo.mVarOffset       = EFI_VAROFFSET_INVALID;\r
+     Info.mVarStoreId            = EFI_VARSTORE_ID_INVALID;\r
      EFI_QUESTION_ID   QId       = EFI_QUESTION_ID_INVALID;\r
      CHAR8             *QName    = NULL;\r
      CHAR8             *VarIdStr = NULL;\r
+     mUsedDefaultCount           = 0;\r
   >>\r
   {\r
     Name "=" QN:StringIdentifier ","                <<\r
@@ -1119,8 +1156,8 @@ vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_
                                                     << \r
                                                        if (VarIdStr != NULL) {\r
                                                          delete VarIdStr; \r
-                                                         _SAVE_CURRQEST_VARINFO (Info);\r
                                                        }\r
+                                                       _SAVE_CURRQEST_VARINFO (Info);\r
                                                     >>\r
   ;\r
 \r
@@ -1144,6 +1181,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
      CHAR8                 *TName       = NULL;\r
      EFI_VFR_RETURN_CODE   VfrReturnCode = VFR_RETURN_SUCCESS;\r
      EFI_IFR_TYPE_VALUE    Dummy        = gZeroEfiIfrTypeValue;\r
+     EFI_GUID              *VarGuid     = NULL;\r
   >>\r
   (\r
     SN1:StringIdentifier                            << SName = SN1->getText(); _STRCAT(&VarIdStr, SN1->getText()); >>\r
@@ -1154,7 +1192,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                        _STRCAT(&VarIdStr, "]");\r
                                                     >>\r
                                                     <<\r
-                                                       VfrReturnCode = mCVfrDataStorage.GetVarStoreType (SName, VarStoreType);\r
+                                                       VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);\r
                                                        if (mCompatibleMode && VfrReturnCode == VFR_RETURN_UNDEFINED) {\r
                                                           mCVfrDataStorage.DeclareBufferVarStore (\r
                                                                              SName,\r
@@ -1164,11 +1202,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                                              EFI_VARSTORE_ID_INVALID,\r
                                                                              FALSE\r
                                                                              );\r
-                                                          VfrReturnCode = mCVfrDataStorage.GetVarStoreType (SName, VarStoreType);\r
+                                                          VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId, &mFormsetGuid);\r
                                                        }\r
                                                        if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {\r
                                                          _PCATCH(VfrReturnCode, SN1);\r
-                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1);\r
                                                          _PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);\r
                                                        }\r
 \r
@@ -1179,7 +1216,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
   (\r
     SN2:StringIdentifier                            << SName = SN2->getText(); _STRCAT(&VarIdStr, SName); >>\r
                                                     <<\r
-                                                       VfrReturnCode = mCVfrDataStorage.GetVarStoreType (SName, VarStoreType);\r
+                                                       VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);\r
                                                        if (mCompatibleMode && VfrReturnCode == VFR_RETURN_UNDEFINED) {\r
                                                           mCVfrDataStorage.DeclareBufferVarStore (\r
                                                                              SName,\r
@@ -1189,13 +1226,13 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                                              EFI_VARSTORE_ID_INVALID,\r
                                                                              FALSE\r
                                                                              );\r
-                                                          VfrReturnCode = mCVfrDataStorage.GetVarStoreType (SName, VarStoreType);\r
+                                                          VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId, &mFormsetGuid);\r
                                                        }\r
                                                        if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {\r
                                                          _PCATCH(VfrReturnCode, SN2);\r
-                                                         _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN2);\r
+                                                         VarStoreType = mCVfrDataStorage.GetVarStoreType ($Info.mVarStoreId);\r
                                                          if (VarStoreType == EFI_VFR_VARSTORE_BUFFER) {\r
-                                                           _PCATCH(mCVfrDataStorage.GetBufferVarStoreDataTypeName(SName, &TName), SN2);\r
+                                                           _PCATCH(mCVfrDataStorage.GetBufferVarStoreDataTypeName(Info.mVarStoreId, &TName), SN2);\r
                                                            _STRCAT(&VarStr, TName);\r
                                                          }\r
                                                        }\r
@@ -1234,13 +1271,16 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                          break;\r
                                                        case EFI_VFR_VARSTORE_BUFFER:\r
                                                          _PCATCH(gCVfrVarDataTypeDB.GetDataFieldInfo (VarStr, $Info.mInfo.mVarOffset, $Info.mVarType, $Info.mVarTotalSize), SN2->getLine(), VarStr);\r
+                                                         VarGuid = mCVfrDataStorage.GetVarStoreGuid($Info.mVarStoreId);\r
                                                          _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Register (\r
                                                                     SName,\r
+                                                                    VarGuid,\r
                                                                     NULL),\r
                                                                  SN2->getLine());\r
                                                          _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Write (\r
                                                                     'a',\r
                                                                     SName,\r
+                                                                    VarGuid,\r
                                                                     NULL,\r
                                                                     $Info.mVarType,\r
                                                                     $Info.mInfo.mVarOffset,\r
@@ -1389,23 +1429,7 @@ vfrFormDefinition :
                                                         LObj3.SetNumber (0xffff);  //add end label for UEFI, label number hardcode 0xffff\r
                                                       }\r
 \r
-                                                      //\r
-                                                      // Declare undefined Question so that they can be used in expression.\r
-                                                      //\r
-                                                      if (gCFormPkg.HavePendingUnassigned()) {\r
-                                                        gCFormPkg.DeclarePendingQuestion (\r
-                                                                    gCVfrVarDataTypeDB,\r
-                                                                    mCVfrDataStorage,\r
-                                                                    mCVfrQuestionDB,\r
-                                                                    &mFormsetGuid,\r
-                                                                    E->getLine()\r
-                                                                  );\r
-                                                      }\r
-\r
-                                                      //\r
-                                                      // mCVfrQuestionDB.PrintAllQuestion();\r
-                                                      //\r
-                                                      CRT_END_OP (E);\r
+                                                      {CIfrEnd EObj; EObj.SetLineNo (E->getLine()); mLastFormEndAddr = EObj.GetObjBinAddr (); gAdjustOpcodeOffset = EObj.GetObjBinOffset ();}\r
                                                     >>\r
   ";"\r
   ;\r
@@ -1455,42 +1479,72 @@ vfrStatementDefault :
   <<\r
      BOOLEAN               IsExp         = FALSE;\r
      EFI_IFR_TYPE_VALUE    Val           = gZeroEfiIfrTypeValue;\r
-     CIfrDefault           DObj;\r
+     CIfrDefault           *DObj         = NULL;\r
+     CIfrDefault2          *DObj2        = NULL;\r
      EFI_DEFAULT_ID        DefaultId     = EFI_HII_DEFAULT_CLASS_STANDARD;\r
      CHAR8                 *VarStoreName = NULL;\r
      EFI_VFR_VARSTORE_TYPE VarStoreType  = EFI_VFR_VARSTORE_INVALID;\r
+     UINT32                Size          = 0;\r
+     EFI_GUID              *VarGuid      = NULL;\r
   >>\r
-  D:Default                                         << DObj.SetLineNo(D->getLine()); >>\r
+  D:Default                                         \r
   (\r
     (\r
-        vfrStatementValue ","                       << IsExp = TRUE; DObj.SetScope (1); CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>\r
-      | "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","  << \r
+      "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","  \r
+                                                    << \r
                                                         if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {\r
                                                           //check default value is valid for Numeric Opcode\r
                                                           if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {\r
                                                             _PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");\r
                                                           }\r
                                                         }\r
-                                                        DObj.SetType (_GET_CURRQEST_DATATYPE()); \r
-                                                        DObj.SetValue(Val);\r
+                                                        if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {\r
+                                                          _PCATCH (VFR_RETURN_FATAL_ERROR, D->getLine(), "Default data type error.");\r
+                                                          Size = sizeof (EFI_IFR_TYPE_VALUE);\r
+                                                        } else {\r
+                                                          _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &Size), D->getLine());\r
+                                                        }\r
+                                                        Size += OFFSET_OF (EFI_IFR_DEFAULT, Value);\r
+                                                        DObj = new CIfrDefault ((UINT8)Size);\r
+                                                        DObj->SetLineNo(D->getLine());\r
+                                                        DObj->SetType (_GET_CURRQEST_DATATYPE()); \r
+                                                        DObj->SetValue(Val);\r
                                                     >>\r
+      |                                             << IsExp = TRUE; DObj2 = new CIfrDefault2; DObj2->SetLineNo(D->getLine()); DObj2->SetScope (1); >>\r
+        vfrStatementValue ","                       << CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>\r
     )\r
     {\r
-      DefaultStore "=" SN:StringIdentifier ","      << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >>\r
+      DefaultStore "=" SN:StringIdentifier ","      << \r
+                                                        _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); \r
+                                                        if (DObj != NULL) {\r
+                                                          DObj->SetDefaultId (DefaultId); \r
+                                                        } \r
+\r
+                                                        if (DObj2 != NULL) {\r
+                                                          DObj2->SetDefaultId (DefaultId); \r
+                                                        }\r
+                                                    >>\r
     }\r
                                                     <<\r
+                                                      CheckDuplicateDefaultValue (DefaultId, D);\r
+                                                      if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), D->getLine());\r
-                                                       _PCATCH(mCVfrDataStorage.GetVarStoreType (VarStoreName, VarStoreType), D->getLine());\r
+                                                       VarGuid = mCVfrDataStorage.GetVarStoreGuid(_GET_CURRQEST_VARTINFO().mVarStoreId);\r
+                                                       VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);\r
                                                        if ((IsExp == FALSE) && (VarStoreType == EFI_VFR_VARSTORE_BUFFER)) {\r
                                                          _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
                                                                    DefaultId,\r
                                                                    _GET_CURRQEST_VARTINFO(),\r
                                                                    VarStoreName,\r
+                                                                   VarGuid,\r
                                                                    _GET_CURRQEST_DATATYPE (),\r
-                                                                   Val),\r
-                                                                   D->getLine()\r
-                                                                   );\r
+                                                                     Val),\r
+                                                                     D->getLine()\r
+                                                                     );\r
+                                                         }\r
                                                        }\r
+                                                       if (DObj  != NULL) {delete DObj;} \r
+                                                       if (DObj2 != NULL) {delete DObj2;} \r
                                                     >>\r
   )\r
   ;\r
@@ -1755,7 +1809,11 @@ vfrStatementGoto :
                                                           default: break;\r
                                                           }\r
                                                        >>\r
-  vfrQuestionHeader[*QHObj, QUESTION_REF]\r
+  vfrQuestionHeader[*QHObj, QUESTION_REF]              <<\r
+                                                          if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {\r
+                                                            _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_REF;\r
+                                                          }\r
+                                                       >>\r
   { "," F:FLAGS  "=" vfrGotoFlags[QHObj, F->getLine()] }\r
   {\r
     "," Key "=" KN:Number                              << AssignQuestionKey (*QHObj, KN); >>\r
@@ -1824,49 +1882,62 @@ vfrStatementCheckBox :
      EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;\r
      CHAR8              *VarStoreName = NULL;\r
      UINT32             DataTypeSize;\r
+     EFI_GUID           *VarStoreGuid = NULL;\r
   >>\r
   L:CheckBox                                           << CBObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[CBObj] ","                         << //check data type\r
-                                                          _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "CheckBox varid is not the valid data type");\r
-                                                          if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {\r
-                                                            _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "CheckBox varid doesn't support array");\r
-                                                          } else if ((mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId) == EFI_VFR_VARSTORE_BUFFER) &&\r
-                                                                    (_GET_CURRQEST_VARSIZE() != sizeof (BOOLEAN))) {\r
-                                                            _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "CheckBox varid only support BOOLEAN data type");\r
+                                                          if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {\r
+                                                            _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_BOOLEAN;\r
+                                                          }\r
+                                                          if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "CheckBox varid is not the valid data type");\r
+                                                            if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {\r
+                                                              _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "CheckBox varid doesn't support array");\r
+                                                            } else if ((mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId) == EFI_VFR_VARSTORE_BUFFER) &&\r
+                                                                      (_GET_CURRQEST_VARSIZE() != sizeof (BOOLEAN))) {\r
+                                                              _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "CheckBox varid only support BOOLEAN data type");\r
+                                                            }\r
                                                           }\r
                                                        >>\r
   {\r
     F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] ","\r
                                                        <<\r
-                                                          _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");\r
-                                                          Val.b = TRUE;\r
-                                                          if (CBObj.GetFlags () & 0x01) {\r
-                                                            _PCATCH(\r
-                                                              mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
-                                                                                  EFI_HII_DEFAULT_CLASS_STANDARD,\r
-                                                                                  _GET_CURRQEST_VARTINFO(),\r
-                                                                                  VarStoreName,\r
-                                                                                  _GET_CURRQEST_DATATYPE (),\r
-                                                                                  Val\r
-                                                                                  ),\r
-                                                              VFR_RETURN_SUCCESS,\r
-                                                              L,\r
-                                                              "No standard default storage found"\r
-                                                              );\r
-                                                          }\r
-                                                          if (CBObj.GetFlags () & 0x02) {\r
-                                                            _PCATCH(\r
-                                                              mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
-                                                                                  EFI_HII_DEFAULT_CLASS_MANUFACTURING,\r
-                                                                                  _GET_CURRQEST_VARTINFO(),\r
-                                                                                  VarStoreName,\r
-                                                                                  _GET_CURRQEST_DATATYPE (),\r
-                                                                                  Val\r
-                                                                                  ),\r
-                                                              VFR_RETURN_SUCCESS,\r
-                                                              L,\r
-                                                              "No manufacturing default storage found"\r
-                                                              );\r
+                                                         if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");\r
+                                                            VarStoreGuid = mCVfrDataStorage.GetVarStoreGuid(_GET_CURRQEST_VARTINFO().mVarStoreId);\r
+                                                            Val.b = TRUE;\r
+                                                            if (CBObj.GetFlags () & 0x01) {\r
+                                                              CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_STANDARD, F);\r
+                                                              _PCATCH(\r
+                                                                mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
+                                                                                    EFI_HII_DEFAULT_CLASS_STANDARD,\r
+                                                                                    _GET_CURRQEST_VARTINFO(),\r
+                                                                                    VarStoreName,\r
+                                                                                    VarStoreGuid,\r
+                                                                                    _GET_CURRQEST_DATATYPE (),\r
+                                                                                    Val\r
+                                                                                    ),\r
+                                                                VFR_RETURN_SUCCESS,\r
+                                                                L,\r
+                                                                "No standard default storage found"\r
+                                                                );\r
+                                                            }\r
+                                                            if (CBObj.GetFlags () & 0x02) {\r
+                                                              CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_MANUFACTURING, F);\r
+                                                              _PCATCH(\r
+                                                                mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
+                                                                                    EFI_HII_DEFAULT_CLASS_MANUFACTURING,\r
+                                                                                    _GET_CURRQEST_VARTINFO(),\r
+                                                                                    VarStoreName,\r
+                                                                                    VarStoreGuid,\r
+                                                                                    _GET_CURRQEST_DATATYPE (),\r
+                                                                                    Val\r
+                                                                                    ),\r
+                                                                VFR_RETURN_SUCCESS,\r
+                                                                L,\r
+                                                                "No manufacturing default storage found"\r
+                                                                );\r
+                                                            }\r
                                                           }\r
                                                         >>\r
   }\r
@@ -1962,11 +2033,16 @@ vfrStatementDate :
      CHAR8              *VarIdStr[3] = {NULL, };\r
      CIfrDate           DObj;\r
      EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;\r
+     UINT8              Size = OFFSET_OF (EFI_IFR_DEFAULT, Value) + sizeof (EFI_HII_DATE);\r
   >>\r
   L:Date                                               << DObj.SetLineNo(L->getLine()); >>\r
   (\r
     (\r
-      vfrQuestionHeader[DObj, QUESTION_DATE] ","\r
+      vfrQuestionHeader[DObj, QUESTION_DATE] ","       <<\r
+                                                          if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {\r
+                                                            _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_DATE;\r
+                                                          }\r
+                                                       >>\r
     { F:FLAGS "=" vfrDateFlags[DObj, F->getLine()] "," }\r
       vfrStatementQuestionOptionList\r
     )\r
@@ -1998,7 +2074,7 @@ vfrStatementDate :
                                                           DObj.SetHelp (_STOSID(YH->getText()));\r
                                                           if (VarIdStr[0] != NULL) { delete VarIdStr[0]; } if (VarIdStr[1] != NULL) { delete VarIdStr[1]; } if (VarIdStr[2] != NULL) { delete VarIdStr[2]; }\r
                                                        >>\r
-                                                       << {CIfrDefault DefaultObj(EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_DATE, Val); DefaultObj.SetLineNo(L->getLine());} >>\r
+                                                       << {CIfrDefault DefaultObj(Size, EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_DATE, Val); DefaultObj.SetLineNo(L->getLine());} >>\r
     )\r
     ( vfrStatementInconsistentIf )*\r
   )\r
@@ -2126,38 +2202,45 @@ vfrSetMinMaxStep[CIfrMinMaxStepData & MMSDObj] :
 vfrStatementNumeric :\r
   <<\r
      CIfrNumeric NObj;\r
-     UINT32 DataTypeSize;\r
-     BOOLEAN IsSupported;\r
+     UINT32      DataTypeSize;\r
+     BOOLEAN     IsSupported = TRUE;\r
+     UINT8       ShrinkSize  = 0;\r
   >>\r
   L:Numeric                                            << NObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[NObj] ","                          << // check data type\r
-                                                          _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "Numeric varid is not the valid data type");\r
-                                                          if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {\r
-                                                            _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Numeric varid doesn't support array");\r
+                                                          if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "Numeric varid is not the valid data type");\r
+                                                            if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {\r
+                                                              _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Numeric varid doesn't support array");\r
+                                                            }\r
+                                                            _PCATCH(NObj.SetFlags (NObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine());\r
                                                           }\r
-                                                          _PCATCH(NObj.SetFlags (NObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine());\r
                                                        >>\r
   { F:FLAGS "=" vfrNumericFlags[NObj, F->getLine()] "," }\r
   {\r
     Key   "=" KN:Number ","                            << AssignQuestionKey (NObj, KN); >>\r
   }\r
-  vfrSetMinMaxStep[NObj]\r
-  vfrStatementQuestionOptionList\r
-  E:EndNumeric                                         << \r
-                                                          IsSupported = FALSE;\r
+  vfrSetMinMaxStep[NObj]                               <<\r
                                                           switch (_GET_CURRQEST_DATATYPE()) {\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_8:\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_16:\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_32:\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_64:\r
-                                                              IsSupported = TRUE;\r
-                                                              break;\r
-                                                            default:\r
+                                                            //\r
+                                                            // Base on the type to know the actual used size,shrink the buffer \r
+                                                            // size allocate before.\r
+                                                            //\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_8: ShrinkSize = 21;break;\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_16:ShrinkSize = 18;break;\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_32:ShrinkSize = 12;break;\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_64:break;\r
+                                                            default: \r
+                                                              IsSupported = FALSE;\r
                                                               break;\r
                                                           }\r
+                                                          NObj.ShrinkBinSize (ShrinkSize);\r
                                                           if (!IsSupported) {\r
                                                             _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Numeric question only support UINT8, UINT16, UINT32 and UINT64 data type.");\r
                                                           }\r
+                                                       >>\r
+  vfrStatementQuestionOptionList\r
+  E:EndNumeric                                         << \r
                                                           CRT_END_OP (E); \r
                                                        >>\r
   ";"\r
@@ -2168,32 +2251,37 @@ vfrNumericFlags [CIfrNumeric & NObj, UINT32 LineNum] :
      UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;\r
      UINT8 HFlags = 0;\r
      EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
+     BOOLEAN IsSetType = FALSE;\r
   >>\r
-  numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )*\r
+  numericFlagsField[HFlags, LFlags, IsSetType] ( "\|" numericFlagsField[HFlags, LFlags, IsSetType] )*\r
                                                        <<\r
                                                           //check data type flag\r
-                                                          VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);\r
-                                                          if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {\r
-                                                            if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {\r
-                                                              _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");\r
+                                                          if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);\r
+                                                            if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {\r
+                                                              if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {\r
+                                                                _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");\r
+                                                              }\r
+                                                            } else {\r
+                                                              // update data type for name/value store\r
+                                                              UINT32 DataTypeSize;\r
+                                                              _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;\r
+                                                              gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);\r
+                                                              _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;\r
                                                             }\r
-                                                          } else {\r
-                                                            // update data type for name/value store\r
-                                                            UINT32 DataTypeSize;\r
+                                                          } else if (IsSetType){\r
                                                             _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;\r
-                                                            gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);\r
-                                                            _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;\r
                                                           }\r
                                                           _PCATCH(NObj.SetFlags (HFlags, LFlags), LineNum);\r
                                                        >>\r
   ;\r
 \r
-numericFlagsField [UINT8 & HFlags, UINT8 & LFlags] :\r
+numericFlagsField [UINT8 & HFlags, UINT8 & LFlags, BOOLEAN & IsSetType] :\r
     N:Number                                           << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>\r
-  | "NUMERIC_SIZE_1"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_1; >>\r
-  | "NUMERIC_SIZE_2"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_2; >>\r
-  | "NUMERIC_SIZE_4"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_4; >>\r
-  | "NUMERIC_SIZE_8"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; >>\r
+  | "NUMERIC_SIZE_1"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_1; IsSetType = TRUE;>>\r
+  | "NUMERIC_SIZE_2"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_2; IsSetType = TRUE;>>\r
+  | "NUMERIC_SIZE_4"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_4; IsSetType = TRUE;>>\r
+  | "NUMERIC_SIZE_8"                                   << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; IsSetType = TRUE;>>\r
   | "DISPLAY_INT_DEC"                                  << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_INT_DEC; >>\r
   | "DISPLAY_UINT_DEC"                                 << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_DEC; >>\r
   | "DISPLAY_UINT_HEX"                                 << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_HEX; >>\r
@@ -2204,36 +2292,44 @@ vfrStatementOneOf :
   <<\r
      CIfrOneOf OObj;\r
      UINT32    DataTypeSize;\r
-     BOOLEAN   IsSupported;\r
+     BOOLEAN   IsSupported = TRUE;\r
+     UINT8     ShrinkSize  = 0;\r
   >>\r
   L:OneOf                                              << OObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[OObj] ","                          << //check data type\r
-                                                          _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "OneOf varid is not the valid data type");\r
-                                                          if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {\r
-                                                            _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "OneOf varid doesn't support array");\r
+                                                          if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "OneOf varid is not the valid data type");\r
+                                                            if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {\r
+                                                              _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "OneOf varid doesn't support array");\r
+                                                            }\r
+                                                            _PCATCH(OObj.SetFlags (OObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine());\r
                                                           }\r
-                                                          _PCATCH(OObj.SetFlags (OObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine());\r
                                                        >>\r
   { F:FLAGS "=" vfrOneofFlagsField[OObj, F->getLine()] "," }\r
   {\r
     vfrSetMinMaxStep[OObj]\r
   }\r
-  vfrStatementQuestionOptionList\r
-  E:EndOneOf                                           << \r
-                                                          IsSupported = FALSE;\r
+                                                       <<\r
                                                           switch (_GET_CURRQEST_DATATYPE()) {\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_8:\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_16:\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_32:\r
-                                                            case EFI_IFR_TYPE_NUM_SIZE_64:\r
-                                                              IsSupported = TRUE;\r
-                                                              break;\r
+                                                            //\r
+                                                            // Base on the type to know the actual used size,shrink the buffer \r
+                                                            // size allocate before.\r
+                                                            //\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_8: ShrinkSize = 21;break;\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_16:ShrinkSize = 18;break;\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_32:ShrinkSize = 12;break;\r
+                                                            case EFI_IFR_TYPE_NUM_SIZE_64:break;\r
                                                             default:\r
+                                                              IsSupported = FALSE;\r
                                                               break;\r
                                                           }\r
+                                                          OObj.ShrinkBinSize (ShrinkSize);\r
                                                           if (!IsSupported) {\r
                                                             _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "OneOf question only support UINT8, UINT16, UINT32 and UINT64 data type.");\r
                                                           }\r
+                                                       >>\r
+  vfrStatementQuestionOptionList\r
+  E:EndOneOf                                           <<\r
                                                           CRT_END_OP (E); \r
                                                        >>\r
   ";"\r
@@ -2244,21 +2340,26 @@ vfrOneofFlagsField [CIfrOneOf & OObj, UINT32 LineNum] :
      UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;\r
      UINT8 HFlags = 0;\r
      EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
+     BOOLEAN IsSetType = FALSE;\r
   >>\r
-  numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )*\r
+  numericFlagsField[HFlags, LFlags, IsSetType] ( "\|" numericFlagsField[HFlags, LFlags, IsSetType] )*\r
                                                        <<\r
                                                           //check data type flag\r
-                                                          VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);\r
-                                                          if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {\r
-                                                            if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {\r
-                                                              _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");\r
+                                                          if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);\r
+                                                            if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {\r
+                                                              if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {\r
+                                                                _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");\r
+                                                              }\r
+                                                            } else {\r
+                                                              // update data type for Name/Value store\r
+                                                              UINT32 DataTypeSize;\r
+                                                              _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;\r
+                                                              gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);\r
+                                                              _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;\r
                                                             }\r
-                                                          } else {\r
-                                                            // update data type for Name/Value store\r
-                                                            UINT32 DataTypeSize;\r
+                                                          } else if (IsSetType){\r
                                                             _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;\r
-                                                            gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);\r
-                                                            _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;\r
                                                           }\r
                                                           _PCATCH(OObj.SetFlags (HFlags, LFlags), LineNum);\r
                                                        >>\r
@@ -2423,11 +2524,16 @@ vfrStatementTime :
      CHAR8              *VarIdStr[3] = {NULL, };\r
      CIfrTime           TObj;\r
      EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;\r
+     UINT8              Size = OFFSET_OF (EFI_IFR_DEFAULT, Value) + sizeof (EFI_HII_TIME);\r
   >>\r
   L:Time                                               << TObj.SetLineNo(L->getLine()); >>\r
   (\r
     (\r
-      vfrQuestionHeader[TObj, QUESTION_TIME] ","\r
+      vfrQuestionHeader[TObj, QUESTION_TIME] ","       <<\r
+                                                          if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {\r
+                                                            _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_TIME;\r
+                                                          }\r
+                                                       >>\r
     { F:FLAGS "=" vfrTimeFlags[TObj, F->getLine()] "," }\r
       vfrStatementQuestionOptionList\r
     )\r
@@ -2459,7 +2565,7 @@ vfrStatementTime :
                                                           TObj.SetHelp (_STOSID(HH->getText()));\r
                                                           if (VarIdStr[0] != NULL) { delete VarIdStr[0]; } if (VarIdStr[1] != NULL) { delete VarIdStr[1]; } if (VarIdStr[2] != NULL) { delete VarIdStr[2]; }\r
                                                        >>\r
-                                                       << {CIfrDefault DefaultObj(EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_TIME, Val); DefaultObj.SetLineNo(L->getLine());} >>\r
+                                                       << {CIfrDefault DefaultObj(Size, EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_TIME, Val); DefaultObj.SetLineNo(L->getLine());} >>\r
     )\r
     ( vfrStatementInconsistentIf )*\r
   )\r
@@ -2774,11 +2880,32 @@ vfrStatementOptions :
 \r
 vfrStatementOneOfOption :\r
   <<\r
-     EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;\r
-     CIfrOneOfOption    OOOObj;\r
+     EFI_IFR_TYPE_VALUE Val           = gZeroEfiIfrTypeValue;\r
      CHAR8              *VarStoreName = NULL;\r
+     UINT32             Size          = 0;\r
+     BOOLEAN            TypeError     = FALSE;\r
+     EFI_VFR_RETURN_CODE ReturnCode   = VFR_RETURN_SUCCESS;\r
+     EFI_GUID           *VarStoreGuid = NULL;\r
+     \r
+     if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {\r
+       TypeError = TRUE;\r
+       Size = sizeof (EFI_IFR_TYPE_VALUE);\r
+     } else {\r
+       ReturnCode = gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &Size);\r
+     }\r
+\r
+     Size += OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value);\r
+     CIfrOneOfOption    OOOObj ((UINT8)Size);\r
   >>\r
-  L:Option                                             << OOOObj.SetLineNo(L->getLine()); >>\r
+  L:Option                                             <<      \r
+                                                          OOOObj.SetLineNo(L->getLine());\r
+                                                          if (TypeError) {\r
+                                                            _PCATCH (VFR_RETURN_FATAL_ERROR, L->getLine(), "Get data type error.");\r
+                                                          }\r
+                                                          if (ReturnCode != VFR_RETURN_SUCCESS) {\r
+                                                            _PCATCH (ReturnCode, L->getLine());\r
+                                                          }\r
+                                                       >>\r
   Text  "=" "STRING_TOKEN" "\(" S:Number "\)" ","      << OOOObj.SetOption (_STOSID(S->getText())); >>\r
   Value "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] >[Val] ","    \r
                                                        << \r
@@ -2807,24 +2934,31 @@ vfrStatementOneOfOption :
                                                        >>\r
   F:FLAGS "=" vfrOneOfOptionFlags[OOOObj, F->getLine()]\r
                                                        <<\r
-                                                          _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), L->getLine());\r
-                                                          if (OOOObj.GetFlags () & 0x10) {\r
-                                                            _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
-                                                                      EFI_HII_DEFAULT_CLASS_STANDARD,\r
-                                                                       _GET_CURRQEST_VARTINFO(),\r
-                                                                      VarStoreName,\r
-                                                                      _GET_CURRQEST_DATATYPE (),\r
-                                                                      Val\r
-                                                                      ), L->getLine());\r
-                                                          }\r
-                                                          if (OOOObj.GetFlags () & 0x20) {\r
-                                                            _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
-                                                                      EFI_HII_DEFAULT_CLASS_MANUFACTURING,\r
-                                                                       _GET_CURRQEST_VARTINFO(),\r
-                                                                      VarStoreName,\r
-                                                                      _GET_CURRQEST_DATATYPE (),\r
-                                                                      Val\r
-                                                                      ), L->getLine());\r
+                                                          if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {\r
+                                                            _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), L->getLine());\r
+                                                            VarStoreGuid = mCVfrDataStorage.GetVarStoreGuid(_GET_CURRQEST_VARTINFO().mVarStoreId);\r
+                                                            if (OOOObj.GetFlags () & 0x10) {\r
+                                                              CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_STANDARD, F);\r
+                                                              _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
+                                                                        EFI_HII_DEFAULT_CLASS_STANDARD,\r
+                                                                         _GET_CURRQEST_VARTINFO(),\r
+                                                                        VarStoreName,\r
+                                                                        VarStoreGuid,\r
+                                                                        _GET_CURRQEST_DATATYPE (),\r
+                                                                        Val\r
+                                                                        ), L->getLine());\r
+                                                            }\r
+                                                            if (OOOObj.GetFlags () & 0x20) {\r
+                                                              CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_MANUFACTURING, F);\r
+                                                              _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
+                                                                        EFI_HII_DEFAULT_CLASS_MANUFACTURING,\r
+                                                                         _GET_CURRQEST_VARTINFO(),\r
+                                                                        VarStoreName,\r
+                                                                        VarStoreGuid,\r
+                                                                        _GET_CURRQEST_DATATYPE (),\r
+                                                                        Val\r
+                                                                        ), L->getLine());\r
+                                                            }\r
                                                           }\r
                                                        >>\r
   {\r
@@ -3237,8 +3371,8 @@ vareqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
      UINT16          ConstVal;\r
      CHAR8           *VarIdStr;\r
      UINT32          LineNo;\r
-     EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
      EFI_VFR_RETURN_CODE   VfrReturnCode = VFR_RETURN_SUCCESS;\r
+     EFI_VARSTORE_ID       VarStoreId   = EFI_VARSTORE_ID_INVALID;\r
   >>\r
   L:VarEqVal                                          <<\r
                                                         if (!mCompatibleMode) {\r
@@ -3249,7 +3383,7 @@ vareqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
   OpenParen\r
   VN:Number                                           <<\r
                                                           VarIdStr = NULL; _STRCAT(&VarIdStr, VK->getText()); _STRCAT(&VarIdStr, VN->getText());\r
-                                                          VfrReturnCode = mCVfrDataStorage.GetVarStoreType (VarIdStr, VarStoreType);\r
+                                                          VfrReturnCode = mCVfrDataStorage.GetVarStoreId (VarIdStr, &VarStoreId);\r
                                                           if (VfrReturnCode == VFR_RETURN_UNDEFINED) {\r
                                                             _PCATCH (mCVfrDataStorage.DeclareEfiVarStore (\r
                                                                                         VarIdStr,\r
@@ -3887,6 +4021,13 @@ private:
 \r
   EFI_VARSTORE_INFO   mCurrQestVarInfo;\r
   EFI_GUID            *mOverrideClassGuid;\r
+  CHAR8*              mLastFormEndAddr;\r
+\r
+//\r
+// Whether the question already has default value.\r
+//\r
+  UINT16              mUsedDefaultArray[EFI_IFR_MAX_DEFAULT_TYPE];\r
+  UINT16              mUsedDefaultCount;\r
 \r
 //\r
 // For framework vfr compatibility\r
@@ -3902,6 +4043,7 @@ private:
   UINT8               _GET_CURRQEST_DATATYPE ();\r
   UINT32              _GET_CURRQEST_VARSIZE ();\r
   UINT32              _GET_CURRQEST_ARRAY_SIZE();\r
+  VOID                CheckDuplicateDefaultValue (IN EFI_DEFAULT_ID, IN ANTLRTokenPtr);\r
 \r
 public:\r
   VOID                _PCATCH (IN INTN, IN INTN, IN ANTLRTokenPtr, IN CONST CHAR8 *);\r
@@ -4485,7 +4627,7 @@ EfiVfrParser::_DeclareDefaultLinearVarStore (
                        TypeNameList[Index],\r
                        EFI_VARSTORE_ID_INVALID\r
                        );\r
-    mCVfrDataStorage.GetVarStoreId(TypeNameList[Index], &VarStoreId);\r
+    mCVfrDataStorage.GetVarStoreId(TypeNameList[Index], &VarStoreId, &mFormsetGuid);\r
     VSObj.SetVarStoreId (VarStoreId);\r
     gCVfrVarDataTypeDB.GetDataTypeSize(TypeNameList[Index], &Size);\r
     VSObj.SetSize ((UINT16) Size);\r
@@ -4510,7 +4652,7 @@ EfiVfrParser::_DeclareDefaultLinearVarStore (
                        (CHAR8 *) DateType,\r
                        EFI_VARSTORE_ID_INVALID\r
                        );\r
-    mCVfrDataStorage.GetVarStoreId((CHAR8 *) DateName, &VarStoreId);\r
+    mCVfrDataStorage.GetVarStoreId((CHAR8 *) DateName, &VarStoreId, &mFormsetGuid);\r
     VSObj.SetVarStoreId (VarStoreId);\r
     gCVfrVarDataTypeDB.GetDataTypeSize((CHAR8 *) DateType, &Size);\r
     VSObj.SetSize ((UINT16) Size);\r
@@ -4531,7 +4673,7 @@ EfiVfrParser::_DeclareDefaultLinearVarStore (
                        (CHAR8 *) TimeType,\r
                        EFI_VARSTORE_ID_INVALID\r
                        );\r
-    mCVfrDataStorage.GetVarStoreId((CHAR8 *) TimeName, &VarStoreId);\r
+    mCVfrDataStorage.GetVarStoreId((CHAR8 *) TimeName, &VarStoreId, &mFormsetGuid);\r
     VSObj.SetVarStoreId (VarStoreId);\r
     gCVfrVarDataTypeDB.GetDataTypeSize((CHAR8 *) TimeType, &Size);\r
     VSObj.SetSize ((UINT16) Size);\r
@@ -4762,4 +4904,25 @@ EfiVfrParser::SetCompatibleMode (IN BOOLEAN Mode)
   mCompatibleMode = Mode;\r
   mCVfrQuestionDB.SetCompatibleMode (Mode);\r
 }\r
+\r
+VOID\r
+EfiVfrParser::CheckDuplicateDefaultValue (\r
+  IN EFI_DEFAULT_ID      DefaultId,\r
+  IN ANTLRTokenPtr       Tok\r
+  )\r
+{\r
+  UINT16    Index;\r
+\r
+  for(Index = 0; Index < mUsedDefaultCount; Index++) {\r
+    if (mUsedDefaultArray[Index] == DefaultId) {\r
+      gCVfrErrorHandle.HandleWarning (VFR_WARNING_DEFAULT_VALUE_REDEFINED, Tok->getLine(), Tok->getText());\r
+    }\r
+  }\r
+\r
+  if (mUsedDefaultCount >= EFI_IFR_MAX_DEFAULT_TYPE - 1) {\r
+    gCVfrErrorHandle.HandleError (VFR_RETURN_FATAL_ERROR, Tok->getLine(), Tok->getText());\r
+  }\r
+\r
+  mUsedDefaultArray[mUsedDefaultCount++] = DefaultId;\r
+}\r
 >>\r
index 0444677e861e496b175b42d3c68f23da08443a38..21a479db68c29b6a4c0e54ebda705401bf8127ed 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Vfr common library functions.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -123,11 +123,13 @@ SConfigInfo::~SConfigInfo (
 \r
 SConfigItem::SConfigItem (\r
   IN CHAR8               *Name,\r
+  IN EFI_GUID            *Guid,\r
   IN CHAR8               *Id\r
   )\r
 {\r
   mName          = NULL;\r
-  mId            = 0;\r
+  mGuid          = NULL;\r
+  mId            = NULL;\r
   mInfoStrList = NULL;\r
   mNext        = NULL;\r
 \r
@@ -137,6 +139,12 @@ SConfigItem::SConfigItem (
     }\r
   }\r
 \r
+  if (Guid != NULL) {\r
+    if ((mGuid = (EFI_GUID *) new CHAR8[sizeof (EFI_GUID)]) != NULL) {\r
+      memcpy (mGuid, Guid, sizeof (EFI_GUID));\r
+    }\r
+  }\r
+\r
   if (Id != NULL) {\r
     if ((mId = new CHAR8[strlen (Id) + 1]) != NULL) {\r
       strcpy (mId, Id);\r
@@ -146,6 +154,7 @@ SConfigItem::SConfigItem (
 \r
 SConfigItem::SConfigItem (\r
   IN CHAR8               *Name,\r
+  IN EFI_GUID            *Guid,\r
   IN CHAR8               *Id,\r
   IN UINT8               Type,\r
   IN UINT16              Offset,\r
@@ -154,6 +163,7 @@ SConfigItem::SConfigItem (
   )\r
 {\r
   mName        = NULL;\r
+  mGuid        = NULL;\r
   mId          = NULL;\r
   mInfoStrList = NULL;\r
   mNext        = NULL;\r
@@ -164,6 +174,12 @@ SConfigItem::SConfigItem (
     }\r
   }\r
 \r
+  if (Guid != NULL) {\r
+    if ((mGuid = (EFI_GUID *) new CHAR8[sizeof (EFI_GUID)]) != NULL) {\r
+      memcpy (mGuid, Guid, sizeof (EFI_GUID));\r
+    }\r
+  }\r
+\r
   if (Id != NULL) {\r
     if ((mId = new CHAR8[strlen (Id) + 1]) != NULL) {\r
       strcpy (mId, Id);\r
@@ -180,6 +196,7 @@ SConfigItem::~SConfigItem (
   SConfigInfo  *Info;\r
 \r
   BUFFER_SAFE_FREE (mName);\r
+  BUFFER_SAFE_FREE (mGuid);\r
   BUFFER_SAFE_FREE (mId);\r
   while (mInfoStrList != NULL) {\r
     Info = mInfoStrList;\r
@@ -192,18 +209,20 @@ SConfigItem::~SConfigItem (
 UINT8\r
 CVfrBufferConfig::Register (\r
   IN CHAR8               *Name,\r
+  IN EFI_GUID            *Guid,\r
   IN CHAR8               *Id\r
   )\r
 {\r
   SConfigItem *pNew;\r
 \r
-  if (Select (Name) == 0) {\r
+  if (Select (Name, Guid) == 0) {\r
     return 1;\r
   }\r
 \r
-  if ((pNew = new SConfigItem (Name, Id)) == NULL) {\r
+  if ((pNew = new SConfigItem (Name, Guid, Id)) == NULL) {\r
     return 2;\r
   }\r
+\r
   if (mItemListHead == NULL) {\r
     mItemListHead = pNew;\r
     mItemListTail = pNew;\r
@@ -234,18 +253,19 @@ CVfrBufferConfig::Eof(
 \r
 UINT8\r
 CVfrBufferConfig::Select (\r
-  IN CHAR8 *Name,\r
-  IN CHAR8 *Id\r
+  IN CHAR8    *Name,\r
+  IN EFI_GUID *Guid,\r
+  IN CHAR8    *Id\r
   )\r
 {\r
   SConfigItem *p;\r
 \r
-  if (Name == NULL) {\r
+  if (Name == NULL || Guid == NULL) {\r
     mItemListPos = mItemListHead;\r
     return 0;\r
   } else {\r
     for (p = mItemListHead; p != NULL; p = p->mNext) {\r
-      if (strcmp (p->mName, Name) != 0) {\r
+      if ((strcmp (p->mName, Name) != 0) || (memcmp (p->mGuid, Guid, sizeof (EFI_GUID)) != 0)) {\r
         continue;\r
       }\r
 \r
@@ -269,6 +289,7 @@ UINT8
 CVfrBufferConfig::Write (\r
   IN CONST CHAR8         Mode,\r
   IN CHAR8               *Name,\r
+  IN EFI_GUID            *Guid,\r
   IN CHAR8               *Id,\r
   IN UINT8               Type,\r
   IN UINT16              Offset,\r
@@ -280,14 +301,14 @@ CVfrBufferConfig::Write (
   SConfigItem   *pItem;\r
   SConfigInfo   *pInfo;\r
 \r
-  if ((Ret = Select (Name)) != 0) {\r
+  if ((Ret = Select (Name, Guid)) != 0) {\r
     return Ret;\r
   }\r
 \r
   switch (Mode) {\r
   case 'a' : // add\r
-    if (Select (Name, Id) != 0) {\r
-      if ((pItem = new SConfigItem (Name, Id, Type, Offset, (UINT16) Width, Value)) == NULL) {\r
+    if (Select (Name, Guid, Id) != 0) {\r
+      if ((pItem = new SConfigItem (Name, Guid, Id, Type, Offset, (UINT16) Width, Value)) == NULL) {\r
         return 2;\r
       }\r
       if (mItemListHead == NULL) {\r
@@ -302,10 +323,6 @@ CVfrBufferConfig::Write (
       // tranverse the list to find out if there's already the value for the same offset\r
       for (pInfo = mItemListPos->mInfoStrList; pInfo != NULL; pInfo = pInfo->mNext) {\r
         if (pInfo->mOffset == Offset) {\r
-          // check if the value and width are the same; return error if not\r
-          if ((Id != NULL) && (pInfo->mWidth != Width || memcmp(pInfo->mValue, &Value, Width) != 0)) {\r
-            return VFR_RETURN_DEFAULT_VALUE_REDEFINED;\r
-          }\r
           return 0;\r
         }\r
       }\r
@@ -1578,7 +1595,7 @@ CVfrDataStorage::DeclareEfiVarStore (
     return VFR_RETURN_EFIVARSTORE_SIZE_ERROR;\r
   }\r
 \r
-  if (GetVarStoreId (StoreName, &VarStoreId) == VFR_RETURN_SUCCESS) {\r
+  if (GetVarStoreId (StoreName, &VarStoreId, Guid) == VFR_RETURN_SUCCESS) {\r
     return VFR_RETURN_REDEFINED;\r
   }\r
 \r
@@ -1611,7 +1628,7 @@ CVfrDataStorage::DeclareBufferVarStore (
     return VFR_RETURN_FATAL_ERROR;\r
   }\r
 \r
-  if (GetVarStoreId (StoreName, &TempVarStoreId) == VFR_RETURN_SUCCESS) {\r
+  if (GetVarStoreId (StoreName, &TempVarStoreId, Guid) == VFR_RETURN_SUCCESS) {\r
     return VFR_RETURN_REDEFINED;\r
   }\r
 \r
@@ -1633,7 +1650,7 @@ CVfrDataStorage::DeclareBufferVarStore (
   pNew->mNext         = mBufferVarStoreList;\r
   mBufferVarStoreList = pNew;\r
 \r
-  if (gCVfrBufferConfig.Register(StoreName) != 0) {\r
+  if (gCVfrBufferConfig.Register(StoreName, Guid) != 0) {\r
     return VFR_RETURN_FATAL_ERROR;\r
   }\r
 \r
@@ -1643,7 +1660,8 @@ CVfrDataStorage::DeclareBufferVarStore (
 EFI_VFR_RETURN_CODE \r
 CVfrDataStorage::GetVarStoreByDataType (\r
   IN  CHAR8              *DataTypeName,\r
-  OUT SVfrVarStorageNode **VarNode\r
+  OUT SVfrVarStorageNode **VarNode,\r
+  IN  EFI_GUID           *VarGuid\r
   )\r
 {\r
   SVfrVarStorageNode    *pNode;\r
@@ -1658,7 +1676,16 @@ CVfrDataStorage::GetVarStoreByDataType (
 \r
   MatchNode = NULL;\r
   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mStorageInfo.mDataType->mTypeName, DataTypeName) == 0) {\r
+    if (strcmp (pNode->mStorageInfo.mDataType->mTypeName, DataTypeName) != 0) {\r
+      continue;\r
+    }\r
+\r
+    if ((VarGuid != NULL)) {\r
+      if (memcmp (VarGuid, &pNode->mGuid, sizeof (EFI_GUID)) == 0) {\r
+        *VarNode = pNode;\r
+        return VFR_RETURN_SUCCESS;\r
+      }\r
+    } else {\r
       if (MatchNode == NULL) {\r
         MatchNode = pNode;\r
       } else {\r
@@ -1678,46 +1705,108 @@ CVfrDataStorage::GetVarStoreByDataType (
   return VFR_RETURN_SUCCESS;\r
 }\r
 \r
+EFI_VARSTORE_ID \r
+CVfrDataStorage::CheckGuidField (\r
+  IN  SVfrVarStorageNode   *pNode,\r
+  IN  EFI_GUID             *StoreGuid,\r
+  IN  BOOLEAN              *HasFoundOne,\r
+  OUT EFI_VFR_RETURN_CODE  *ReturnCode\r
+  )\r
+{\r
+  if (StoreGuid != NULL) {\r
+    //\r
+    // If has guid info, compare the guid filed.\r
+    //\r
+    if (memcmp (StoreGuid, &pNode->mGuid, sizeof (EFI_GUID)) == 0) {\r
+      //\r
+      // Both name and guid are same, this this varstore.\r
+      //\r
+      mCurrVarStorageNode = pNode;\r
+      *ReturnCode = VFR_RETURN_SUCCESS;\r
+      return TRUE;\r
+    }\r
+  } else {\r
+    //\r
+    // Not has Guid field, check whether this name is the only one.\r
+    //\r
+    if (*HasFoundOne) {\r
+      //\r
+      // The name has conflict, return name redefined.\r
+      //\r
+      *ReturnCode = VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR;\r
+      return TRUE;\r
+    }\r
+\r
+    *HasFoundOne = TRUE;\r
+    mCurrVarStorageNode = pNode;\r
+  }\r
+\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Base on the input store name and guid to find the varstore id. \r
+\r
+  If both name and guid are inputed, base on the name and guid to\r
+  found the varstore. If only name inputed, base on the name to\r
+  found the varstore and go on to check whether more than one varstore\r
+  has the same name. If only has found one varstore, return this\r
+  varstore; if more than one varstore has same name, return varstore\r
+  name redefined error. If no varstore found by varstore name, call\r
+  function GetVarStoreByDataType and use inputed varstore name as \r
+  data type name to search.\r
+**/\r
 EFI_VFR_RETURN_CODE \r
 CVfrDataStorage::GetVarStoreId (\r
   IN  CHAR8           *StoreName,\r
-  OUT EFI_VARSTORE_ID *VarStoreId\r
+  OUT EFI_VARSTORE_ID *VarStoreId,\r
+  IN  EFI_GUID        *StoreGuid\r
   )\r
 {\r
   EFI_VFR_RETURN_CODE   ReturnCode;\r
   SVfrVarStorageNode    *pNode;\r
+  BOOLEAN               HasFoundOne = FALSE;\r
+\r
+  mCurrVarStorageNode = NULL;\r
 \r
   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
     if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      mCurrVarStorageNode = pNode;\r
-      *VarStoreId = pNode->mVarStoreId;\r
-      return VFR_RETURN_SUCCESS;\r
+      if (CheckGuidField(pNode, StoreGuid, &HasFoundOne, &ReturnCode)) {\r
+        *VarStoreId = mCurrVarStorageNode->mVarStoreId;\r
+        return ReturnCode;\r
+      }\r
     }\r
   }\r
 \r
   for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
     if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      mCurrVarStorageNode = pNode;\r
-      *VarStoreId = pNode->mVarStoreId;\r
-      return VFR_RETURN_SUCCESS;\r
+      if (CheckGuidField(pNode, StoreGuid, &HasFoundOne, &ReturnCode)) {\r
+        *VarStoreId = mCurrVarStorageNode->mVarStoreId;\r
+        return ReturnCode;\r
+      }\r
     }\r
   }\r
 \r
   for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
     if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      mCurrVarStorageNode = pNode;\r
-      *VarStoreId = pNode->mVarStoreId;\r
-      return VFR_RETURN_SUCCESS;\r
+      if (CheckGuidField(pNode, StoreGuid, &HasFoundOne, &ReturnCode)) {\r
+        *VarStoreId = mCurrVarStorageNode->mVarStoreId;\r
+        return ReturnCode;\r
+      }\r
     }\r
   }\r
 \r
-  mCurrVarStorageNode = NULL;\r
+  if (HasFoundOne) {\r
+    *VarStoreId = mCurrVarStorageNode->mVarStoreId;\r
+    return VFR_RETURN_SUCCESS;\r
+  }\r
+\r
   *VarStoreId         = EFI_VARSTORE_ID_INVALID;\r
 \r
   //\r
   // Assume that Data strucutre name is used as StoreName, and check again. \r
   //\r
-  ReturnCode = GetVarStoreByDataType (StoreName, &pNode);\r
+  ReturnCode = GetVarStoreByDataType (StoreName, &pNode, StoreGuid);\r
   if (pNode != NULL) {\r
     mCurrVarStorageNode = pNode;\r
     *VarStoreId = pNode->mVarStoreId;\r
@@ -1728,126 +1817,100 @@ CVfrDataStorage::GetVarStoreId (
 \r
 EFI_VFR_RETURN_CODE\r
 CVfrDataStorage::GetBufferVarStoreDataTypeName (\r
-  IN  CHAR8                  *StoreName,\r
+  IN  EFI_VARSTORE_ID        VarStoreId,\r
   OUT CHAR8                  **DataTypeName\r
   )\r
 {\r
   SVfrVarStorageNode    *pNode;\r
-  EFI_VFR_RETURN_CODE   ReturnCode;\r
 \r
-  if ((StoreName == NULL) || (DataTypeName == NULL)) {\r
+  if (VarStoreId == EFI_VARSTORE_ID_INVALID) {\r
     return VFR_RETURN_FATAL_ERROR;\r
   }\r
 \r
   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      break;\r
+    if (pNode->mVarStoreId == VarStoreId) {\r
+      *DataTypeName = pNode->mStorageInfo.mDataType->mTypeName;\r
+      return VFR_RETURN_SUCCESS;\r
     }\r
   }\r
 \r
-  ReturnCode = VFR_RETURN_UNDEFINED;\r
-  //\r
-  // Assume that Data strucutre name is used as StoreName, and check again. \r
-  //\r
-  if (pNode == NULL) {\r
-    ReturnCode = GetVarStoreByDataType (StoreName, &pNode);\r
-  }\r
-\r
-  if (pNode == NULL) {\r
-    return ReturnCode;\r
-  }\r
-\r
-  if (pNode->mStorageInfo.mDataType == NULL) {\r
-    return VFR_RETURN_FATAL_ERROR;\r
-  }\r
-\r
-  *DataTypeName = pNode->mStorageInfo.mDataType->mTypeName;\r
-  return VFR_RETURN_SUCCESS;\r
+  return VFR_RETURN_UNDEFINED;\r
 }\r
 \r
-EFI_VFR_RETURN_CODE\r
+EFI_VFR_VARSTORE_TYPE\r
 CVfrDataStorage::GetVarStoreType (\r
-  IN  CHAR8                  *StoreName,\r
-  OUT EFI_VFR_VARSTORE_TYPE  &VarStoreType\r
+  IN  EFI_VARSTORE_ID        VarStoreId\r
   )\r
 {\r
   SVfrVarStorageNode    *pNode;\r
-  EFI_VFR_RETURN_CODE   ReturnCode;\r
+  EFI_VFR_VARSTORE_TYPE VarStoreType;\r
 \r
-  if (StoreName == NULL) {\r
-    return VFR_RETURN_FATAL_ERROR;\r
+  VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
+\r
+  if (VarStoreId == EFI_VARSTORE_ID_INVALID) {\r
+    return VarStoreType;\r
   }\r
 \r
   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
+    if (pNode->mVarStoreId == VarStoreId) {\r
       VarStoreType = pNode->mVarStoreType;\r
-      return VFR_RETURN_SUCCESS;\r
+      return VarStoreType;\r
     }\r
   }\r
 \r
   for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
+    if (pNode->mVarStoreId == VarStoreId) {\r
       VarStoreType = pNode->mVarStoreType;\r
-      return VFR_RETURN_SUCCESS;\r
+      return VarStoreType;\r
     }\r
   }\r
 \r
   for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
+    if (pNode->mVarStoreId == VarStoreId) {\r
       VarStoreType = pNode->mVarStoreType;\r
-      return VFR_RETURN_SUCCESS;\r
+      return VarStoreType;\r
     }\r
   }\r
 \r
-  VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
-\r
-  //\r
-  // Assume that Data strucutre name is used as StoreName, and check again. \r
-  //\r
-  ReturnCode = GetVarStoreByDataType (StoreName, &pNode);\r
-  if (pNode != NULL) {\r
-    VarStoreType = pNode->mVarStoreType;\r
-  }\r
-  \r
-  return ReturnCode;\r
+  return VarStoreType;\r
 }\r
 \r
-EFI_VFR_VARSTORE_TYPE\r
-CVfrDataStorage::GetVarStoreType (\r
+EFI_GUID *\r
+CVfrDataStorage::GetVarStoreGuid (\r
   IN  EFI_VARSTORE_ID        VarStoreId\r
   )\r
 {\r
   SVfrVarStorageNode    *pNode;\r
-  EFI_VFR_VARSTORE_TYPE VarStoreType;\r
+  EFI_GUID              *VarGuid;\r
 \r
-  VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
+  VarGuid = NULL;\r
 \r
   if (VarStoreId == EFI_VARSTORE_ID_INVALID) {\r
-    return VarStoreType;\r
+    return VarGuid;\r
   }\r
 \r
   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
     if (pNode->mVarStoreId == VarStoreId) {\r
-      VarStoreType = pNode->mVarStoreType;\r
-      return VarStoreType;\r
+      VarGuid = &pNode->mGuid;\r
+      return VarGuid;\r
     }\r
   }\r
 \r
   for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
     if (pNode->mVarStoreId == VarStoreId) {\r
-      VarStoreType = pNode->mVarStoreType;\r
-      return VarStoreType;\r
+      VarGuid = &pNode->mGuid;\r
+      return VarGuid;\r
     }\r
   }\r
 \r
   for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
     if (pNode->mVarStoreId == VarStoreId) {\r
-      VarStoreType = pNode->mVarStoreType;\r
-      return VarStoreType;\r
+      VarGuid = &pNode->mGuid;\r
+      return VarGuid;\r
     }\r
   }\r
 \r
-  return VarStoreType;\r
+  return VarGuid;\r
 }\r
 \r
 EFI_VFR_RETURN_CODE\r
@@ -1951,44 +2014,6 @@ CVfrDataStorage::GetNameVarStoreInfo (
   return VFR_RETURN_SUCCESS;\r
 }\r
 \r
-EFI_VFR_RETURN_CODE\r
-CVfrDataStorage::BufferVarStoreRequestElementAdd (\r
-  IN CHAR8             *StoreName,\r
-  IN EFI_VARSTORE_INFO &Info\r
-  )\r
-{\r
-  SVfrVarStorageNode    *pNode = NULL;\r
-  EFI_IFR_TYPE_VALUE    Value = gZeroEfiIfrTypeValue;\r
-  EFI_VFR_RETURN_CODE   ReturnCode;\r
-\r
-  for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      break;\r
-    }\r
-  }\r
-\r
-  ReturnCode = VFR_RETURN_UNDEFINED;\r
-  //\r
-  // Assume that Data strucutre name is used as StoreName, and check again. \r
-  //\r
-  if (pNode == NULL) {\r
-    ReturnCode = GetVarStoreByDataType (StoreName, &pNode);\r
-  }\r
-\r
-  if (pNode == NULL) {\r
-    return ReturnCode;\r
-  }\r
-\r
-  gCVfrBufferConfig.Open ();\r
-  Value.u8 = 0;\r
-  if (gCVfrBufferConfig.Write ('a', StoreName, NULL, EFI_IFR_TYPE_NUM_SIZE_8, Info.mInfo.mVarOffset, Info.mVarTotalSize, Value) != 0) {\r
-    return VFR_RETURN_FATAL_ERROR;\r
-  }\r
-  gCVfrBufferConfig.Close ();\r
-\r
-  return VFR_RETURN_SUCCESS;\r
-}\r
-\r
 SVfrDefaultStoreNode::SVfrDefaultStoreNode (\r
   IN EFI_IFR_DEFAULTSTORE *ObjBinAddr,\r
   IN CHAR8                *RefName, \r
@@ -2155,6 +2180,7 @@ CVfrDefaultStore::BufferVarStoreAltConfigAdd (
   IN EFI_VARSTORE_ID    DefaultId,\r
   IN EFI_VARSTORE_INFO  &Info,\r
   IN CHAR8              *VarStoreName,\r
+  IN EFI_GUID           *VarStoreGuid,\r
   IN UINT8              Type,\r
   IN EFI_IFR_TYPE_VALUE Value\r
   )\r
@@ -2180,8 +2206,8 @@ CVfrDefaultStore::BufferVarStoreAltConfigAdd (
   gCVfrBufferConfig.Open ();\r
 \r
   sprintf (NewAltCfg, "%04x", pNode->mDefaultId);\r
-  if ((Returnvalue = gCVfrBufferConfig.Select(VarStoreName)) == 0) {\r
-    if ((Returnvalue = gCVfrBufferConfig.Write ('a', VarStoreName, NewAltCfg, Type, Info.mInfo.mVarOffset, Info.mVarTotalSize, Value)) != 0) {\r
+  if ((Returnvalue = gCVfrBufferConfig.Select(VarStoreName, VarStoreGuid)) == 0) {\r
+    if ((Returnvalue = gCVfrBufferConfig.Write ('a', VarStoreName, VarStoreGuid, NewAltCfg, Type, Info.mInfo.mVarOffset, Info.mVarTotalSize, Value)) != 0) {\r
       goto WriteError;\r
     }\r
   }\r
@@ -2592,26 +2618,46 @@ CVfrQuestionDB::RegisterNewDateQuestion (
   CHAR8                *VarIdStr[3] = {NULL, };\r
   CHAR8                 Index;\r
 \r
-  if (BaseVarId == NULL) {\r
+  if (BaseVarId == NULL && Name == NULL) {\r
     return;\r
   }\r
 \r
-  Len = strlen (BaseVarId);\r
+  if (BaseVarId != NULL) {\r
+    Len = strlen (BaseVarId);\r
 \r
-  VarIdStr[0] = new CHAR8[Len + strlen (".Year") + 1];\r
-  if (VarIdStr[0] != NULL) {\r
-    strcpy (VarIdStr[0], BaseVarId);\r
-    strcat (VarIdStr[0], ".Year");\r
-  }\r
-  VarIdStr[1] = new CHAR8[Len + strlen (".Month") + 1];\r
-  if (VarIdStr[1] != NULL) {\r
-    strcpy (VarIdStr[1], BaseVarId);\r
-    strcat (VarIdStr[1], ".Month");\r
-  }\r
-  VarIdStr[2] = new CHAR8[Len + strlen (".Day") + 1];\r
-  if (VarIdStr[2] != NULL) {\r
-    strcpy (VarIdStr[2], BaseVarId);\r
-    strcat (VarIdStr[2], ".Day");\r
+    VarIdStr[0] = new CHAR8[Len + strlen (".Year") + 1];\r
+    if (VarIdStr[0] != NULL) {\r
+      strcpy (VarIdStr[0], BaseVarId);\r
+      strcat (VarIdStr[0], ".Year");\r
+    }\r
+    VarIdStr[1] = new CHAR8[Len + strlen (".Month") + 1];\r
+    if (VarIdStr[1] != NULL) {\r
+      strcpy (VarIdStr[1], BaseVarId);\r
+      strcat (VarIdStr[1], ".Month");\r
+    }\r
+    VarIdStr[2] = new CHAR8[Len + strlen (".Day") + 1];\r
+    if (VarIdStr[2] != NULL) {\r
+      strcpy (VarIdStr[2], BaseVarId);\r
+      strcat (VarIdStr[2], ".Day");\r
+    }\r
+  } else {\r
+    Len = strlen (Name);\r
+\r
+    VarIdStr[0] = new CHAR8[Len + strlen (".Year") + 1];\r
+    if (VarIdStr[0] != NULL) {\r
+      strcpy (VarIdStr[0], Name);\r
+      strcat (VarIdStr[0], ".Year");\r
+    }\r
+    VarIdStr[1] = new CHAR8[Len + strlen (".Month") + 1];\r
+    if (VarIdStr[1] != NULL) {\r
+      strcpy (VarIdStr[1], Name);\r
+      strcat (VarIdStr[1], ".Month");\r
+    }\r
+    VarIdStr[2] = new CHAR8[Len + strlen (".Day") + 1];\r
+    if (VarIdStr[2] != NULL) {\r
+      strcpy (VarIdStr[2], Name);\r
+      strcat (VarIdStr[2], ".Day");\r
+    }\r
   }\r
 \r
   if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0], DATE_YEAR_BITMASK)) == NULL) {\r
@@ -2740,26 +2786,46 @@ CVfrQuestionDB::RegisterNewTimeQuestion (
   CHAR8                *VarIdStr[3] = {NULL, };\r
   CHAR8                 Index;\r
 \r
-  if (BaseVarId == NULL) {\r
+  if (BaseVarId == NULL && Name == NULL) {\r
     return;\r
   }\r
 \r
-  Len = strlen (BaseVarId);\r
+  if (BaseVarId != NULL) {\r
+    Len = strlen (BaseVarId);\r
 \r
-  VarIdStr[0] = new CHAR8[Len + strlen (".Hour") + 1];\r
-  if (VarIdStr[0] != NULL) {\r
-    strcpy (VarIdStr[0], BaseVarId);\r
-    strcat (VarIdStr[0], ".Hour");\r
-  }\r
-  VarIdStr[1] = new CHAR8[Len + strlen (".Minute") + 1];\r
-  if (VarIdStr[1] != NULL) {\r
-    strcpy (VarIdStr[1], BaseVarId);\r
-    strcat (VarIdStr[1], ".Minute");\r
-  }\r
-  VarIdStr[2] = new CHAR8[Len + strlen (".Second") + 1];\r
-  if (VarIdStr[2] != NULL) {\r
-    strcpy (VarIdStr[2], BaseVarId);\r
-    strcat (VarIdStr[2], ".Second");\r
+    VarIdStr[0] = new CHAR8[Len + strlen (".Hour") + 1];\r
+    if (VarIdStr[0] != NULL) {\r
+      strcpy (VarIdStr[0], BaseVarId);\r
+      strcat (VarIdStr[0], ".Hour");\r
+    }\r
+    VarIdStr[1] = new CHAR8[Len + strlen (".Minute") + 1];\r
+    if (VarIdStr[1] != NULL) {\r
+      strcpy (VarIdStr[1], BaseVarId);\r
+      strcat (VarIdStr[1], ".Minute");\r
+    }\r
+    VarIdStr[2] = new CHAR8[Len + strlen (".Second") + 1];\r
+    if (VarIdStr[2] != NULL) {\r
+      strcpy (VarIdStr[2], BaseVarId);\r
+      strcat (VarIdStr[2], ".Second");\r
+    }\r
+  } else {\r
+    Len = strlen (Name);\r
+\r
+    VarIdStr[0] = new CHAR8[Len + strlen (".Hour") + 1];\r
+    if (VarIdStr[0] != NULL) {\r
+      strcpy (VarIdStr[0], Name);\r
+      strcat (VarIdStr[0], ".Hour");\r
+    }\r
+    VarIdStr[1] = new CHAR8[Len + strlen (".Minute") + 1];\r
+    if (VarIdStr[1] != NULL) {\r
+      strcpy (VarIdStr[1], Name);\r
+      strcat (VarIdStr[1], ".Minute");\r
+    }\r
+    VarIdStr[2] = new CHAR8[Len + strlen (".Second") + 1];\r
+    if (VarIdStr[2] != NULL) {\r
+      strcpy (VarIdStr[2], Name);\r
+      strcat (VarIdStr[2], ".Second");\r
+    }\r
   }\r
 \r
   if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0], TIME_HOUR_BITMASK)) == NULL) {\r
@@ -2828,31 +2894,56 @@ CVfrQuestionDB::RegisterRefQuestion (
   CHAR8                *VarIdStr[4] = {NULL, };\r
   CHAR8                 Index;\r
 \r
-  if (BaseVarId == NULL) {\r
+  if (BaseVarId == NULL && Name == NULL) {\r
     return;\r
   }\r
 \r
-  Len = strlen (BaseVarId);\r
+  if (BaseVarId != NULL) {\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
+    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
+  } else {\r
+    Len = strlen (Name);\r
+\r
+    VarIdStr[0] = new CHAR8[Len + strlen (".QuestionId") + 1];\r
+    if (VarIdStr[0] != NULL) {\r
+      strcpy (VarIdStr[0], Name);\r
+      strcat (VarIdStr[0], ".QuestionId");\r
+    }\r
+    VarIdStr[1] = new CHAR8[Len + strlen (".FormId") + 1];\r
+    if (VarIdStr[1] != NULL) {\r
+      strcpy (VarIdStr[1], Name);\r
+      strcat (VarIdStr[1], ".FormId");\r
+    }\r
+    VarIdStr[2] = new CHAR8[Len + strlen (".FormSetGuid") + 1];\r
+    if (VarIdStr[2] != NULL) {\r
+      strcpy (VarIdStr[2], Name);\r
+      strcat (VarIdStr[2], ".FormSetGuid");\r
+    }\r
+    VarIdStr[3] = new CHAR8[Len + strlen (".DevicePath") + 1];\r
+    if (VarIdStr[3] != NULL) {\r
+      strcpy (VarIdStr[3], Name);\r
+      strcat (VarIdStr[3], ".DevicePath");\r
+    }\r
   }\r
 \r
   if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0])) == NULL) {\r
index 2c0ed7bd54d7fb799b7f54965414b35ecbe52032..2847a74a7b96b51cd658d5c906d75bbcda3647fd 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Vfr common library functions.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -57,13 +57,14 @@ struct SConfigInfo {
 \r
 struct SConfigItem {\r
   CHAR8         *mName;         // varstore name\r
-  CHAR8         *mId;           // varstore ID\r
+  EFI_GUID      *mGuid;         // varstore guid, varstore name + guid deside one varstore\r
+  CHAR8         *mId;           // default ID\r
   SConfigInfo   *mInfoStrList;  // list of Offset/Value in the varstore\r
   SConfigItem   *mNext;\r
 \r
 public:\r
-  SConfigItem (IN CHAR8 *, IN CHAR8 *);\r
-  SConfigItem (IN CHAR8 *, IN CHAR8 *, IN UINT8, IN UINT16, IN UINT16, IN EFI_IFR_TYPE_VALUE);\r
+  SConfigItem (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *);\r
+  SConfigItem (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *, IN UINT8, IN UINT16, IN UINT16, IN EFI_IFR_TYPE_VALUE);\r
   virtual ~SConfigItem ();\r
 };\r
 \r
@@ -77,11 +78,11 @@ public:
   CVfrBufferConfig (VOID);\r
   virtual ~CVfrBufferConfig (VOID);\r
 \r
-  virtual UINT8   Register (IN CHAR8 *, IN CHAR8 *Info = NULL);\r
+  virtual UINT8   Register (IN CHAR8 *, IN EFI_GUID *,IN CHAR8 *Info = NULL);\r
   virtual VOID    Open (VOID);\r
   virtual BOOLEAN Eof(VOID);\r
-  virtual UINT8   Select (IN CHAR8 *, IN CHAR8 *Info = NULL);\r
-  virtual UINT8   Write (IN CONST CHAR8, IN CHAR8 *, IN CHAR8 *, IN UINT8, IN UINT16, IN UINT32, IN EFI_IFR_TYPE_VALUE);\r
+  virtual UINT8   Select (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *Info = NULL);\r
+  virtual UINT8   Write (IN CONST CHAR8, IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *, IN UINT8, IN UINT16, IN UINT32, IN EFI_IFR_TYPE_VALUE);\r
 #if 0\r
   virtual UINT8   Read (OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **);\r
 #endif\r
@@ -284,6 +285,10 @@ private:
   BOOLEAN         ChekVarStoreIdFree (IN EFI_VARSTORE_ID);\r
   VOID            MarkVarStoreIdUsed (IN EFI_VARSTORE_ID);\r
   VOID            MarkVarStoreIdUnused (IN EFI_VARSTORE_ID);\r
+  EFI_VARSTORE_ID CheckGuidField (IN SVfrVarStorageNode *, \r
+                                  IN EFI_GUID *, \r
+                                  IN BOOLEAN *, \r
+                                  OUT EFI_VFR_RETURN_CODE *);\r
 \r
 public:\r
   CVfrDataStorage ();\r
@@ -303,17 +308,15 @@ public:
 \r
   EFI_VFR_RETURN_CODE DeclareBufferVarStore (IN CHAR8 *, IN EFI_GUID *, IN CVfrVarDataTypeDB *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN BOOLEAN Flag = TRUE);\r
 \r
-  EFI_VFR_RETURN_CODE GetVarStoreId (IN CHAR8 *, OUT EFI_VARSTORE_ID *);\r
-  EFI_VFR_RETURN_CODE GetVarStoreType (IN CHAR8 *, OUT EFI_VFR_VARSTORE_TYPE &);\r
+  EFI_VFR_RETURN_CODE GetVarStoreId (IN CHAR8 *, OUT EFI_VARSTORE_ID *, IN EFI_GUID *VarGuid = NULL);\r
   EFI_VFR_VARSTORE_TYPE GetVarStoreType (IN EFI_VARSTORE_ID);\r
+  EFI_GUID *          GetVarStoreGuid (IN  EFI_VARSTORE_ID);\r
   EFI_VFR_RETURN_CODE GetVarStoreName (IN EFI_VARSTORE_ID, OUT CHAR8 **);\r
-  EFI_VFR_RETURN_CODE GetVarStoreByDataType (IN CHAR8 *, OUT SVfrVarStorageNode **);\r
+  EFI_VFR_RETURN_CODE GetVarStoreByDataType (IN CHAR8 *, OUT SVfrVarStorageNode **, IN EFI_GUID *VarGuid = NULL);\r
 \r
-  EFI_VFR_RETURN_CODE GetBufferVarStoreDataTypeName (IN CHAR8 *, OUT CHAR8 **);\r
+  EFI_VFR_RETURN_CODE GetBufferVarStoreDataTypeName (IN EFI_VARSTORE_ID, OUT CHAR8 **);\r
   EFI_VFR_RETURN_CODE GetEfiVarStoreInfo (IN EFI_VARSTORE_INFO *);\r
   EFI_VFR_RETURN_CODE GetNameVarStoreInfo (IN EFI_VARSTORE_INFO *, IN UINT32);\r
-\r
-  EFI_VFR_RETURN_CODE BufferVarStoreRequestElementAdd (IN CHAR8 *, IN EFI_VARSTORE_INFO &);\r
 };\r
 \r
 #define EFI_QUESTION_ID_MAX              0xFFFF\r
@@ -396,7 +399,7 @@ public:
   EFI_VFR_RETURN_CODE ReRegisterDefaultStoreById (IN UINT16, IN CHAR8 *, IN EFI_STRING_ID);\r
   BOOLEAN             DefaultIdRegistered (IN UINT16);\r
   EFI_VFR_RETURN_CODE GetDefaultId (IN CHAR8 *, OUT UINT16 *);\r
-  EFI_VFR_RETURN_CODE BufferVarStoreAltConfigAdd (IN EFI_VARSTORE_ID, IN EFI_VARSTORE_INFO &, IN CHAR8 *, IN UINT8, IN EFI_IFR_TYPE_VALUE);\r
+  EFI_VFR_RETURN_CODE BufferVarStoreAltConfigAdd (IN EFI_VARSTORE_ID, IN EFI_VARSTORE_INFO &, IN CHAR8 *, IN EFI_GUID *, IN UINT8, IN EFI_IFR_TYPE_VALUE);\r
 };\r
 \r
 #define EFI_RULE_ID_START    0x01\r
index d5594d07a07f2889e3653691cf8ee6d136e73438..d5f115abed73d0b87741f0ec6b175d07ee57524a 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'VolInfo' module build.\r
+# GNU/Linux makefile for 'VolInfo' module build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 3261892bc55dbdcf8c9f883b716dbfc4cb7bdda1..6711880f60372f2781f8a6a03183de4abe95690f 100644 (file)
@@ -293,12 +293,13 @@ class WorkspaceAutoGen(AutoGen):
             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
 \r
             DecPcds = {}\r
+            DecPcdsKey = set()\r
             PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)\r
             Pkgs = PGen.PackageList\r
             for Pkg in Pkgs:\r
                 for Pcd in Pkg.Pcds:\r
                     DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]\r
-            Platform.IsPlatformPcdDeclared(DecPcds)\r
+                    DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2]))\r
 \r
             Platform.SkuName = self.SkuId\r
             for Name, Guid in PcdSet:\r
@@ -310,7 +311,21 @@ class WorkspaceAutoGen(AutoGen):
                         File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],\r
                         Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]\r
                     )\r
-                Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])\r
+                else:\r
+                    # Check whether Dynamic or DynamicEx PCD used in FDF file. If used, build break and give a error message.\r
+                    if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey \\r
+                        or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in DecPcdsKey \\r
+                        or (Name, Guid, TAB_PCDS_FEATURE_FLAG) in DecPcdsKey:\r
+                        Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])\r
+                        continue\r
+                    elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey:\r
+                        EdkLogger.error(\r
+                                'build',\r
+                                PARSER_ERROR,\r
+                                "Using Dynamic or DynamicEx type of PCD [%s.%s] in FDF file is not allowed." % (Guid, Name),\r
+                                File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],\r
+                                Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]\r
+                        )\r
 \r
             Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)\r
             #\r
index fafcd70b86cb82f94eaa3a9fa7c65375b2fc0162..2eb920417e2d5991d4cf085e380073064e722bad 100644 (file)
@@ -2043,7 +2043,8 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH):
         if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds:
             AutoGenH.Append("#include <Library/PcdLib.h>\n")
 
-        AutoGenH.Append('\nextern GUID  gEfiCallerIdGuid;\n\n')
+        AutoGenH.Append('\nextern GUID  gEfiCallerIdGuid;')
+        AutoGenH.Append('\nextern CHAR8 *gEfiCallerBaseName;\n\n')
 
         if Info.IsLibrary:
             return
@@ -2066,6 +2067,7 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH):
         # Publish the CallerId Guid
         #
         AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = %s;\n' % GuidStringToGuidStructureString(Info.Guid))
+        AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBaseName = "%s";\n' % Info.Name)
 
 ## Create common code for header file
 #
index ea27607fce6dbb668a37881748b972b13fec4351..7b1ce72ea7c0b64b902d15cf6c5ca0704d4dcfcd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2012, 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
@@ -38,6 +38,9 @@ LF = u'\u000A'
 NULL = u'\u0000'\r
 TAB = u'\t'\r
 BACK_SPLASH = u'\\'\r
+DOBULE_QUOTED_SPLASH = u'\\"'\r
+SIGLE_QUOTED_SPLASH = u"\\'"\r
+TAB_BACK_SLASH = u"\\/"\r
 \r
 gIncludePattern = re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$", re.MULTILINE | re.UNICODE)\r
 \r
@@ -334,11 +337,11 @@ class UniFileClassObject(object):
             Line = Line.replace(u'/language', u'#language')\r
             Line = Line.replace(u'/include', u'#include')\r
 \r
+            Line = Line.replace(u'\\\\', u'\u0006')\r
             Line = Line.replace(UNICODE_WIDE_CHAR, WIDE_CHAR)\r
             Line = Line.replace(UNICODE_NARROW_CHAR, NARROW_CHAR)\r
             Line = Line.replace(UNICODE_NON_BREAKING_CHAR, NON_BREAKING_CHAR)\r
 \r
-            Line = Line.replace(u'\\\\', u'\u0006')\r
             Line = Line.replace(u'\\r\\n', CR + LF)\r
             Line = Line.replace(u'\\n', CR + LF)\r
             Line = Line.replace(u'\\r', CR)\r
@@ -346,7 +349,10 @@ class UniFileClassObject(object):
             Line = Line.replace(u'''\"''', u'''"''')\r
             Line = Line.replace(u'\t', u' ')\r
             Line = Line.replace(u'\u0006', u'\\')\r
-            \r
+            Line = Line.replace(DOBULE_QUOTED_SPLASH, u'"')\r
+            Line = Line.replace(SIGLE_QUOTED_SPLASH, u"'")\r
+            Line = Line.replace(TAB_BACK_SLASH, u"/")\r
+\r
 #           if Line.find(u'\\x'):\r
 #               hex = Line[Line.find(u'\\x') + 2 : Line.find(u'\\x') + 6]\r
 #               hex = "u'\\u" + hex + "'"\r
index 0323fafa3cf9e1f26dc08c8e2147a10e65ac9b8b..7414d30f49eaed39241c26a71192e5227b760ae6 100644 (file)
@@ -13,4 +13,4 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-gBUILD_VERSION = "Build 2524"\r
+gBUILD_VERSION = ""\r
index e5e7eaeede4191543ea4b960d1bfe4404fd70c67..3a82362100f368021baf5641f6947bc516a9f20f 100644 (file)
@@ -1,7 +1,8 @@
 ## @file\r
 # This file is used to define common static strings used by INF/DEC/DSC files\r
 #\r
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Portions copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -18,6 +19,7 @@ TAB_COMMENT_EDK_START = '/*'
 TAB_COMMENT_EDK_END = '*/'\r
 TAB_COMMENT_EDK_SPLIT = '//'\r
 TAB_COMMENT_SPLIT = '#'\r
+TAB_SPECIAL_COMMENT = '##'\r
 TAB_EQUAL_SPLIT = '='\r
 TAB_VALUE_SPLIT = '|'\r
 TAB_COMMA_SPLIT = ','\r
@@ -26,10 +28,18 @@ TAB_SEMI_COLON_SPLIT = ';'
 TAB_SECTION_START = '['\r
 TAB_SECTION_END = ']'\r
 TAB_OPTION_START = '<'\r
-TAB_OPTION_END  = '>'\r
+TAB_OPTION_END = '>'\r
 TAB_SLASH = '\\'\r
 TAB_BACK_SLASH = '/'\r
 TAB_LINE_BREAK = '\n'\r
+TAB_PRINTCHAR_VT = '\x0b'\r
+TAB_PRINTCHAR_BS = '\b'\r
+TAB_PRINTCHAR_NUL = '\0'\r
+TAB_UINT8 = 'UINT8'\r
+TAB_UINT16 = 'UINT16'\r
+TAB_UINT32 = 'UINT32'\r
+TAB_UINT64 = 'UINT64'\r
+TAB_VOID = 'VOID*'\r
 \r
 TAB_EDK_SOURCE = '$(EDK_SOURCE)'\r
 TAB_EFI_SOURCE = '$(EFI_SOURCE)'\r
@@ -42,8 +52,9 @@ TAB_ARCH_X64 = 'X64'
 TAB_ARCH_IPF = 'IPF'\r
 TAB_ARCH_ARM = 'ARM'\r
 TAB_ARCH_EBC = 'EBC'\r
+TAB_ARCH_AARCH64 = 'AARCH64'\r
 \r
-ARCH_LIST = [TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC]\r
+ARCH_LIST = [TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC, TAB_ARCH_AARCH64]\r
 ARCH_LIST_FULL = [TAB_ARCH_COMMON] + ARCH_LIST\r
 \r
 SUP_MODULE_BASE = 'BASE'\r
@@ -75,7 +86,7 @@ EDK_COMPONENT_TYPE_BS_DRIVER = 'BS_DRIVER'
 EDK_COMPONENT_TYPE_RT_DRIVER = 'RT_DRIVER'\r
 EDK_COMPONENT_TYPE_SAL_RT_DRIVER = 'SAL_RT_DRIVER'\r
 EDK_COMPONENT_TYPE_APPLICATION = 'APPLICATION'\r
-EDK_NAME   = 'EDK'\r
+EDK_NAME = 'EDK'\r
 EDKII_NAME = 'EDKII'\r
 \r
 BINARY_FILE_TYPE_FW = 'FW'\r
@@ -109,6 +120,7 @@ TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_X64
 TAB_SOURCES_IPF = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_SOURCES_AARCH64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_BINARIES = 'Binaries'\r
 TAB_BINARIES_COMMON = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -117,6 +129,7 @@ TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_X64
 TAB_BINARIES_IPF = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_BINARIES_AARCH64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_INCLUDES = 'Includes'\r
 TAB_INCLUDES_COMMON = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -125,6 +138,7 @@ TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_X64
 TAB_INCLUDES_IPF = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_INCLUDES_AARCH64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_GUIDS = 'Guids'\r
 TAB_GUIDS_COMMON = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -133,6 +147,7 @@ TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_X64
 TAB_GUIDS_IPF = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_GUIDS_AARCH64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PROTOCOLS = 'Protocols'\r
 TAB_PROTOCOLS_COMMON = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -141,6 +156,7 @@ TAB_PROTOCOLS_X64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_X64
 TAB_PROTOCOLS_IPF = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PROTOCOLS_AARCH64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PPIS = 'Ppis'\r
 TAB_PPIS_COMMON = TAB_PPIS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -149,6 +165,7 @@ TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_X64
 TAB_PPIS_IPF = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PPIS_AARCH64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_LIBRARY_CLASSES = 'LibraryClasses'\r
 TAB_LIBRARY_CLASSES_COMMON = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -157,6 +174,7 @@ TAB_LIBRARY_CLASSES_X64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_X64
 TAB_LIBRARY_CLASSES_IPF = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_LIBRARY_CLASSES_AARCH64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PACKAGES = 'Packages'\r
 TAB_PACKAGES_COMMON = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -165,6 +183,7 @@ TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_X64
 TAB_PACKAGES_IPF = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PACKAGES_AARCH64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS = 'Pcds'\r
 TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'\r
@@ -192,6 +211,7 @@ TAB_PCDS_FIXED_AT_BUILD_X64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + T
 TAB_PCDS_FIXED_AT_BUILD_IPF = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_FIXED_AT_BUILD_AARCH64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_PATCHABLE_IN_MODULE_NULL = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE\r
 TAB_PCDS_PATCHABLE_IN_MODULE_COMMON = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -200,6 +220,7 @@ TAB_PCDS_PATCHABLE_IN_MODULE_X64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB
 TAB_PCDS_PATCHABLE_IN_MODULE_IPF = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_FEATURE_FLAG_NULL = TAB_PCDS + TAB_PCDS_FEATURE_FLAG\r
 TAB_PCDS_FEATURE_FLAG_COMMON = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -208,6 +229,7 @@ TAB_PCDS_FEATURE_FLAG_X64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_A
 TAB_PCDS_FEATURE_FLAG_IPF = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_FEATURE_FLAG_AARCH64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX\r
 TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAULT\r
@@ -219,6 +241,7 @@ TAB_PCDS_DYNAMIC_EX_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_
 TAB_PCDS_DYNAMIC_EX_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_DYNAMIC_EX_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC\r
 TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT\r
@@ -230,6 +253,7 @@ TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64
 TAB_PCDS_DYNAMIC_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_DYNAMIC_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC_DEFAULT_NULL, TAB_PCDS_DYNAMIC_VPD_NULL, TAB_PCDS_DYNAMIC_HII_NULL]\r
 TAB_PCD_DYNAMIC_EX_TYPE_LIST = [TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, TAB_PCDS_DYNAMIC_EX_VPD_NULL, TAB_PCDS_DYNAMIC_EX_HII_NULL]\r
@@ -254,6 +278,7 @@ TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
 TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_DEPEX_AARCH64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_SKUIDS = 'SkuIds'\r
 \r
@@ -264,6 +289,7 @@ TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_X64
 TAB_LIBRARIES_IPF = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_LIBRARIES_AARCH64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_COMPONENTS = 'Components'\r
 TAB_COMPONENTS_COMMON = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -272,6 +298,7 @@ TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
 TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'\r
 \r
@@ -328,6 +355,25 @@ TAB_INF_FEATURE_PCD = 'FeaturePcd'
 TAB_INF_PATCH_PCD = 'PatchPcd'\r
 TAB_INF_PCD = 'Pcd'\r
 TAB_INF_PCD_EX = 'PcdEx'\r
+TAB_INF_USAGE_PRO = 'PRODUCES'\r
+TAB_INF_USAGE_SOME_PRO = 'SOMETIMES_PRODUCES'\r
+TAB_INF_USAGE_CON = 'CONSUMES'\r
+TAB_INF_USAGE_SOME_CON = 'SOMETIMES_CONSUMES'\r
+TAB_INF_USAGE_NOTIFY = 'NOTIFY'\r
+TAB_INF_USAGE_TO_START = 'TO_START'\r
+TAB_INF_USAGE_BY_START = 'BY_START'\r
+TAB_INF_GUIDTYPE_EVENT = 'Event'\r
+TAB_INF_GUIDTYPE_FILE = 'File'\r
+TAB_INF_GUIDTYPE_FV = 'FV'\r
+TAB_INF_GUIDTYPE_GUID = 'GUID'\r
+TAB_INF_GUIDTYPE_HII = 'HII'\r
+TAB_INF_GUIDTYPE_HOB = 'HOB'\r
+TAB_INF_GUIDTYPE_ST = 'SystemTable'\r
+TAB_INF_GUIDTYPE_TSG = 'TokenSpaceGuid'\r
+TAB_INF_GUIDTYPE_VAR = 'Variable'\r
+TAB_INF_GUIDTYPE_PROTOCOL = 'PROTOCOL'\r
+TAB_INF_GUIDTYPE_PPI = 'PPI'\r
+TAB_INF_GUIDTYPE_UNDEFINED = 'UNDEFINED'\r
 \r
 #\r
 # Dec Definitions\r
@@ -430,3 +476,22 @@ TAB_BRG_LIBRARY = 'Library'
 # Build Rule File Version Definition\r
 #\r
 TAB_BUILD_RULE_VERSION = "build_rule_version"\r
+\r
+# section name for PCDs\r
+PCDS_DYNAMIC_DEFAULT = "PcdsDynamicDefault"\r
+PCDS_DYNAMIC_VPD = "PcdsDynamicVpd"\r
+PCDS_DYNAMIC_HII = "PcdsDynamicHii"\r
+PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"\r
+PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"\r
+PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"\r
+\r
+# Section allowed to have items after arch\r
+SECTIONS_HAVE_ITEM_AFTER_ARCH = [TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),\r
+                                 PCDS_DYNAMIC_DEFAULT.upper(),\r
+                                 PCDS_DYNAMIC_VPD.upper(),\r
+                                 PCDS_DYNAMIC_HII.upper(),\r
+                                 PCDS_DYNAMICEX_DEFAULT.upper(),\r
+                                 PCDS_DYNAMICEX_VPD.upper(),\r
+                                 PCDS_DYNAMICEX_HII.upper(),\r
+                                 TAB_BUILD_OPTIONS.upper(),\r
+                                 TAB_INCLUDES.upper()]\r
index 26a9b324e6ebb03717e7c9ba95fe0f494f42516f..2b5990ebe713f102959ded6fcb27af8b03dbea2a 100644 (file)
@@ -405,7 +405,7 @@ class ItemBuild(object):
 #\r
 # @var WorkspaceDir:      To store value for WorkspaceDir\r
 # @var SupArchList:       To store value for SupArchList, selection scope is in below list\r
-#                         EBC | IA32 | X64 | IPF | ARM | PPC\r
+#                         EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64\r
 # @var BuildTarget:       To store value for WorkspaceDir, selection scope is in below list\r
 #                         RELEASE | DEBUG\r
 # @var SkuId:             To store value for SkuId\r
index 80fad7563d17909bcdde8d6b6302ec60142b5493..3c8d14e6ce5448582773d0a03c24c7c05d4383fb 100644 (file)
@@ -246,12 +246,14 @@ class ValueExpression(object):
     #   @return: True or False if RealValue is False\r
     #            Evaluated value of string format if RealValue is True\r
     #\r
-    def __call__(self, RealValue=False):\r
+    def __call__(self, RealValue=False, Depth=0):\r
         if self._NoProcess:\r
             return self._Expr\r
 \r
+        self._Depth = Depth\r
+\r
         self._Expr = self._Expr.strip()\r
-        if RealValue:\r
+        if RealValue and Depth == 0:\r
             self._Token = self._Expr\r
             if self.__IsNumberToken():\r
                 return self._Expr\r
@@ -471,7 +473,7 @@ class ValueExpression(object):
                 Ex = BadExpression(ERR_PCD_RESOLVE % self._Token)\r
                 Ex.Pcd = self._Token\r
                 raise Ex\r
-            self._Token = ValueExpression(self._Symb[self._Token], self._Symb)(True)\r
+            self._Token = ValueExpression(self._Symb[self._Token], self._Symb)(True, self._Depth+1)\r
             if type(self._Token) != type(''):\r
                 self._LiteralToken = hex(self._Token)\r
                 return\r
@@ -551,7 +553,7 @@ class ValueExpression(object):
             if Match and not Expr[Match.end():Match.end()+1].isalnum() \\r
                 and Expr[Match.end():Match.end()+1] != '_':\r
                 self._Idx += Match.end()\r
-                self._Token = ValueExpression(GuidStringToGuidStructureString(Expr[0:Match.end()]))(True)\r
+                self._Token = ValueExpression(GuidStringToGuidStructureString(Expr[0:Match.end()]))(True, self._Depth+1)\r
                 return self._Token\r
             elif self.__IsIdChar(Ch):\r
                 return self.__GetIdToken()\r
index 87595df1e7eb728c3d975d755bea27373f4fcc4c..031dc15bc7665b8cab3de77b574a999202ffb098 100644 (file)
@@ -2769,7 +2769,7 @@ class FdfParser(object):
             raise Warning("expected '.' At Line ", self.FileName, self.CurrentLineNumber)\r
         \r
         Arch = self.__SkippedChars.rstrip(".")\r
-        if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "COMMON"):\r
+        if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):\r
             raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)\r
         \r
         ModuleType = self.__GetModuleType()\r
@@ -3356,7 +3356,7 @@ class FdfParser(object):
             raise Warning("expected '.' At Line ", self.FileName, self.CurrentLineNumber)\r
 \r
         Arch = self.__SkippedChars.rstrip(".").upper()\r
-        if Arch not in ("IA32", "X64", "IPF", "ARM"):\r
+        if Arch not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):\r
             raise Warning("Unknown Arch At line ", self.FileName, self.CurrentLineNumber)\r
 \r
         if not self.__GetNextWord():\r
@@ -3370,7 +3370,7 @@ class FdfParser(object):
         if self.__IsToken(","):\r
             if not self.__GetNextWord():\r
                 raise Warning("expected Arch list At Line ", self.FileName, self.CurrentLineNumber)\r
-            if self.__Token.upper() not in ("IA32", "X64", "IPF", "ARM"):\r
+            if self.__Token.upper() not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):\r
                 raise Warning("Unknown Arch At line ", self.FileName, self.CurrentLineNumber)\r
             VtfObj.ArchList = self.__Token.upper()\r
 \r
index b15daa8448167a6a30e129da0621e3caa32040fa..7c69704596333faf5909cc1da6b738bd140c7fbd 100644 (file)
@@ -360,7 +360,7 @@ def StoreTextFile(TextFile, Content):
 # The possible duplication is ensured to be removed.\r
 #\r
 # @param  Section            Section dictionary indexed by CPU architecture.\r
-# @param  Arch               CPU architecture: Ia32, X64, Ipf, ARM, Ebc or Common.\r
+# @param  Arch               CPU architecture: Ia32, X64, Ipf, ARM, AARCH64, Ebc or Common.\r
 # @param  Item               The Item to be added to section dictionary.\r
 #\r
 def AddToSection(Section, Arch, Item):\r
@@ -382,7 +382,7 @@ def AddToSection(Section, Arch, Item):
 # @retval Section            The string content of a section.\r
 #\r
 def GetSection(SectionName, Method, ObjectList):\r
-    SupportedArches = ["common", "Ia32", "X64", "Ipf", "Ebc", "ARM"]\r
+    SupportedArches = ["common", "Ia32", "X64", "Ipf", "Ebc", "ARM", "AARCH64"]\r
     SectionDict = {}\r
     for Object in ObjectList:\r
         Item = Method(Object)\r
index 8b5598b5f0b36465f4593744714c716742c23f2b..afdfb93ad62c108f37a345b00774555f43774674 100644 (file)
@@ -30,6 +30,7 @@ from Common import EdkLogger as EdkLogger
 from Common import GlobalData as GlobalData
 from DataType import *
 from BuildToolError import *
+from CommonDataClass.DataClass import *
 
 ## Regular expression used to find out place holders in string template
 gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE|re.UNICODE)
@@ -1176,6 +1177,113 @@ def ParseConsoleLog(Filename):
     Opr.close()
     Opw.close()
 
+## AnalyzeDscPcd
+#
+#  Analyze DSC PCD value, since there is no data type info in DSC
+#  This fuction is used to match functions (AnalyzePcdData, AnalyzeHiiPcdData, AnalyzeVpdPcdData) used for retrieving PCD value from database
+#  1. Feature flag: TokenSpace.PcdCName|PcdValue
+#  2. Fix and Patch:TokenSpace.PcdCName|PcdValue[|MaxSize]
+#  3. Dynamic default:
+#     TokenSpace.PcdCName|PcdValue[|VOID*[|MaxSize]]
+#     TokenSpace.PcdCName|PcdValue
+#  4. Dynamic VPD:
+#     TokenSpace.PcdCName|VpdOffset[|VpdValue]
+#     TokenSpace.PcdCName|VpdOffset[|MaxSize[|VpdValue]]
+#  5. Dynamic HII:
+#     TokenSpace.PcdCName|HiiString|VaiableGuid|VariableOffset[|HiiValue]
+#  PCD value needs to be located in such kind of string, and the PCD value might be an expression in which
+#    there might have "|" operator, also in string value.
+#
+#  @param Setting: String contain information described above with "TokenSpace.PcdCName|" stripped
+#  @param PcdType: PCD type: feature, fixed, dynamic default VPD HII
+#  @param DataType: The datum type of PCD: VOID*, UNIT, BOOL
+#  @retval:
+#    ValueList: A List contain fields described above
+#    IsValid:   True if conforming EBNF, otherwise False
+#    Index:     The index where PcdValue is in ValueList
+#
+def AnalyzeDscPcd(Setting, PcdType, DataType=''):
+    Setting = Setting.strip()
+    # There might be escaped quote in a string: \", \\\"
+    Data = Setting.replace('\\\\', '//').replace('\\\"', '\\\'')
+    # There might be '|' in string and in ( ... | ... ), replace it with '-'
+    NewStr = ''
+    InStr = False
+    Pair = 0
+    for ch in Data:
+        if ch == '"':
+            InStr = not InStr
+        elif ch == '(' and not InStr:
+            Pair += 1
+        elif ch == ')' and not InStr:
+            Pair -= 1
+        
+        if (Pair > 0 or InStr) and ch == TAB_VALUE_SPLIT:
+            NewStr += '-'
+        else:
+            NewStr += ch
+    FieldList = []
+    StartPos = 0
+    while True:
+        Pos = NewStr.find(TAB_VALUE_SPLIT, StartPos)
+        if Pos < 0:
+            FieldList.append(Setting[StartPos:].strip())
+            break
+        FieldList.append(Setting[StartPos:Pos].strip())
+        StartPos = Pos + 1
+
+    IsValid = True
+    if PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_FEATURE_FLAG):
+        Value = FieldList[0]
+        Size = ''
+        if len(FieldList) > 1:
+            Size = FieldList[1]
+        if DataType == 'VOID*':
+            IsValid = (len(FieldList) <= 2)
+        else:
+            IsValid = (len(FieldList) <= 1)
+        return [Value, '', Size], IsValid, 0
+    elif PcdType in (MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT):
+        Value = FieldList[0]
+        Size = Type = ''
+        if len(FieldList) > 1:
+            Type = FieldList[1]
+        if len(FieldList) > 2:
+            Size = FieldList[2]
+        if DataType == 'VOID*':
+            IsValid = (len(FieldList) <= 3)
+        else:
+            IsValid = (len(FieldList) <= 1)
+        return [Value, Type, Size], IsValid, 0 
+    elif PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
+        VpdOffset = FieldList[0]
+        Value = Size = ''
+        if not DataType == 'VOID*':
+            if len(FieldList) > 1:
+                Value = FieldList[1]
+        else:
+            if len(FieldList) > 1:
+                Size = FieldList[1]
+            if len(FieldList) > 2:
+                Value = FieldList[2]
+        if DataType == 'VOID*':
+            IsValid = (len(FieldList) <= 3)
+        else:
+            IsValid = (len(FieldList) <= 2)
+        return [VpdOffset, Size, Value], IsValid, 2
+    elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):
+        HiiString = FieldList[0]
+        Guid = Offset = Value = ''
+        if len(FieldList) > 1:
+            Guid = FieldList[1]
+        if len(FieldList) > 2:
+            Offset = FieldList[2]
+        if len(FieldList) > 3:
+            Value = FieldList[3]
+        IsValid = (3 <= len(FieldList) <= 4)
+        return [HiiString, Guid, Offset, Value], IsValid, 3
+    return [], False, 0
+
 ## AnalyzePcdData
 #
 #  Analyze the pcd Value, Datum type and TokenNumber.
@@ -1236,12 +1344,12 @@ def AnalyzeHiiPcdData(Setting):
 
 ## AnalyzeVpdPcdData
 #
-#  Analyze the vpd pcd Value, Datum type and TokenNumber.
+#  Analyze the vpd pcd VpdOffset, MaxDatumSize and InitialValue.
 #  Used to avoid split issue while the value string contain "|" character
 #
-#  @param[in] Setting:  A String contain value/datum type/token number information;
+#  @param[in] Setting:  A String contain VpdOffset/MaxDatumSize/InitialValue information;
 #  
-#  @retval   ValueList: A List contain value, datum type and toke number
+#  @retval   ValueList: A List contain VpdOffset, MaxDatumSize and InitialValue
 #
 def AnalyzeVpdPcdData(Setting):   
     ValueList = ['', '', '']    
@@ -1269,22 +1377,38 @@ def AnalyzeVpdPcdData(Setting):
 #
 def CheckPcdDatum(Type, Value):
     if Type == "VOID*":
+        ValueRe  = re.compile(r'\s*L?\".*\"\s*$')
         if not (((Value.startswith('L"') or Value.startswith('"')) and Value.endswith('"'))
                 or (Value.startswith('{') and Value.endswith('}'))
                ):
             return False, "Invalid value [%s] of type [%s]; must be in the form of {...} for array"\
-                          ", or \"...\" for string, or L\"...\" for unicode string" % (Value, Type)
+                          ", or \"...\" for string, or L\"...\" for unicode string" % (Value, Type)        
+        elif ValueRe.match(Value):
+            # Check the chars in UnicodeString or CString is printable
+            if Value.startswith("L"):
+                Value = Value[2:-1]
+            else:
+                Value = Value[1:-1]
+            Printset = set(string.printable)
+            Printset.remove(TAB_PRINTCHAR_VT)
+            Printset.add(TAB_PRINTCHAR_BS)
+            Printset.add(TAB_PRINTCHAR_NUL)
+            if not set(Value).issubset(Printset):
+                PrintList = list(Printset)
+                PrintList.sort()
+                return False, "Invalid PCD string value of type [%s]; must be printable chars %s." % (Type, PrintList)
     elif Type == 'BOOLEAN':
         if Value not in ['TRUE', 'True', 'true', '0x1', '0x01', '1', 'FALSE', 'False', 'false', '0x0', '0x00', '0']:
             return False, "Invalid value [%s] of type [%s]; must be one of TRUE, True, true, 0x1, 0x01, 1"\
                           ", FALSE, False, false, 0x0, 0x00, 0" % (Value, Type)
-    elif type(Value) == type(""):
+    elif Type in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64]:
         try:
             Value = long(Value, 0)
         except:
             return False, "Invalid value [%s] of type [%s];"\
-                          " must be a hexadecimal, decimal or octal in C language format."\
-                            % (Value, Type)
+                          " must be a hexadecimal, decimal or octal in C language format." % (Value, Type)
+    else:
+        return False, "Invalid type [%s]; must be one of VOID*, BOOLEAN, UINT8, UINT16, UINT32, UINT64." % (Type)
 
     return True, ""
 
index 5bb57d91e0bf0a81cd78423634b6e41a83fb43b0..856b508e4ea39a806fbe52264ac5e4db0956a2de 100644 (file)
Binary files a/BaseTools/Source/Python/Common/PyUtility.pyd and b/BaseTools/Source/Python/Common/PyUtility.pyd differ
index 068a63d1c124cda1e67dbc8270244c3b0cb60bac..c282326677f6f49d6b58fc5fb0adc424d8dc6901 100644 (file)
@@ -368,7 +368,7 @@ def CleanString(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyle
 \r
 ## CleanString2\r
 #\r
-# Split comments in a string\r
+# Split statement with comments in a string\r
 # Remove spaces\r
 #\r
 # @param Line:              The string to be cleaned\r
@@ -387,15 +387,21 @@ def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyl
     if AllowCppStyleComment:\r
         Line = Line.replace(DataType.TAB_COMMENT_EDK_SPLIT, CommentCharacter)\r
     #\r
-    # separate comments and statements\r
+    # separate comments and statements, but we should escape comment character in string\r
     #\r
-    LineParts = Line.split(CommentCharacter, 1);\r
-    #\r
-    # remove whitespace again\r
-    #\r
-    Line = LineParts[0].strip();\r
-    if len(LineParts) > 1:\r
-        Comment = LineParts[1].strip()\r
+    InString = False\r
+    CommentInString = False\r
+    Comment = ''\r
+    for Index in range(0, len(Line)):\r
+        if Line[Index] == '"':\r
+            InString = not InString\r
+        elif Line[Index] == CommentCharacter and InString:\r
+            CommentInString = True\r
+        elif Line[Index] == CommentCharacter and not InString:\r
+            Comment = Line[Index:].strip()\r
+            Line = Line[0:Index].strip()\r
+            break\r
+    if Comment:\r
         # Remove prefixed and trailing comment characters\r
         Start = 0\r
         End = len(Comment)\r
@@ -405,8 +411,6 @@ def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyl
             End -= 1\r
         Comment = Comment[Start:End]\r
         Comment = Comment.strip()\r
-    else:\r
-        Comment = ''\r
 \r
     return Line, Comment\r
 \r
index 7a0123b1d90f1890527ef08f1a951464266efbae..bb4b434af8f03c656f04f1bd8571ed6293e295e6 100644 (file)
@@ -38,7 +38,7 @@ def GenerateHelpText(Text, Lang):
 #                      ALWAYS_CONSUMED | SOMETIMES_CONSUMED | ALWAYS_PRODUCED | SOMETIMES_PRODUCED | TO_START | BY_START | PRIVATE\r
 # @var FeatureFlag:    To store value for FeatureFlag\r
 # @var SupArchList:    To store value for SupArchList, selection scope is in below list\r
-#                      EBC | IA32 | X64 | IPF | ARM | PPC\r
+#                      EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64\r
 # @var HelpText:       To store value for HelpText\r
 #\r
 class CommonClass(object):\r
@@ -400,7 +400,7 @@ class PcdClass(CommonClass):
 # @var TagName:                  To store value for TagName\r
 # @var ToolCode:                 To store value for ToolCode\r
 # @var SupArchList:              To store value for SupArchList, selection scope is in below list\r
-#                                EBC | IA32 | X64 | IPF | ARM | PPC\r
+#                                EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64\r
 #\r
 class BuildOptionClass(IncludeStatementClass):\r
     def __init__(self, ToolChainFamily = '', ToolChain = '', Option = ''):\r
index c0738b996cd2842b737deb63afc4f85b8f26ba40..c5ea15af5b974aff32c34f017354bc27b449c70a 100644 (file)
@@ -25,7 +25,7 @@ from CommonClass import *
 #\r
 # @var ModuleType:               To store value for ModuleType\r
 # @var SupArchList:              To store value for SupArchList, selection scope is in below list\r
-#                                EBC | IA32 | X64 | IPF | ARM | PPC\r
+#                                EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64\r
 # @var BinaryModule:             To store value for BinaryModule\r
 # @var OutputFileBasename:       To store value for OutputFileBasename\r
 # @var ClonedFrom:               To store value for ClonedFrom, it is a set structure as\r
index 46329ba1d7845e25bd9c777cbe96a2c99645bbec..a95ec068b1cb34ac52fbb0d50a109b1cc7ea6fc7 100644 (file)
@@ -39,7 +39,7 @@ class SkuInfoListClass(IncludeStatementClass):
 #\r
 # @var DscSpecification:         To store value for DscSpecification\r
 # @var SupArchList:              To store value for SupArchList, selection scope is in below list\r
-#                                EBC | IA32 | X64 | IPF | ARM | PPC\r
+#                                EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64\r
 # @var BuildTargets:             To store value for BuildTargets, selection scope is in below list\r
 #                                RELEASE | DEBUG\r
 # @var IntermediateDirectories:  To store value for IntermediateDirectories, selection scope is in below list\r
index 73d7318de0dace245f214e5b8f0b0f6077c5970b..c1ac07e852f6d7321abfcb62e16876fc0f8db2c4 100644 (file)
@@ -821,7 +821,7 @@ class Check(object):
             RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)\r
             for Record in RecordSet:\r
                 Path = Record[1]\r
-                Path = Path.upper().replace('\X64', '').replace('\IA32', '').replace('\EBC', '').replace('\IPF', '').replace('\ARM', '')\r
+                Path = Path.upper().replace('\X64', '').replace('\IA32', '').replace('\EBC', '').replace('\IPF', '').replace('\ARM', '').replace('\AARCH64', '')\r
                 if Path in InfPathList:\r
                     if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE, Record[2]):\r
                         EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE, OtherMsg="The source file [%s] is existing in module directory but it is not described in INF file." % (Record[2]), BelongsToTable='File', BelongsToItem=Record[0])\r
index 0729100b997577d4d531f947e693698ad916e19b..9de9beb4026a8a1fe8a7d89613ef80ef2670f77b 100644 (file)
Binary files a/BaseTools/Source/Python/Eot/EfiCompressor.pyd and b/BaseTools/Source/Python/Eot/EfiCompressor.pyd differ
index d792a7e9fb2073071b085076bfb15f99567e1aba..337c055e2062e16d469436efff3b9460be19e1ef 100644 (file)
Binary files a/BaseTools/Source/Python/Eot/LzmaCompressor.pyd and b/BaseTools/Source/Python/Eot/LzmaCompressor.pyd differ
index 9fe46f6edf14fdb320d691b117f4b21b8c8e7282..ed00a7b178ed1b3450fd74dc64b80293c17ea731 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Linux makefile for Python tools build.\r
+# GNU/Linux makefile for Python tools build.\r
 #\r
 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index aa4d2e8262d0baaee5f80401cfcc0e423d4d1d41..3716549cbadafbe55a0c56c54193420b7f75a26b 100644 (file)
@@ -113,10 +113,15 @@ class FD(FDClassObject):
             PreviousRegionStart = RegionObj.Offset\r
             PreviousRegionSize = RegionObj.Size\r
             #\r
+            # Verify current region fits within allocated FD section Size\r
+            #\r
+            if PreviousRegionStart + PreviousRegionSize > self.Size:\r
+                EdkLogger.error("GenFds", GENFDS_ERROR,\r
+                                'FD %s size too small to fit region with offset 0x%X and size 0x%X'\r
+                                % (self.FdUiName, PreviousRegionStart, PreviousRegionSize))\r
+            #\r
             # Call each region's AddToBuffer function\r
             #\r
-            if PreviousRegionSize > self.Size:\r
-                EdkLogger.error("GenFds", GENFDS_ERROR, 'FD %s size too small' % self.FdUiName)\r
             GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToBuffer function')\r
             RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)\r
         #\r
index c9c620d853803170fe056ffd5946ce786e7ea936..a468a5ec995d082539320c190724043606a288c2 100644 (file)
@@ -1707,6 +1707,38 @@ class FdfParser:
 \r
         return False\r
 \r
+    ## __CalcRegionExpr(self)\r
+    #\r
+    #   Calculate expression for offset or size of a region\r
+    #\r
+    #   @return: None if invalid expression\r
+    #            Calculated number if successfully\r
+    #\r
+    def __CalcRegionExpr(self):\r
+        StartPos = self.GetFileBufferPos()\r
+        Expr = ''\r
+        PairCount = 0\r
+        while not self.__EndOfFile():\r
+            CurCh = self.__CurrentChar()\r
+            if CurCh == '(':\r
+                PairCount += 1\r
+            elif CurCh == ')':\r
+                PairCount -= 1\r
+\r
+            if CurCh in '|\r\n' and PairCount == 0:\r
+                break\r
+            Expr += CurCh\r
+            self.__GetOneChar()\r
+        try:\r
+            return long(\r
+                ValueExpression(Expr,\r
+                                dict(['%s.%s' % (Pcd[1], Pcd[0]), Val] \r
+                                     for Pcd, Val in self.Profile.PcdDict.iteritems())\r
+                                )(True),0)\r
+        except Exception:\r
+            self.SetFileBufferPos(StartPos)\r
+            return None\r
+\r
     ## __GetRegionLayout() method\r
     #\r
     #   Get region layout for FD\r
@@ -1717,19 +1749,21 @@ class FdfParser:
     #   @retval False       Not able to find\r
     #\r
     def __GetRegionLayout(self, Fd):\r
-        if not self.__GetNextHexNumber():\r
+        Offset = self.__CalcRegionExpr() \r
+        if Offset == None:\r
             return False\r
 \r
         RegionObj = Region.Region()\r
-        RegionObj.Offset = long(self.__Token, 0)\r
+        RegionObj.Offset = Offset\r
         Fd.RegionList.append(RegionObj)\r
 \r
         if not self.__IsToken( "|"):\r
             raise Warning("expected '|'", self.FileName, self.CurrentLineNumber)\r
 \r
-        if not self.__GetNextHexNumber():\r
+        Size = self.__CalcRegionExpr()\r
+        if Size == None:\r
             raise Warning("expected Region Size", self.FileName, self.CurrentLineNumber)\r
-        RegionObj.Size = long(self.__Token, 0)\r
+        RegionObj.Size = Size\r
 \r
         if not self.__GetNextWord():\r
             return True\r
@@ -2503,16 +2537,16 @@ class FdfParser:
         self.__GetFileOpts( FfsFileObj)\r
 \r
         if not self.__IsToken("{"):\r
-#            if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):\r
-#                if self.__FileCouldHaveRelocFlag(FfsFileObj.FvFileType):\r
-#                    if self.__Token == 'RELOCS_STRIPPED':\r
-#                        FfsFileObj.KeepReloc = False\r
-#                    else:\r
-#                        FfsFileObj.KeepReloc = True\r
-#                else:\r
-#                    raise Warning("File type %s could not have reloc strip flag%d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)\r
-#\r
-#            if not self.__IsToken("{"):\r
+            if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):\r
+                if self.__FileCouldHaveRelocFlag(FfsFileObj.FvFileType):\r
+                    if self.__Token == 'RELOCS_STRIPPED':\r
+                        FfsFileObj.KeepReloc = False\r
+                    else:\r
+                        FfsFileObj.KeepReloc = True\r
+                else:\r
+                    raise Warning("File type %s could not have reloc strip flag%d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)\r
+\r
+            if not self.__IsToken("{"):\r
                 raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)\r
 \r
         if not self.__GetNextToken():\r
@@ -3186,7 +3220,7 @@ class FdfParser:
             raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)\r
 \r
         Arch = self.__SkippedChars.rstrip(".")\r
-        if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "COMMON"):\r
+        if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):\r
             raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)\r
 \r
         ModuleType = self.__GetModuleType()\r
@@ -3764,7 +3798,7 @@ class FdfParser:
             raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)\r
 \r
         Arch = self.__SkippedChars.rstrip(".").upper()\r
-        if Arch not in ("IA32", "X64", "IPF", "ARM"):\r
+        if Arch not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):\r
             raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)\r
 \r
         if not self.__GetNextWord():\r
@@ -3778,7 +3812,7 @@ class FdfParser:
         if self.__IsToken(","):\r
             if not self.__GetNextWord():\r
                 raise Warning("expected Arch list", self.FileName, self.CurrentLineNumber)\r
-            if self.__Token.upper() not in ("IA32", "X64", "IPF", "ARM"):\r
+            if self.__Token.upper() not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):\r
                 raise Warning("Unknown Arch '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
             VtfObj.ArchList = self.__Token.upper()\r
 \r
index 04527fe00fee923d9e9b69e866c5dd4e94856e93..d0dec380fb8e17735d7f7d0b01f9d73a37514127 100644 (file)
@@ -110,6 +110,8 @@ class FileStatement (FileStatementClassObject) :
                 if FvParentAddr != None and isinstance(section, GuidSection):\r
                     section.FvParentAddr = FvParentAddr\r
 \r
+                if self.KeepReloc == False:\r
+                    section.KeepReloc = False\r
                 sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)\r
                 if sectList != []:\r
                     for sect in sectList:\r
index 96e212cae7aa7d892ea06b1f2e4af7b21dbb5f04..71acd2992ca03d8ce8cd8efef9a089ec8db62628 100644 (file)
@@ -388,6 +388,11 @@ class FfsInfStatement(FfsInfStatementClassObject):
             if InfFileKey in (PlatformDataBase.Modules):\r
                 DscArchList.append ('EBC')\r
 \r
+        PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'AARCH64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]\r
+        if PlatformDataBase != None:\r
+            if InfFileKey in (PlatformDataBase.Modules):\r
+                DscArchList.append ('AARCH64')\r
+\r
         return DscArchList\r
 \r
     ## GetCurrentArch() method\r
index fb86a152b6118c8488fe9a73d030c91fa3a93457..400008e8155d157205ceb13c68711d7ea2ebd7b9 100644 (file)
@@ -301,7 +301,7 @@ def myOptionParser():
     usage = "%prog [options] -f input_file -a arch_list -b build_target -p active_platform -t tool_chain_tag -D \"MacroName [= MacroValue]\""
     Parser = OptionParser(usage=usage,description=__copyright__,version="%prog " + str(versionNumber))
     Parser.add_option("-f", "--file", dest="filename", type="string", help="Name of FDF file to convert", action="callback", callback=SingleCheckCallback)
-    Parser.add_option("-a", "--arch", dest="archList", help="comma separated list containing one or more of: IA32, X64, IPF, ARM or EBC which should be built, overrides target.txt?s TARGET_ARCH")
+    Parser.add_option("-a", "--arch", dest="archList", help="comma separated list containing one or more of: IA32, X64, IPF, ARM, AARCH64 or EBC which should be built, overrides target.txt?s TARGET_ARCH")
     Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
     Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed.")
     Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
index b457937628f2e3fa3d66f4e389b443dff1092c04..2fa4cb8c0dfa411a3991e4b20db26a41c7082ef4 100644 (file)
@@ -345,7 +345,7 @@ class GenFdsGlobalVariable:
 
     @staticmethod
     def GenerateSection(Output, Input, Type=None, CompressionType=None, Guid=None,
-                        GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None):
+                        GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None, BuildNumber=None):
         Cmd = ["GenSec"]
         if Type not in [None, '']:
             Cmd += ["-s", Type]
@@ -364,6 +364,7 @@ class GenFdsGlobalVariable:
             for SecAlign in InputAlign:
                 Cmd += ["--sectionalign", SecAlign]
 
+        CommandFile = Output + '.txt'
         if Ui not in [None, '']:
             #Cmd += ["-n", '"' + Ui + '"']
             SectionData = array.array('B', [0,0,0,0])
@@ -374,19 +375,20 @@ class GenFdsGlobalVariable:
             GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15)
             SaveFileOnChange(Output,  SectionData.tostring())
         elif Ver not in [None, '']:
-            #Cmd += ["-j", Ver]
-            SectionData = array.array('B', [0,0,0,0])
-            SectionData.fromstring(Ver.encode("utf_16_le"))
-            SectionData.append(0)
-            SectionData.append(0)
-            Len = len(SectionData)
-            GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x14)
-            SaveFileOnChange(Output,  SectionData.tostring())
+            Cmd += ["-n", Ver]
+            if BuildNumber:
+                Cmd += ["-j", BuildNumber]
+            Cmd += ["-o", Output]
+
+            SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
+            if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
+                return
+
+            GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section")
         else:
             Cmd += ["-o", Output]
             Cmd += Input
 
-            CommandFile = Output + '.txt'
             SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
             if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
                 return
index 3fca4064f0cb4c6dab5c0bfc32278edbf1ff6178..8f6da9624f1ed87c7b5f6f2408b3c7461439256d 100644 (file)
@@ -76,7 +76,7 @@ class VerSection (VerSectionClassObject):
             StringData = ''\r
 \r
         GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_VERSION',\r
-                                             Ui=StringData, Ver=self.BuildNum)\r
+                                             Ver=StringData, BuildNumber=self.BuildNum)\r
         OutputFileList = []\r
         OutputFileList.append(OutputFile)\r
         return OutputFileList, self.Alignment\r
index fec8b43646dfe9dab35fda22cd11724698449c3c..a3a537c3524802e81b42a6a5754f6466874001f7 100644 (file)
 !ERROR PYTHON_FREEZER_PATH must be defined!\r
 !ENDIF\r
 \r
+!IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze)\r
+# Using cx_Freeze 4.2.3 with Python 2.7.2\r
+FREEZE=$(PYTHON_FREEZER_PATH)\cxfreeze\r
+!ELSE\r
+# Using cx_Freeze 3.0.3 with Python 2.5.4\r
 FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe\r
+!ENDIF\r
 \r
 MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii\r
 \r
index 476e927a881e513ed05cf97bf9196ab441d97e31..8126aac59c09ee61e1c5ca5bd56d4953032406d4 100644 (file)
@@ -200,8 +200,8 @@ def RangeCheckCallback(option, opt_str, value, parser):
         \r
 def MyOptionParser():\r
     parser = OptionParser(version=__version__,prog="TargetTool.exe",usage=__usage__,description=__copyright__)\r
-    parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC', 'ARM','0'], dest="TARGET_ARCH",\r
-        help="ARCHS is one of list: IA32, X64, IPF, ARM or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")\r
+    parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC', 'ARM', 'AARCH64','0'], dest="TARGET_ARCH",\r
+        help="ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")\r
     parser.add_option("-p", "--platform", action="callback", type="string", dest="DSCFILE", callback=SingleCheckCallback,\r
         help="Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and can't combine with other value.")\r
     parser.add_option("-c", "--tooldef", action="callback", type="string", dest="TOOL_DEFINITION_FILE", callback=SingleCheckCallback,\r
index e2dca6130f8ef52aa1d2e4e629872285ac404deb..edd46967533b6e4616b5b7d6371d4d0f77920c06 100644 (file)
@@ -17,4 +17,4 @@
 Build version information\r
 '''\r
 \r
-gBUILD_VERSION = "Build 2524"\r
+gBUILD_VERSION = ""\r
index da6b69d82bbe3d88c978d900f543ab4236733902..de3c7092ad7fc62fb3682180b5828224ff411aac 100644 (file)
@@ -353,9 +353,10 @@ TAB_ARCH_X64 = 'X64'
 TAB_ARCH_IPF = 'IPF'\r
 TAB_ARCH_ARM = 'ARM'\r
 TAB_ARCH_EBC = 'EBC'\r
+TAB_ARCH_AARCH64 = 'AARCH64'\r
 \r
 ARCH_LIST = \\r
-[TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC]\r
+[TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC, TAB_ARCH_AARCH64]\r
 \r
 SUP_MODULE_BASE = 'BASE'\r
 SUP_MODULE_SEC = 'SEC'\r
@@ -440,6 +441,7 @@ TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_X64
 TAB_SOURCES_IPF = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_SOURCES_AARCH64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_BINARIES = 'Binaries'\r
 TAB_BINARIES_COMMON = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -448,6 +450,7 @@ TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_X64
 TAB_BINARIES_IPF = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_BINARIES_AARCH64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_INCLUDES = 'Includes'\r
 TAB_INCLUDES_COMMON = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -456,6 +459,7 @@ TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_X64
 TAB_INCLUDES_IPF = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_INCLUDES_AARCH64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_GUIDS = 'Guids'\r
 TAB_GUIDS_COMMON = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -464,6 +468,7 @@ TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_X64
 TAB_GUIDS_IPF = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_GUIDS_AARCH64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PROTOCOLS = 'Protocols'\r
 TAB_PROTOCOLS_COMMON = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -472,6 +477,7 @@ TAB_PROTOCOLS_X64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_X64
 TAB_PROTOCOLS_IPF = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PROTOCOLS_AARCH64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PPIS = 'Ppis'\r
 TAB_PPIS_COMMON = TAB_PPIS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -480,6 +486,7 @@ TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_X64
 TAB_PPIS_IPF = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PPIS_AARCH64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_LIBRARY_CLASSES = 'LibraryClasses'\r
 TAB_LIBRARY_CLASSES_COMMON = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -488,6 +495,7 @@ TAB_LIBRARY_CLASSES_X64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_X64
 TAB_LIBRARY_CLASSES_IPF = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_LIBRARY_CLASSES_AARCH64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PACKAGES = 'Packages'\r
 TAB_PACKAGES_COMMON = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -496,6 +504,7 @@ TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_X64
 TAB_PACKAGES_IPF = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PACKAGES_AARCH64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS = 'Pcds'\r
 TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'\r
@@ -535,6 +544,8 @@ TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
 TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \\r
 TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_FIXED_AT_BUILD_AARCH64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \\r
+TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_PATCHABLE_IN_MODULE_NULL = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE\r
 TAB_PCDS_PATCHABLE_IN_MODULE_COMMON = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE \\r
@@ -549,6 +560,8 @@ TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
 TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \\r
 TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \\r
+TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_FEATURE_FLAG_NULL = TAB_PCDS + TAB_PCDS_FEATURE_FLAG\r
 TAB_PCDS_FEATURE_FLAG_COMMON = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT \\r
@@ -563,6 +576,8 @@ TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
 TAB_ARCH_ARM\r
 TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \\r
 TAB_ARCH_EBC\r
+TAB_PCDS_FEATURE_FLAG_AARCH64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \\r
+TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX\r
 TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAULT\r
@@ -580,6 +595,8 @@ TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
 TAB_ARCH_ARM\r
 TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \\r
 TAB_ARCH_EBC\r
+TAB_PCDS_DYNAMIC_EX_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \\r
+TAB_ARCH_AARCH64\r
 \r
 TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC\r
 TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT\r
@@ -592,6 +609,7 @@ TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64
 TAB_PCDS_DYNAMIC_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_PCDS_DYNAMIC_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC_DEFAULT_NULL, \\r
                              TAB_PCDS_DYNAMIC_VPD_NULL, \\r
@@ -632,6 +650,7 @@ TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
 TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_DEPEX_AARCH64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_SKUIDS = 'SkuIds'\r
 \r
@@ -642,6 +661,7 @@ TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_X64
 TAB_LIBRARIES_IPF = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_LIBRARIES_AARCH64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_COMPONENTS = 'Components'\r
 TAB_COMPONENTS_COMMON = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -650,6 +670,7 @@ TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
 TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM\r
 TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC\r
+TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_AARCH64\r
 \r
 TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'\r
 \r
index fedd981529d4e174d86bea39159221518c4beddc..3f72f22738b5b6b9638d3e5c6f96d03559cc0ee7 100644 (file)
@@ -92,3 +92,8 @@ gUNPACK_DIR = None
 # Flag used to mark whether the INF file is Binary INF or not.
 #
 gIS_BINARY_INF = False
+#
+# Used by Library instance parser
+# {FilePath: FileObj}
+#
+gLIBINSTANCEDICT = {}
\ No newline at end of file
index 2c5853ca934bf33c2b3a9a551c0dbceabae8a2ec..0953e47cb1db74541aa059cf22e719fb8de11602 100644 (file)
@@ -2,7 +2,7 @@
 # This file is used to define common string related functions used in parsing \r
 # process\r
 #\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2012, 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
@@ -737,7 +737,7 @@ def IsHexDigit(Str):
                 return False\r
     return False\r
 \r
-## Check if the string is HexDgit and its interger value within limit of UINT32 \r
+## Check if the string is HexDgit and its integer value within limit of UINT32 \r
 #\r
 # Return true if all characters in the string are digits and there is at \r
 # least one character \r
index d576cffbd02bd9c519359d6ac24c5188a1e166ed..27a1c6ad25a03d5d87981e1e2753aac9fc28447d 100644 (file)
@@ -89,19 +89,19 @@ class InfUserExtensionObject():
             InfUserExtensionItemObj.SetContent(UserExtensionCont)\r
             InfUserExtensionItemObj.SetSupArchList(IdContentItem[2]) \r
             \r
-            for CheckItem in self.UserExtension:\r
-                if IdContentItem[0] == CheckItem[0] and IdContentItem[1] == CheckItem[1]:\r
-                    if IdContentItem[2].upper() == 'COMMON' or CheckItem[2].upper() == 'COMMON':\r
-                        #\r
-                        # For COMMON ARCH type, do special check.\r
-                        #\r
-                        Logger.Error('InfParser', \r
-                            ToolError.FORMAT_INVALID,\r
-                            ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%\\r
-                            (IdContentItem[0] + '.' + IdContentItem[1] + '.' + IdContentItem[2]),\r
-                            File=GlobalData.gINF_MODULE_NAME, \r
-                            Line=LineNo,\r
-                            ExtraData=None)\r
+#            for CheckItem in self.UserExtension:\r
+#                if IdContentItem[0] == CheckItem[0] and IdContentItem[1] == CheckItem[1]:\r
+#                    if IdContentItem[2].upper() == 'COMMON' or CheckItem[2].upper() == 'COMMON':\r
+#                        #\r
+#                        # For COMMON ARCH type, do special check.\r
+#                        #\r
+#                        Logger.Error('InfParser', \r
+#                            ToolError.FORMAT_INVALID,\r
+#                            ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%\\r
+#                            (IdContentItem[0] + '.' + IdContentItem[1] + '.' + IdContentItem[2]),\r
+#                            File=GlobalData.gINF_MODULE_NAME, \r
+#                            Line=LineNo,\r
+#                            ExtraData=None)\r
             \r
             if self.UserExtension.has_key(IdContentItem):           \r
                 #\r
index 12c46f1954b810c7095194271985bea4e8796297..6bf070be41912bea10397da20f7820333b236cfd 100644 (file)
@@ -42,12 +42,12 @@ from Library import DataType as DT
 # @param WorkSpace. The WorkSpace directory used to combined with INF file path.\r
 #\r
 # @return GUID, Version\r
-def GetLibInstanceInfo(String, WorkSpace, LineNo):\r
-    \r
+def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName):\r
+\r
     FileGuidString = ""\r
     VerString = ""\r
-    \r
-    OrignalString = String \r
+\r
+    OrignalString = String\r
     String = String.strip()\r
     if not String:\r
         return None, None\r
@@ -56,28 +56,48 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo):
     #\r
     String = GetHelpStringByRemoveHashKey(String)\r
     String = String.strip()\r
-    \r
+\r
+    #\r
+    # To deal with library instance specified by GUID and version\r
+    #\r
+    RegFormatGuidPattern = re.compile("\s*([0-9a-fA-F]){8}-"\r
+                                       "([0-9a-fA-F]){4}-"\r
+                                       "([0-9a-fA-F]){4}-"\r
+                                       "([0-9a-fA-F]){4}-"\r
+                                       "([0-9a-fA-F]){12}\s*")\r
+    VersionPattern = re.compile('[\t\s]*\d+(\.\d+)?[\t\s]*')\r
+    GuidMatchedObj = RegFormatGuidPattern.search(String)\r
+\r
+    if String.upper().startswith('GUID') and GuidMatchedObj and 'Version' in String:\r
+        VersionStr = String[String.upper().find('VERSION') + 8:]\r
+        VersionMatchedObj = VersionPattern.search(VersionStr)\r
+        if VersionMatchedObj:\r
+            Guid = GuidMatchedObj.group().strip()\r
+            Version = VersionMatchedObj.group().strip()\r
+            return GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName)\r
+\r
+    #\r
+    # To deal with library instance specified by file name\r
+    #\r
     FileLinesList = GetFileLineContent(String, WorkSpace, LineNo, OrignalString)\r
 \r
-        \r
+\r
     ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$")\r
     ReFindVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$")\r
-    \r
-    FileLinesList = ProcessLineExtender(FileLinesList)\r
 \r
     for Line in FileLinesList:\r
         if ReFindFileGuidPattern.match(Line):\r
             FileGuidString = Line\r
         if ReFindVerStringPattern.match(Line):\r
             VerString = Line\r
-    \r
+\r
     if FileGuidString:\r
         FileGuidString = GetSplitValueList(FileGuidString, '=', 1)[1]\r
     if VerString:\r
         VerString = GetSplitValueList(VerString, '=', 1)[1]\r
-        \r
+\r
     return FileGuidString, VerString\r
-    \r
+\r
 ## GetPackageListInfo\r
 #\r
 # Get the package information from INF file.\r
@@ -184,36 +204,97 @@ def GetFileLineContent(FileName, WorkSpace, LineNo, OriginalString):
     #\r
     # Validate file exist/format.\r
     #\r
-    if IsValidPath(FileName, WorkSpace):\r
-        IsValidFileFlag = True\r
-    else:\r
+    if not IsValidPath(FileName, WorkSpace):\r
         Logger.Error("InfParser", \r
                      ToolError.FORMAT_INVALID,\r
                      ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(FileName),\r
                      File=GlobalData.gINF_MODULE_NAME, \r
                      Line=LineNo, \r
                      ExtraData=OriginalString)\r
-        return False\r
     \r
     FileLinesList = []\r
     \r
-    if IsValidFileFlag:  \r
+    try:\r
+        FullFileName = FullFileName.replace('\\', '/')\r
+        Inputfile = open(FullFileName, "rb", 0)\r
         try:\r
-            FullFileName = FullFileName.replace('\\', '/')\r
-            Inputfile = open(FullFileName, "rb", 0)\r
-            try:\r
-                FileLinesList = Inputfile.readlines()\r
-            except BaseException:\r
-                Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_FILE_OPEN_FAILURE, File=FullFileName)\r
-            finally:\r
-                Inputfile.close()\r
+            FileLinesList = Inputfile.readlines()\r
         except BaseException:\r
-            Logger.Error("InfParser", \r
-                         ToolError.FILE_READ_FAILURE, \r
-                         ST.ERR_FILE_OPEN_FAILURE,\r
-                         File=FullFileName)\r
-        \r
-        FileLinesList = ProcessLineExtender(FileLinesList)\r
+            Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_FILE_OPEN_FAILURE, File=FullFileName)\r
+        finally:\r
+            Inputfile.close()\r
+    except BaseException:\r
+        Logger.Error("InfParser",\r
+                     ToolError.FILE_READ_FAILURE,\r
+                     ST.ERR_FILE_OPEN_FAILURE,\r
+                     File=FullFileName)\r
+    \r
+    FileLinesList = ProcessLineExtender(FileLinesList)\r
     \r
     return FileLinesList\r
-    
\ No newline at end of file
+\r
+##\r
+# Get all INF files from current workspace\r
+#\r
+#\r
+def GetInfsFromWorkSpace(WorkSpace):\r
+    InfFiles = []\r
+    for top, dirs, files in os.walk(WorkSpace):\r
+        dirs = dirs # just for pylint\r
+        for File in files:\r
+            if File.upper().endswith(".INF"):\r
+                InfFiles.append(os.path.join(top, File))\r
+\r
+    return InfFiles\r
+\r
+##\r
+# Get GUID and version from library instance file\r
+#\r
+#\r
+def GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName):\r
+    for InfFile in GetInfsFromWorkSpace(WorkSpace):\r
+        try:\r
+            if InfFile.strip().upper() == CurrentInfFileName.strip().upper():\r
+                continue\r
+            InfFile = InfFile.replace('\\', '/')\r
+            if InfFile not in GlobalData.gLIBINSTANCEDICT:\r
+                InfFileObj = open(InfFile, "rb", 0)\r
+                GlobalData.gLIBINSTANCEDICT[InfFile] = InfFileObj\r
+            else:\r
+                InfFileObj = GlobalData.gLIBINSTANCEDICT[InfFile]\r
+\r
+        except BaseException:\r
+            Logger.Error("InfParser",\r
+                         ToolError.FILE_READ_FAILURE,\r
+                         ST.ERR_FILE_OPEN_FAILURE,\r
+                         File=InfFile)\r
+        try:\r
+            FileLinesList = InfFileObj.readlines()\r
+            FileLinesList = ProcessLineExtender(FileLinesList)\r
+\r
+            ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$")\r
+            ReFindVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$")\r
+\r
+            for Line in FileLinesList:\r
+                if ReFindFileGuidPattern.match(Line):\r
+                    FileGuidString = Line\r
+                if ReFindVerStringPattern.match(Line):\r
+                    VerString = Line\r
+\r
+            if FileGuidString:\r
+                FileGuidString = GetSplitValueList(FileGuidString, '=', 1)[1]\r
+            if VerString:\r
+                VerString = GetSplitValueList(VerString, '=', 1)[1]\r
+\r
+            if FileGuidString.strip().upper() == Guid.upper() and \\r
+                VerString.strip().upper() == Version.upper():\r
+                return Guid, Version\r
+\r
+        except BaseException:\r
+            Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_FILE_OPEN_FAILURE, File=InfFile)\r
+        finally:\r
+            InfFileObj.close()\r
+\r
+    return '', ''\r
+\r
+\r
index 8f9427cf4fa8c74dba1225efc8bbb1661139dc94..4540fe2754dba12451c609f3c2252477f9a3c00f 100644 (file)
@@ -170,28 +170,29 @@ class InfLibrarySectionParser(InfParserSectionRoot):
                             File=FileName, \r
                             Line=LineNo, \r
                             ExtraData=LineContent)\r
-            \r
+\r
             if IsLibInstanceInfo(LineContent):\r
                 LibInsFlag = True\r
                 continue\r
-            \r
+\r
             if LibInsFlag:\r
-                LibGuid, LibVer = GetLibInstanceInfo(LineContent, GlobalData.gWORKSPACE, LineNo)\r
+                LibGuid, LibVer = GetLibInstanceInfo(LineContent, GlobalData.gWORKSPACE, LineNo, FileName)\r
                 #\r
                 # If the VERSION_STRING is missing from the INF file, tool should default to "0".\r
                 #\r
                 if LibVer == '':\r
                     LibVer = '0'\r
                 if LibGuid != '':\r
-                    LibraryList.append((LibGuid, LibVer))\r
+                    if (LibGuid, LibVer) not in LibraryList:\r
+                        LibraryList.append((LibGuid, LibVer))\r
                 else:\r
-                    Logger.Error('InfParser', \r
+                    Logger.Error('InfParser',\r
                             FORMAT_INVALID,\r
-                            ST.ERR_LIB_INSTANCE_MISS_GUID, \r
-                            File=FileName, \r
-                            Line=LineNo, \r
-                            ExtraData=LineContent)                    \r
-                \r
+                            ST.ERR_LIB_INSTANCE_MISS_GUID,\r
+                            File=FileName,\r
+                            Line=LineNo,\r
+                            ExtraData=LineContent)\r
+\r
         #\r
         # Current section archs\r
         #    \r
index a6668774b570371fd3b8af039abeea1edeabaa61..b2e98633af67bde0ebdefb8fde76b8599e8e8874 100644 (file)
@@ -1,7 +1,7 @@
 ## @file
 # This file is used to parse meta files
 #
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD License
 # which accompanies this distribution.  The full text of the license may be found at
@@ -25,7 +25,7 @@ import Common.GlobalData as GlobalData
 from CommonDataClass.DataClass import *
 from Common.DataType import *
 from Common.String import *
-from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData
+from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd
 from Common.Expression import *
 from CommonDataClass.Exceptions import *
 
@@ -44,7 +44,7 @@ def ParseMacro(Parser):
         # Syntax check
         if not TokenList[0]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         if len(TokenList) < 2:
             TokenList.append('')
 
@@ -53,11 +53,11 @@ def ParseMacro(Parser):
         # Global macros can be only defined via environment variable
         if Name in GlobalData.gGlobalDefines:
             EdkLogger.error('Parser', FORMAT_INVALID, "%s can only be defined via environment variable" % Name,
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         # Only upper case letters, digit and '_' are allowed
         if not gMacroNamePattern.match(Name):
             EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
 
         Value = ReplaceMacro(Value, self._Macros)
         if Type in self.DataType:
@@ -85,14 +85,14 @@ def ParseMacro(Parser):
         # EDK_GLOBAL defined macros
         elif type(self) != DscParser:
             EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used in .dsc file",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         elif self._SectionType != MODEL_META_DATA_HEADER:
             EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used under [Defines] section",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         elif (Name in self._FileLocalMacros) and (self._FileLocalMacros[Name] != Value):
             EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL defined a macro with the same name and different value as one defined by 'DEFINE'",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
-            
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+
         self._ValueList = [Type, Name, Value]
 
     return MacroParser
@@ -146,7 +146,7 @@ class MetaFileParser(object):
     #   @param      Owner           Owner ID (for sub-section parsing)
     #   @param      From            ID from which the data comes (for !INCLUDE directive)
     #
-    def __init__(self, FilePath, FileType, Table, Owner=-1, From=-1):
+    def __init__(self, FilePath, FileType, Table, Owner= -1, From= -1):
         self._Table = Table
         self._RawTable = Table
         self._FileType = FileType
@@ -262,7 +262,7 @@ class MetaFileParser(object):
     ## Skip unsupported data
     def _Skip(self):
         EdkLogger.warn("Parser", "Unrecognized content", File=self.MetaFile,
-                        Line=self._LineIndex+1, ExtraData=self._CurrentLine);
+                        Line=self._LineIndex + 1, ExtraData=self._CurrentLine);
         self._ValueList[0:1] = [self._CurrentLine]
 
     ## Section header parser
@@ -282,20 +282,27 @@ class MetaFileParser(object):
             # different section should not mix in one section
             if self._SectionName != '' and self._SectionName != ItemList[0].upper():
                 EdkLogger.error('Parser', FORMAT_INVALID, "Different section names in the same section",
-                                File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+                                File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
             self._SectionName = ItemList[0].upper()
             if self._SectionName in self.DataType:
                 self._SectionType = self.DataType[self._SectionName]
+                # Check if the section name is valid
+                if self._SectionName not in SECTIONS_HAVE_ITEM_AFTER_ARCH and len(ItemList) > 2:
+                    EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+                                    self.MetaFile, self._LineIndex + 1, self._CurrentLine)
+            elif self._Version >= 0x00010005:
+                EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+                                self.MetaFile, self._LineIndex + 1, self._CurrentLine)
             else:
                 self._SectionType = MODEL_UNKNOWN
-                EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
-                                Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+
             # S1 is always Arch
             if len(ItemList) > 1:
                 S1 = ItemList[1].upper()
             else:
                 S1 = 'COMMON'
             ArchList.add(S1)
+
             # S2 may be Platform or ModuleType
             if len(ItemList) > 2:
                 S2 = ItemList[2].upper()
@@ -306,7 +313,7 @@ class MetaFileParser(object):
         # 'COMMON' must not be used with specific ARCHs at the same section
         if 'COMMON' in ArchList and len(ArchList) > 1:
             EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
-                            File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+                            File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
         # If the section information is needed later, it should be stored in database
         self._ValueList[0] = self._SectionName
 
@@ -317,10 +324,10 @@ class MetaFileParser(object):
         self._ValueList[1:len(TokenList)] = TokenList
         if not self._ValueList[1]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         if not self._ValueList[2]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
 
         self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
         Name, Value = self._ValueList[1], self._ValueList[2]
@@ -330,7 +337,7 @@ class MetaFileParser(object):
                 self._Version = int(Value, 0)
             except:
                 EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version number",
-                                ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                                ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
 
         if type(self) == InfParser and self._Version < 0x00010005:
             # EDK module allows using defines as macros
@@ -358,7 +365,7 @@ class MetaFileParser(object):
                 "'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
                 ExtraData=self._CurrentLine,
                 File=self.MetaFile,
-                Line=self._LineIndex+1
+                Line=self._LineIndex + 1
                 )
 
     def _GetMacros(self):
@@ -391,11 +398,11 @@ class MetaFileParser(object):
         ComComMacroDict = {}
         ComSpeMacroDict = {}
         SpeSpeMacroDict = {}
-        
+
         ActiveSectionType = self._SectionType
         if type(self) == DecParser:
             ActiveSectionType = self._SectionType[0]
-            
+
         for (SectionType, Scope) in self._SectionsMacroDict:
             if SectionType != ActiveSectionType:
                 continue
@@ -406,7 +413,7 @@ class MetaFileParser(object):
                     break
             else:
                 SpeSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
-            
+
             for ActiveScope in self._Scope:
                 Scope0, Scope1 = ActiveScope[0], ActiveScope[1]
                 if(Scope0, Scope1) not in Scope and (Scope0, "COMMON") not in Scope and ("COMMON", Scope1) not in Scope:
@@ -423,9 +430,9 @@ class MetaFileParser(object):
 
         return Macros
 
-    _SectionParser  = {}
-    Finished        = property(_GetFinished, _SetFinished)
-    _Macros         = property(_GetMacros)
+    _SectionParser = {}
+    Finished = property(_GetFinished, _SetFinished)
+    _Macros = property(_GetMacros)
 
 
 ## INF file parser class
@@ -475,6 +482,7 @@ class InfParser(MetaFileParser):
         if hasattr(self, "_Table"):
             return
         MetaFileParser.__init__(self, FilePath, FileType, Table)
+        self.PcdsDict = {}
 
     ## Parser starter
     def Start(self):
@@ -527,13 +535,13 @@ class InfParser(MetaFileParser):
                                              MODEL_META_DATA_USER_EXTENSION]:
                         EdkLogger.error('Parser', FORMAT_INVALID,
                                         "Section [%s] is not allowed in inf file without version" % (self._SectionName),
-                                        ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                                        ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
                 elif self._SectionType in [MODEL_EFI_INCLUDE,
                                            MODEL_EFI_LIBRARY_INSTANCE,
                                            MODEL_META_DATA_NMAKE]:
                     EdkLogger.error('Parser', FORMAT_INVALID,
                                     "Section [%s] is not allowed in inf file with version 0x%08x" % (self._SectionName, self._Version),
-                                    ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                                    ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
                 continue
             # merge two lines specified by '\' in section NMAKE
             elif self._SectionType == MODEL_META_DATA_NMAKE:
@@ -553,7 +561,7 @@ class InfParser(MetaFileParser):
                     NmakeLine = ''
 
             # section content
-            self._ValueList = ['','','']
+            self._ValueList = ['', '', '']
             # parse current line, result will be put in self._ValueList
             self._SectionParser[self._SectionType](self)
             if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
@@ -571,14 +579,14 @@ class InfParser(MetaFileParser):
                             Arch,
                             Platform,
                             self._Owner[-1],
-                            self._LineIndex+1,
-                            -1,
-                            self._LineIndex+1,
-                            -1,
+                            self._LineIndex + 1,
+                            - 1,
+                            self._LineIndex + 1,
+                            - 1,
                             0
                             )
         if IsFindBlockComment:
-            EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */", 
+            EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",
                             File=self.MetaFile)
         self._Done()
 
@@ -636,15 +644,15 @@ class InfParser(MetaFileParser):
         if len(TokenList) < 2:
             EdkLogger.error('Parser', FORMAT_INVALID, "No file type or path specified",
                             ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if not TokenList[0]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No file type specified",
                             ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if not TokenList[1]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No file path specified",
                             ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         self._ValueList[0:len(TokenList)] = TokenList
         self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros)
 
@@ -665,14 +673,14 @@ class InfParser(MetaFileParser):
         if len(ValueList) != 2:
             EdkLogger.error('Parser', FORMAT_INVALID, "Illegal token space GUID and PCD name format",
                             ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         self._ValueList[0:1] = ValueList
         if len(TokenList) > 1:
             self._ValueList[2] = TokenList[1]
         if self._ValueList[0] == '' or self._ValueList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
                             ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
 
         # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
         if self._ValueList[2] != '':
@@ -681,6 +689,12 @@ class InfParser(MetaFileParser):
                 self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
             elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
                 self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
+        if (self._ValueList[0], self._ValueList[1]) not in self.PcdsDict:
+            self.PcdsDict[self._ValueList[0], self._ValueList[1]] = self._SectionType
+        elif self.PcdsDict[self._ValueList[0], self._ValueList[1]] != self._SectionType:
+            EdkLogger.error('Parser', FORMAT_INVALID, "It is not permissible to list a specified PCD in different PCD type sections.",
+                            ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
+                            File=self.MetaFile, Line=self._LineIndex + 1)
 
     ## [depex] section parser
     @ParseMacro
@@ -691,11 +705,11 @@ class InfParser(MetaFileParser):
         MODEL_UNKNOWN                   :   MetaFileParser._Skip,
         MODEL_META_DATA_HEADER          :   MetaFileParser._DefineParser,
         MODEL_META_DATA_BUILD_OPTION    :   MetaFileParser._BuildOptionParser,
-        MODEL_EFI_INCLUDE               :   _IncludeParser,                 # for Edk.x modules
-        MODEL_EFI_LIBRARY_INSTANCE      :   MetaFileParser._CommonParser,   # for Edk.x modules
+        MODEL_EFI_INCLUDE               :   _IncludeParser, # for Edk.x modules
+        MODEL_EFI_LIBRARY_INSTANCE      :   MetaFileParser._CommonParser, # for Edk.x modules
         MODEL_EFI_LIBRARY_CLASS         :   MetaFileParser._PathParser,
         MODEL_META_DATA_PACKAGE         :   MetaFileParser._PathParser,
-        MODEL_META_DATA_NMAKE           :   _NmakeParser,                   # for Edk.x modules
+        MODEL_META_DATA_NMAKE           :   _NmakeParser, # for Edk.x modules
         MODEL_PCD_FIXED_AT_BUILD        :   _PcdParser,
         MODEL_PCD_PATCHABLE_IN_MODULE   :   _PcdParser,
         MODEL_PCD_FEATURE_FLAG          :   _PcdParser,
@@ -781,7 +795,7 @@ class DscParser(MetaFileParser):
     #   @param      Owner           Owner ID (for sub-section parsing)
     #   @param      From            ID from which the data comes (for !INCLUDE directive)
     #
-    def __init__(self, FilePath, FileType, Table, Owner=-1, From=-1):
+    def __init__(self, FilePath, FileType, Table, Owner= -1, From= -1):
         # prevent re-initialization
         if hasattr(self, "_Table"):
             return
@@ -791,12 +805,12 @@ class DscParser(MetaFileParser):
         self._DirectiveStack = []
         self._DirectiveEvalStack = []
         self._Enabled = 1
-        
+
         #
         # Specify whether current line is in uncertain condition
         #
         self._InDirective = -1
-        
+
         # Final valid replacable symbols
         self._Symbols = {}
         #
@@ -823,7 +837,7 @@ class DscParser(MetaFileParser):
             self._LineIndex = Index
             if self._InSubsection and self._Owner[-1] == -1:
                 self._Owner.append(self._LastItem)
-            
+
             # section header
             if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
                 self._SectionType = MODEL_META_DATA_SECTION_HEADER
@@ -866,10 +880,10 @@ class DscParser(MetaFileParser):
                                         ModuleType,
                                         self._Owner[-1],
                                         self._From,
-                                        self._LineIndex+1,
-                                        -1,
-                                        self._LineIndex+1,
-                                        -1,
+                                        self._LineIndex + 1,
+                                        - 1,
+                                        self._LineIndex + 1,
+                                        - 1,
                                         self._Enabled
                                         )
 
@@ -887,12 +901,12 @@ class DscParser(MetaFileParser):
         else:
             self._SubsectionType = MODEL_UNKNOWN
             EdkLogger.warn("Parser", "Unrecognized sub-section", File=self.MetaFile,
-                           Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+                           Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
         self._ValueList[0] = self._SubsectionName
 
     ## Directive statement parser
     def _DirectiveParser(self):
-        self._ValueList = ['','','']
+        self._ValueList = ['', '', '']
         TokenList = GetSplitValueList(self._CurrentLine, ' ', 1)
         self._ValueList[0:len(TokenList)] = TokenList
 
@@ -900,7 +914,7 @@ class DscParser(MetaFileParser):
         DirectiveName = self._ValueList[0].upper()
         if DirectiveName not in self.DataType:
             EdkLogger.error("Parser", FORMAT_INVALID, "Unknown directive [%s]" % DirectiveName,
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
 
         if DirectiveName in ['!IF', '!IFDEF', '!IFNDEF']:
             self._InDirective += 1
@@ -910,7 +924,7 @@ class DscParser(MetaFileParser):
 
         if DirectiveName in ['!IF', '!IFDEF', '!INCLUDE', '!IFNDEF', '!ELSEIF'] and self._ValueList[1] == '':
             EdkLogger.error("Parser", FORMAT_INVALID, "Missing expression",
-                            File=self.MetaFile, Line=self._LineIndex+1,
+                            File=self.MetaFile, Line=self._LineIndex + 1,
                             ExtraData=self._CurrentLine)
 
         ItemType = self.DataType[DirectiveName]
@@ -928,7 +942,7 @@ class DscParser(MetaFileParser):
                     break
             else:
                 EdkLogger.error("Parser", FORMAT_INVALID, "Redundant '!endif'",
-                                File=self.MetaFile, Line=self._LineIndex+1,
+                                File=self.MetaFile, Line=self._LineIndex + 1,
                                 ExtraData=self._CurrentLine)
         elif ItemType != MODEL_META_DATA_INCLUDE:
             # Break if there's a !else is followed by a !elseif
@@ -936,14 +950,14 @@ class DscParser(MetaFileParser):
                self._DirectiveStack and \
                self._DirectiveStack[-1][0] == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE:
                 EdkLogger.error("Parser", FORMAT_INVALID, "'!elseif' after '!else'",
-                                File=self.MetaFile, Line=self._LineIndex+1,
+                                File=self.MetaFile, Line=self._LineIndex + 1,
                                 ExtraData=self._CurrentLine)
-            self._DirectiveStack.append((ItemType, self._LineIndex+1, self._CurrentLine))
+            self._DirectiveStack.append((ItemType, self._LineIndex + 1, self._CurrentLine))
         elif self._From > 0:
             EdkLogger.error('Parser', FORMAT_INVALID,
                             "No '!include' allowed in included file",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, 
-                            Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile,
+                            Line=self._LineIndex + 1)
 
         #
         # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
@@ -959,10 +973,10 @@ class DscParser(MetaFileParser):
                                     ModuleType,
                                     self._Owner[-1],
                                     self._From,
-                                    self._LineIndex+1,
-                                    -1,
-                                    self._LineIndex+1,
-                                    -1,
+                                    self._LineIndex + 1,
+                                    - 1,
+                                    self._LineIndex + 1,
+                                    - 1,
                                     0
                                     )
 
@@ -975,16 +989,16 @@ class DscParser(MetaFileParser):
         # Syntax check
         if not self._ValueList[1]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         if not self._ValueList[2]:
             EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         if not self._ValueList[1] in self.DefineKeywords:
             EdkLogger.error('Parser', FORMAT_INVALID,
                             "Unknown keyword found: %s. "
                             "If this is a macro you must "
                             "add it as a DEFINE in the DSC" % self._ValueList[1],
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         self._Defines[self._ValueList[1]] = self._ValueList[2]
         self._ItemType = self.DataType[TAB_DSC_DEFINES.upper()]
 
@@ -993,7 +1007,7 @@ class DscParser(MetaFileParser):
         TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
         if len(TokenList) != 2:
             EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is '<Integer>|<UiName>'",
-                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
         self._ValueList[0:len(TokenList)] = TokenList
 
     ## Parse Edk style of library modules
@@ -1024,11 +1038,19 @@ class DscParser(MetaFileParser):
         if self._ValueList[0] == '' or self._ValueList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
                             ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if self._ValueList[2] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
                             ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
+
+        # Validate the datum type of Dynamic Defaul PCD and DynamicEx Default PCD
+        ValueList = GetSplitValueList(self._ValueList[2])
+        if len(ValueList) > 1 and ValueList[1] != TAB_VOID \
+                              and self._ItemType in [MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT]:
+            EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s' of PCD is wrong" % ValueList[1],
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+
         # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
         DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
         if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
@@ -1036,6 +1058,7 @@ class DscParser(MetaFileParser):
         elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
             self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
 
+
     ## [components] section parser
     @ParseMacro
     def _ComponentParser(self):
@@ -1052,15 +1075,15 @@ class DscParser(MetaFileParser):
         if len(TokenList) < 2:
             EdkLogger.error('Parser', FORMAT_INVALID, "No library class or instance specified",
                             ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if TokenList[0] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No library class specified",
                             ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if TokenList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No library instance specified",
                             ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
 
         self._ValueList[0:len(TokenList)] = TokenList
 
@@ -1088,7 +1111,7 @@ class DscParser(MetaFileParser):
                 "'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
                 ExtraData=self._CurrentLine,
                 File=self.MetaFile,
-                Line=self._LineIndex+1
+                Line=self._LineIndex + 1
                 )
 
     ## Override parent's method since we'll do all macro replacements in parser
@@ -1192,23 +1215,23 @@ class DscParser(MetaFileParser):
                                         " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
                                         " of the DSC file, and it is currently defined in this section:"
                                         " %s, line #: %d." % (Excpt.Pcd, Info[0], Info[1]),
-                                    File=self._FileWithError, ExtraData=' '.join(self._ValueList), 
-                                    Line=self._LineIndex+1)
+                                    File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+                                    Line=self._LineIndex + 1)
                     else:
                         EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s) is not defined in DSC file" % Excpt.Pcd,
-                                    File=self._FileWithError, ExtraData=' '.join(self._ValueList), 
-                                    Line=self._LineIndex+1)
+                                    File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+                                    Line=self._LineIndex + 1)
                 else:
                     EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),
-                                    File=self._FileWithError, ExtraData=' '.join(self._ValueList), 
-                                    Line=self._LineIndex+1)
+                                    File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+                                    Line=self._LineIndex + 1)
             except MacroException, Excpt:
                 EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt),
-                                File=self._FileWithError, ExtraData=' '.join(self._ValueList), 
-                                Line=self._LineIndex+1)
+                                File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+                                Line=self._LineIndex + 1)
 
             if self._ValueList == None:
-                continue 
+                continue
 
             NewOwner = self._IdMapping.get(Owner, -1)
             self._Enabled = int((not self._DirectiveEvalStack) or (False not in self._DirectiveEvalStack))
@@ -1221,10 +1244,10 @@ class DscParser(MetaFileParser):
                                 S2,
                                 NewOwner,
                                 self._From,
-                                self._LineIndex+1,
-                                -1,
-                                self._LineIndex+1,
-                                -1,
+                                self._LineIndex + 1,
+                                - 1,
+                                self._LineIndex + 1,
+                                - 1,
                                 self._Enabled
                                 )
             self._IdMapping[Id] = self._LastItem
@@ -1248,25 +1271,25 @@ class DscParser(MetaFileParser):
             self._SubsectionType = MODEL_UNKNOWN
 
     def __RetrievePcdValue(self):
-        Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem=-1.0)
-        for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
-            Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
+        Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem= -1.0)
+        for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
             Name = TokenSpaceGuid + '.' + PcdName
-            self._Symbols[Name] = Value
+            ValList, Valid, Index = AnalyzeDscPcd(Value, MODEL_PCD_FEATURE_FLAG)
+            self._Symbols[Name] = ValList[Index]
 
-        Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem=-1.0)
-        for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
-            Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
+        Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem= -1.0)
+        for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
             Name = TokenSpaceGuid + '.' + PcdName
-            self._Symbols[Name] = Value
+            ValList, Valid, Index = AnalyzeDscPcd(Value, MODEL_PCD_FIXED_AT_BUILD)
+            self._Symbols[Name] = ValList[Index]
 
         Content = open(str(self.MetaFile), 'r').readlines()
         GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
         for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
                         MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNAMIC_EX_HII,
                         MODEL_PCD_DYNAMIC_EX_VPD):
-            Records = self._RawTable.Query(PcdType, BelongsToItem=-1.0)
-            for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
+            Records = self._RawTable.Query(PcdType, BelongsToItem= -1.0)
+            for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
                 Name = TokenSpaceGuid + '.' + PcdName
                 if Name not in GlobalData.gPlatformOtherPcds:
                     PcdLine = Line
@@ -1287,13 +1310,13 @@ class DscParser(MetaFileParser):
                 self._ConstructSectionMacroDict(Name, Value)
         elif self._ItemType == MODEL_META_DATA_GLOBAL_DEFINE:
             GlobalData.gEdkGlobal[Name] = Value
-        
+
         #
         # Keyword in [Defines] section can be used as Macros
         #
         if (self._ItemType == MODEL_META_DATA_HEADER) and (self._SectionType == MODEL_META_DATA_HEADER):
             self._FileLocalMacros[Name] = Value
-            
+
         self._ValueList = [Type, Name, Value]
 
     def __ProcessDirective(self):
@@ -1313,8 +1336,8 @@ class DscParser(MetaFileParser):
                 # the precise number of line and return the evaluation result
                 #
                 EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
-                                File=self._FileWithError, ExtraData=' '.join(self._ValueList), 
-                                Line=self._LineIndex+1)
+                                File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+                                Line=self._LineIndex + 1)
                 Result = Excpt.result
 
         if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
@@ -1368,7 +1391,7 @@ class DscParser(MetaFileParser):
             # Allow using MACROs comes from [Defines] section to keep compatible. 
             #
             __IncludeMacros.update(self._Macros)
-            
+
             IncludedFile = NormPath(ReplaceMacro(self._ValueList[1], __IncludeMacros, RaiseError=True))
             #
             # First search the include file under the same directory as DSC file
@@ -1382,14 +1405,14 @@ class DscParser(MetaFileParser):
                 IncludedFile1 = PathClass(IncludedFile, GlobalData.gWorkspace)
                 ErrorCode, ErrorInfo2 = IncludedFile1.Validate()
                 if ErrorCode != 0:
-                    EdkLogger.error('parser', ErrorCode, File=self._FileWithError, 
-                                    Line=self._LineIndex+1, ExtraData=ErrorInfo1 + "\n"+ ErrorInfo2)
+                    EdkLogger.error('parser', ErrorCode, File=self._FileWithError,
+                                    Line=self._LineIndex + 1, ExtraData=ErrorInfo1 + "\n" + ErrorInfo2)
 
             self._FileWithError = IncludedFile1
 
             IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, False)
-            Owner = self._Content[self._ContentIndex-1][0]
-            Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable, 
+            Owner = self._Content[self._ContentIndex - 1][0]
+            Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable,
                                Owner=Owner, From=Owner)
 
             # set the parser status with current status
@@ -1403,17 +1426,17 @@ class DscParser(MetaFileParser):
             # update current status with sub-parser's status
             self._SectionName = Parser._SectionName
             self._SectionType = Parser._SectionType
-            self._Scope       = Parser._Scope
-            self._Enabled     = Parser._Enabled
+            self._Scope = Parser._Scope
+            self._Enabled = Parser._Enabled
 
             # Insert all records in the table for the included file into dsc file table
             Records = IncludedFileTable.GetAll()
             if Records:
                 self._Content[self._ContentIndex:self._ContentIndex] = Records
-                self._Content.pop(self._ContentIndex-1)
+                self._Content.pop(self._ContentIndex - 1)
                 self._ValueList = None
                 self._ContentIndex -= 1
-                
+
     def __ProcessSkuId(self):
         self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True)
                            for Value in self._ValueList]
@@ -1425,48 +1448,28 @@ class DscParser(MetaFileParser):
         self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros, RaiseError=True)
 
     def __ProcessPcd(self):
-        PcdValue = None
-        ValueList = GetSplitValueList(self._ValueList[2])
-        #
-        # PCD value can be an expression
-        #
-        if len(ValueList) > 1 and ValueList[1] == 'VOID*':
-            PcdValue = ValueList[0]      
+        if self._ItemType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
+            self._ValueList[2] = ReplaceMacro(self._ValueList[2], self._Macros, RaiseError=True)
+            return
+
+        ValList, Valid, Index = AnalyzeDscPcd(self._ValueList[2], self._ItemType)
+        if not Valid:
+            EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self._FileWithError, Line=self._LineIndex+1,
+                            ExtraData="%s.%s|%s" % (self._ValueList[0], self._ValueList[1], self._ValueList[2]))
+        PcdValue = ValList[Index]
+        if PcdValue:
             try:
-                ValueList[0] = ValueExpression(PcdValue, self._Macros)(True)
+                ValList[Index] = ValueExpression(PcdValue, self._Macros)(True)
             except WrnExpression, Value:
-                ValueList[0] = Value.result
-            PcdValue = ValueList[0]
-        else:
-            #
-            # Int*/Boolean VPD PCD
-            # TokenSpace | PcdCName | Offset | [Value]
-            # 
-            # VOID* VPD PCD
-            # TokenSpace | PcdCName | Offset | [Size] | [Value]
-            #
-            if self._ItemType == MODEL_PCD_DYNAMIC_VPD:
-                if len(ValueList) >= 4:
-                    PcdValue = ValueList[-1]
-            else:
-                PcdValue = ValueList[-1]
-            #
-            # For the VPD PCD, there may not have PcdValue data in DSC file
-            #
-            if PcdValue:
-                try:
-                    ValueList[-1] = ValueExpression(PcdValue, self._Macros)(True)
-                except WrnExpression, Value:
-                    ValueList[-1] = Value.result
-                
-                if ValueList[-1] == 'True':
-                    ValueList[-1] = '1'
-                if ValueList[-1] == 'False':
-                    ValueList[-1] = '0'
-                PcdValue = ValueList[-1]
-        if PcdValue and self._ItemType in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
-            GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
-        self._ValueList[2] = '|'.join(ValueList)
+                ValList[Index] = Value.result
+
+        if ValList[Index] == 'True':
+            ValList[Index] = '1'
+        if ValList[Index] == 'False':
+            ValList[Index] = '0'
+
+        GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
+        self._ValueList[2] = '|'.join(ValList)
 
     def __ProcessComponent(self):
         self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
@@ -1501,7 +1504,7 @@ class DscParser(MetaFileParser):
         MODEL_META_DATA_SUBSECTION_HEADER               :   _SubsectionHeaderParser,
     }
 
-    _Macros     = property(_GetMacros)
+    _Macros = property(_GetMacros)
 
 ## DEC file parser class
 #
@@ -1543,6 +1546,7 @@ class DecParser(MetaFileParser):
         MetaFileParser.__init__(self, FilePath, FileType, Table, -1)
         self._Comments = []
         self._Version = 0x00010005  # Only EDK2 dec file is supported
+        self._AllPCDs = [] # Only for check duplicate PCD
 
     ## Parser starter
     def Start(self):
@@ -1559,7 +1563,7 @@ class DecParser(MetaFileParser):
 
             # save comment for later use
             if Comment:
-                self._Comments.append((Comment, self._LineIndex+1))
+                self._Comments.append((Comment, self._LineIndex + 1))
             # skip empty line
             if Line == '':
                 continue
@@ -1574,7 +1578,7 @@ class DecParser(MetaFileParser):
                 continue
 
             # section content
-            self._ValueList = ['','','']
+            self._ValueList = ['', '', '']
             self._SectionParser[self._SectionType[0]](self)
             if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
                 self._ItemType = -1
@@ -1594,10 +1598,10 @@ class DecParser(MetaFileParser):
                     Arch,
                     ModuleType,
                     self._Owner[-1],
-                    self._LineIndex+1,
-                    -1,
-                    self._LineIndex+1,
-                    -1,
+                    self._LineIndex + 1,
+                    - 1,
+                    self._LineIndex + 1,
+                    - 1,
                     0
                     )
                 for Comment, LineNo in self._Comments:
@@ -1610,9 +1614,9 @@ class DecParser(MetaFileParser):
                         ModuleType,
                         self._LastItem,
                         LineNo,
-                        -1,
+                        - 1,
                         LineNo,
-                        -1,
+                        - 1,
                         0
                         )
             self._Comments = []
@@ -1630,10 +1634,13 @@ class DecParser(MetaFileParser):
         self._SectionName = ''
         self._SectionType = []
         ArchList = set()
-        for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
+        Line = self._CurrentLine.replace("%s%s" % (TAB_COMMA_SPLIT, TAB_SPACE_SPLIT), TAB_COMMA_SPLIT)
+        for Item in Line[1:-1].split(TAB_COMMA_SPLIT):
             if Item == '':
-                continue
-            ItemList = GetSplitValueList(Item, TAB_SPLIT)
+                EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR,
+                                "section name can NOT be empty or incorrectly use separator comma",
+                                self.MetaFile, self._LineIndex + 1, self._CurrentLine)
+            ItemList = Item.split(TAB_SPLIT)
 
             # different types of PCD are permissible in one section
             self._SectionName = ItemList[0].upper()
@@ -1641,9 +1648,8 @@ class DecParser(MetaFileParser):
                 if self.DataType[self._SectionName] not in self._SectionType:
                     self._SectionType.append(self.DataType[self._SectionName])
             else:
-                EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
-                                Line=self._LineIndex+1, ExtraData=self._CurrentLine)
-                continue
+                EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+                                self.MetaFile, self._LineIndex + 1, self._CurrentLine)
 
             if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._SectionType) > 1:
                 EdkLogger.error(
@@ -1651,7 +1657,7 @@ class DecParser(MetaFileParser):
                             FORMAT_INVALID,
                             "%s must not be in the same section of other types of PCD" % TAB_PCDS_FEATURE_FLAG_NULL,
                             File=self.MetaFile,
-                            Line=self._LineIndex+1,
+                            Line=self._LineIndex + 1,
                             ExtraData=self._CurrentLine
                             )
             # S1 is always Arch
@@ -1671,7 +1677,7 @@ class DecParser(MetaFileParser):
         # 'COMMON' must not be used with specific ARCHs at the same section
         if 'COMMON' in ArchList and len(ArchList) > 1:
             EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
-                            File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+                            File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
 
     ## [guids], [ppis] and [protocols] section parser
     @ParseMacro
@@ -1680,20 +1686,20 @@ class DecParser(MetaFileParser):
         if len(TokenList) < 2:
             EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name or value specified",
                             ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if TokenList[0] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name specified",
                             ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if TokenList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No GUID value specified",
                             ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         if TokenList[1][0] != '{' or TokenList[1][-1] != '}' or GuidStructureStringToGuidString(TokenList[1]) == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value format",
                             ExtraData=self._CurrentLine + \
                                       " (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         self._ValueList[0] = TokenList[0]
         self._ValueList[1] = TokenList[1]
 
@@ -1709,67 +1715,88 @@ class DecParser(MetaFileParser):
     def _PcdParser(self):
         TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
         self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
+        ValueRe = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*')
         # check PCD information
         if self._ValueList[0] == '' or self._ValueList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
                             ExtraData=self._CurrentLine + \
                                       " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
+        # check format of token space GUID CName
+        if not ValueRe.match(self._ValueList[0]):
+            EdkLogger.error('Parser', FORMAT_INVALID, "The format of the token space GUID CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",
+                            ExtraData=self._CurrentLine + \
+                                      " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
+                            File=self.MetaFile, Line=self._LineIndex + 1)
+        # check format of PCD CName
+        if not ValueRe.match(self._ValueList[1]):
+            EdkLogger.error('Parser', FORMAT_INVALID, "The format of the PCD CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",
+                            ExtraData=self._CurrentLine + \
+                                      " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         # check PCD datum information
         if len(TokenList) < 2 or TokenList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "No PCD Datum information given",
                             ExtraData=self._CurrentLine + \
                                       " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
+
 
-        
-        ValueRe  = re.compile(r'^\s*L?\".*\|.*\"')
+        ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
         PtrValue = ValueRe.findall(TokenList[1])
-        
+
         # Has VOID* type string, may contain "|" character in the string. 
         if len(PtrValue) != 0:
             ptrValueList = re.sub(ValueRe, '', TokenList[1])
-            ValueList    = GetSplitValueList(ptrValueList)
+            ValueList = GetSplitValueList(ptrValueList)
             ValueList[0] = PtrValue[0]
         else:
             ValueList = GetSplitValueList(TokenList[1])
-            
-        
+
+
         # check if there's enough datum information given
         if len(ValueList) != 3:
             EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Datum information given",
                             ExtraData=self._CurrentLine + \
                                       " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         # check default value
         if ValueList[0] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "Missing DefaultValue in PCD Datum information",
                             ExtraData=self._CurrentLine + \
                                       " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         # check datum type
         if ValueList[1] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "Missing DatumType in PCD Datum information",
                             ExtraData=self._CurrentLine + \
                                       " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         # check token of the PCD
         if ValueList[2] == '':
             EdkLogger.error('Parser', FORMAT_INVALID, "Missing Token in PCD Datum information",
                             ExtraData=self._CurrentLine + \
                                       " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
         # check format of default value against the datum type
         IsValid, Cause = CheckPcdDatum(ValueList[1], ValueList[0])
         if not IsValid:
             EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
-                            File=self.MetaFile, Line=self._LineIndex+1)
+                            File=self.MetaFile, Line=self._LineIndex + 1)
 
         if ValueList[0] in ['True', 'true', 'TRUE']:
             ValueList[0] = '1'
         elif ValueList[0] in ['False', 'false', 'FALSE']:
             ValueList[0] = '0'
 
+        # check for duplicate PCD definition
+        if (self._Scope[0], self._ValueList[0], self._ValueList[1]) in self._AllPCDs:
+            EdkLogger.error('Parser', FORMAT_INVALID,
+                            "The same PCD name and GUID have been already defined",
+                            ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+        else:
+            self._AllPCDs.append((self._Scope[0], self._ValueList[0], self._ValueList[1]))
+
         self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()
 
     _SectionParser = {
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
new file mode 100644 (file)
index 0000000..60acc91
--- /dev/null
@@ -0,0 +1,237 @@
+## @file\r
+# Common routines used by workspace\r
+#\r
+# Copyright (c) 2012, 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
+from Common.Misc import sdict\r
+from Common.DataType import SUP_MODULE_USER_DEFINED\r
+from BuildClassObject import LibraryClassObject\r
+\r
+## Get all packages from platform for specified arch, target and toolchain\r
+#\r
+#  @param Platform: DscBuildData instance\r
+#  @param BuildDatabase: The database saves all data for all metafiles\r
+#  @param Arch: Current arch\r
+#  @param Target: Current target\r
+#  @param Toolchain: Current toolchain\r
+#  @retval: List of packages which are DecBuildData instances\r
+#\r
+def GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain):\r
+    PkgSet = set()\r
+    for ModuleFile in Platform.Modules:\r
+        Data = BuildDatabase[ModuleFile, Arch, Target, Toolchain]\r
+        PkgSet.update(Data.Packages)\r
+        for Lib in GetLiabraryInstances(Data, Platform, BuildDatabase, Arch, Target, Toolchain):\r
+            PkgSet.update(Lib.Packages)\r
+    return list(PkgSet)\r
+\r
+## Get all declared PCD from platform for specified arch, target and toolchain\r
+#\r
+#  @param Platform: DscBuildData instance\r
+#  @param BuildDatabase: The database saves all data for all metafiles\r
+#  @param Arch: Current arch\r
+#  @param Target: Current target\r
+#  @param Toolchain: Current toolchain\r
+#  @retval: A dictionary contains instances of PcdClassObject with key (PcdCName, TokenSpaceGuid)\r
+#\r
+def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain):\r
+    PkgList = GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain)\r
+    DecPcds = {}\r
+    for Pkg in PkgList:\r
+        for Pcd in Pkg.Pcds:\r
+            DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]\r
+    return DecPcds\r
+\r
+## Get all dependent libraries for a module\r
+#\r
+#  @param Module: InfBuildData instance\r
+#  @param Platform: DscBuildData instance\r
+#  @param BuildDatabase: The database saves all data for all metafiles\r
+#  @param Arch: Current arch\r
+#  @param Target: Current target\r
+#  @param Toolchain: Current toolchain\r
+#  @retval: List of dependent libraries which are InfBuildData instances\r
+#\r
+def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):\r
+    if Module.AutoGenVersion >= 0x00010005:\r
+        return _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain)\r
+    else:\r
+        return _ResolveLibraryReference(Module, Platform)\r
+\r
+def _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):\r
+    ModuleType = Module.ModuleType\r
+\r
+    # for overriding library instances with module specific setting\r
+    PlatformModule = Platform.Modules[str(Module)]\r
+\r
+    # add forced library instances (specified under LibraryClasses sections)\r
+    #\r
+    # If a module has a MODULE_TYPE of USER_DEFINED,\r
+    # do not link in NULL library class instances from the global [LibraryClasses.*] sections.\r
+    #\r
+    if Module.ModuleType != SUP_MODULE_USER_DEFINED:\r
+        for LibraryClass in Platform.LibraryClasses.GetKeys():\r
+            if LibraryClass.startswith("NULL") and Platform.LibraryClasses[LibraryClass, Module.ModuleType]:\r
+                Module.LibraryClasses[LibraryClass] = Platform.LibraryClasses[LibraryClass, Module.ModuleType]\r
+\r
+    # add forced library instances (specified in module overrides)\r
+    for LibraryClass in PlatformModule.LibraryClasses:\r
+        if LibraryClass.startswith("NULL"):\r
+            Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]\r
+\r
+    # EdkII module\r
+    LibraryConsumerList = [Module]\r
+    Constructor = []\r
+    ConsumedByList = sdict()\r
+    LibraryInstance = sdict()\r
+\r
+    while len(LibraryConsumerList) > 0:\r
+        M = LibraryConsumerList.pop()\r
+        for LibraryClassName in M.LibraryClasses:\r
+            if LibraryClassName not in LibraryInstance:\r
+                # override library instance for this module\r
+                if LibraryClassName in PlatformModule.LibraryClasses:\r
+                    LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]\r
+                else:\r
+                    LibraryPath = Platform.LibraryClasses[LibraryClassName, ModuleType]\r
+                if LibraryPath == None or LibraryPath == "":\r
+                    LibraryPath = M.LibraryClasses[LibraryClassName]\r
+                    if LibraryPath == None or LibraryPath == "":\r
+                        return []\r
+\r
+                LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain]\r
+                # for those forced library instance (NULL library), add a fake library class\r
+                if LibraryClassName.startswith("NULL"):\r
+                    LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))\r
+                elif LibraryModule.LibraryClass == None \\r
+                     or len(LibraryModule.LibraryClass) == 0 \\r
+                     or (ModuleType != 'USER_DEFINED'\r
+                         and ModuleType not in LibraryModule.LibraryClass[0].SupModList):\r
+                    # only USER_DEFINED can link against any library instance despite of its SupModList\r
+                    return []\r
+\r
+                LibraryInstance[LibraryClassName] = LibraryModule\r
+                LibraryConsumerList.append(LibraryModule)\r
+            else:\r
+                LibraryModule = LibraryInstance[LibraryClassName]\r
+\r
+            if LibraryModule == None:\r
+                continue\r
+\r
+            if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:\r
+                Constructor.append(LibraryModule)\r
+\r
+            if LibraryModule not in ConsumedByList:\r
+                ConsumedByList[LibraryModule] = []\r
+            # don't add current module itself to consumer list\r
+            if M != Module:\r
+                if M in ConsumedByList[LibraryModule]:\r
+                    continue\r
+                ConsumedByList[LibraryModule].append(M)\r
+    #\r
+    # Initialize the sorted output list to the empty set\r
+    #\r
+    SortedLibraryList = []\r
+    #\r
+    # Q <- Set of all nodes with no incoming edges\r
+    #\r
+    LibraryList = [] #LibraryInstance.values()\r
+    Q = []\r
+    for LibraryClassName in LibraryInstance:\r
+        M = LibraryInstance[LibraryClassName]\r
+        LibraryList.append(M)\r
+        if ConsumedByList[M] == []:\r
+            Q.append(M)\r
+\r
+    #\r
+    # start the  DAG algorithm\r
+    #\r
+    while True:\r
+        EdgeRemoved = True\r
+        while Q == [] and EdgeRemoved:\r
+            EdgeRemoved = False\r
+            # for each node Item with a Constructor\r
+            for Item in LibraryList:\r
+                if Item not in Constructor:\r
+                    continue\r
+                # for each Node without a constructor with an edge e from Item to Node\r
+                for Node in ConsumedByList[Item]:\r
+                    if Node in Constructor:\r
+                        continue\r
+                    # remove edge e from the graph if Node has no constructor\r
+                    ConsumedByList[Item].remove(Node)\r
+                    EdgeRemoved = True\r
+                    if ConsumedByList[Item] == []:\r
+                        # insert Item into Q\r
+                        Q.insert(0, Item)\r
+                        break\r
+                if Q != []:\r
+                    break\r
+        # DAG is done if there's no more incoming edge for all nodes\r
+        if Q == []:\r
+            break\r
+\r
+        # remove node from Q\r
+        Node = Q.pop()\r
+        # output Node\r
+        SortedLibraryList.append(Node)\r
+\r
+        # for each node Item with an edge e from Node to Item do\r
+        for Item in LibraryList:\r
+            if Node not in ConsumedByList[Item]:\r
+                continue\r
+            # remove edge e from the graph\r
+            ConsumedByList[Item].remove(Node)\r
+\r
+            if ConsumedByList[Item] != []:\r
+                continue\r
+            # insert Item into Q, if Item has no other incoming edges\r
+            Q.insert(0, Item)\r
+\r
+    #\r
+    # if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle\r
+    #\r
+    for Item in LibraryList:\r
+        if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:\r
+            return []\r
+        if Item not in SortedLibraryList:\r
+            SortedLibraryList.append(Item)\r
+\r
+    #\r
+    # Build the list of constructor and destructir names\r
+    # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order\r
+    #\r
+    SortedLibraryList.reverse()\r
+    return SortedLibraryList\r
+\r
+def _ResolveLibraryReference(Module, Platform):\r
+    LibraryConsumerList = [Module]\r
+\r
+    # "CompilerStub" is a must for Edk modules\r
+    if Module.Libraries:\r
+        Module.Libraries.append("CompilerStub")\r
+    LibraryList = []\r
+    while len(LibraryConsumerList) > 0:\r
+        M = LibraryConsumerList.pop()\r
+        for LibraryName in M.Libraries:\r
+            Library = Platform.LibraryClasses[LibraryName, ':dummy:']\r
+            if Library == None:\r
+                for Key in Platform.LibraryClasses.data.keys():\r
+                    if LibraryName.upper() == Key.upper():\r
+                        Library = Platform.LibraryClasses[Key, ':dummy:']\r
+                        break\r
+                if Library == None:\r
+                    continue\r
+\r
+            if Library not in LibraryList:\r
+                LibraryList.append(Library)\r
+                LibraryConsumerList.append(Library)\r
+    return LibraryList\r
index e5fb41a8e0e276750fcb28ca85e19b26e9b173da..19c00ca78d83e4bc3dd2be82cfae2635c0bf65b3 100644 (file)
@@ -34,6 +34,8 @@ from MetaDataTable import *
 from MetaFileTable import *\r
 from MetaFileParser import *\r
 from BuildClassObject import *\r
+from WorkspaceCommon import GetDeclaredPcd\r
+from Common.Misc import AnalyzeDscPcd\r
 \r
 ## Platform build information from DSC file\r
 #\r
@@ -134,6 +136,7 @@ class DscBuildData(PlatformBuildClassObject):
         self._LibraryInstances  = None\r
         self._LibraryClasses    = None\r
         self._Pcds              = None\r
+        self._DecPcds           = None\r
         self._BuildOptions      = None\r
         self._LoadFixAddress    = None\r
         self._RFCLanguages      = None\r
@@ -613,6 +616,46 @@ class DscBuildData(PlatformBuildClassObject):
                 self._LibraryClasses[Library.BaseName, ':dummy:'] = Library\r
         return self._LibraryClasses\r
 \r
+    def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo):\r
+        if self._DecPcds == None:\r
+            self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain)\r
+        if (PcdCName, TokenSpaceGuid) not in self._DecPcds:\r
+            EdkLogger.error('build', PARSER_ERROR,\r
+                            "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),\r
+                            File=self.MetaFile, Line=LineNo)\r
+        ValueList, IsValid, Index = AnalyzeDscPcd(Setting, PcdType, self._DecPcds[PcdCName, TokenSpaceGuid].DatumType)\r
+        if not IsValid and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:\r
+            EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self.MetaFile, Line=LineNo,\r
+                            ExtraData="%s.%s|%s" % (TokenSpaceGuid, PcdCName, Setting))\r
+        if ValueList[Index] and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:\r
+            try:\r
+                ValueList[Index] = ValueExpression(ValueList[Index], GlobalData.gPlatformPcds)(True)\r
+            except WrnExpression, Value:\r
+                ValueList[Index] = Value.result\r
+            except EvaluationException, Excpt:\r
+                if hasattr(Excpt, 'Pcd'):\r
+                    if Excpt.Pcd in GlobalData.gPlatformOtherPcds:\r
+                        EdkLogger.error('Parser', FORMAT_INVALID, "Cannot use this PCD (%s) in an expression as"\r
+                                        " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"\r
+                                        " of the DSC file" % Excpt.Pcd,\r
+                                        File=self.MetaFile, Line=LineNo)\r
+                    else:\r
+                        EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s) is not defined in DSC file" % Excpt.Pcd,\r
+                                        File=self.MetaFile, Line=LineNo)\r
+                else:\r
+                    EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),\r
+                                    File=self.MetaFile, Line=LineNo)\r
+            if ValueList[Index] == 'True':\r
+                ValueList[Index] = '1'\r
+            elif ValueList[Index] == 'False':\r
+                ValueList[Index] = '0'\r
+        if ValueList[Index]:\r
+            Valid, ErrStr = CheckPcdDatum(self._DecPcds[PcdCName, TokenSpaceGuid].DatumType, ValueList[Index])\r
+            if not Valid:\r
+                EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=LineNo,\r
+                                ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))\r
+        return ValueList\r
+\r
     ## Retrieve all PCD settings in platform\r
     def _GetPcds(self):\r
         if self._Pcds == None:\r
@@ -663,14 +706,14 @@ class DscBuildData(PlatformBuildClassObject):
         # Find out all possible PCD candidates for self._Arch\r
         RecordList = self._RawData[Type, self._Arch]\r
         for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:\r
-            PcdSet.add((PcdCName, TokenSpaceGuid))\r
+            PcdSet.add((PcdCName, TokenSpaceGuid, Dummy4))\r
             PcdDict[Arch, PcdCName, TokenSpaceGuid] = Setting\r
         # Remove redundant PCD candidates\r
-        for PcdCName, TokenSpaceGuid in PcdSet:\r
+        for PcdCName, TokenSpaceGuid, Dummy4 in PcdSet:\r
             Setting = PcdDict[self._Arch, PcdCName, TokenSpaceGuid]\r
             if Setting == None:\r
                 continue\r
-            PcdValue, DatumType, MaxDatumSize = AnalyzePcdData(Setting)\r
+            PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)\r
             Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(\r
                                                 PcdCName,\r
                                                 TokenSpaceGuid,\r
@@ -702,15 +745,15 @@ class DscBuildData(PlatformBuildClassObject):
         # Find out all possible PCD candidates for self._Arch\r
         RecordList = self._RawData[Type, self._Arch]\r
         for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:\r
-            PcdList.append((PcdCName, TokenSpaceGuid))\r
+            PcdList.append((PcdCName, TokenSpaceGuid, Dummy4))\r
             PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting\r
         # Remove redundant PCD candidates, per the ARCH and SKU\r
-        for PcdCName, TokenSpaceGuid in PcdList:\r
+        for PcdCName, TokenSpaceGuid, Dummy4 in PcdList:\r
             Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]\r
             if Setting == None:\r
                 continue\r
                       \r
-            PcdValue, DatumType, MaxDatumSize = AnalyzePcdData(Setting)\r
+            PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)\r
                 \r
             SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], '', '', '', '', '', PcdValue)\r
             Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(\r
@@ -744,14 +787,14 @@ class DscBuildData(PlatformBuildClassObject):
         RecordList = self._RawData[Type, self._Arch]\r
         # Find out all possible PCD candidates for self._Arch\r
         for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:\r
-            PcdSet.add((PcdCName, TokenSpaceGuid))\r
+            PcdSet.add((PcdCName, TokenSpaceGuid, Dummy4))\r
             PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting\r
         # Remove redundant PCD candidates, per the ARCH and SKU\r
-        for PcdCName, TokenSpaceGuid in PcdSet:\r
+        for PcdCName, TokenSpaceGuid, Dummy4 in PcdSet:\r
             Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]\r
             if Setting == None:\r
                 continue\r
-            VariableName, VariableGuid, VariableOffset, DefaultValue = AnalyzeHiiPcdData(Setting)\r
+            VariableName, VariableGuid, VariableOffset, DefaultValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)\r
             SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], VariableName, VariableGuid, VariableOffset, DefaultValue)\r
             Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(\r
                                                 PcdCName,\r
@@ -784,10 +827,10 @@ class DscBuildData(PlatformBuildClassObject):
         # Find out all possible PCD candidates for self._Arch\r
         RecordList = self._RawData[Type, self._Arch]\r
         for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:\r
-            PcdList.append((PcdCName, TokenSpaceGuid))\r
+            PcdList.append((PcdCName, TokenSpaceGuid, Dummy4))\r
             PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting\r
         # Remove redundant PCD candidates, per the ARCH and SKU\r
-        for PcdCName, TokenSpaceGuid in PcdList:\r
+        for PcdCName, TokenSpaceGuid, Dummy4 in PcdList:\r
             Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]\r
             if Setting == None:\r
                 continue\r
@@ -797,7 +840,7 @@ class DscBuildData(PlatformBuildClassObject):
             # At this point, we put all the data into the PcdClssObject for we don't know the PCD's datumtype\r
             # until the DEC parser has been called.\r
             # \r
-            VpdOffset, MaxDatumSize, InitialValue = AnalyzeVpdPcdData(Setting)\r
+            VpdOffset, MaxDatumSize, InitialValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)\r
 \r
             SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], '', '', '', '', VpdOffset, InitialValue)\r
             Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(\r
@@ -842,32 +885,6 @@ class DscBuildData(PlatformBuildClassObject):
             self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None)\r
         self.Pcds[Name, Guid].DefaultValue = Value\r
 \r
-    def IsPlatformPcdDeclared(self, DecPcds):\r
-        for PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_FEATURE_FLAG,\r
-                        MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_VPD,\r
-                        MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNAMIC_EX_HII, MODEL_PCD_DYNAMIC_EX_VPD):\r
-            RecordList = self._RawData[PcdType, self._Arch]\r
-            for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:\r
-                if (PcdCName, TokenSpaceGuid) not in DecPcds:\r
-                    EdkLogger.error('build', PARSER_ERROR,\r
-                                    "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),\r
-                                    File=self.MetaFile, Line=Dummy4)\r
-                PcdValue = ''\r
-                if PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):\r
-                    if DecPcds[PcdCName, TokenSpaceGuid].DatumType == "VOID*":\r
-                        PcdValue = AnalyzeVpdPcdData(Setting)[2]\r
-                    else:\r
-                        PcdValue = AnalyzeVpdPcdData(Setting)[1]\r
-                elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):\r
-                    PcdValue = AnalyzeHiiPcdData(Setting)[3]\r
-                else:\r
-                    PcdValue = AnalyzePcdData(Setting)[0]\r
-                if PcdValue:\r
-                    Valid, ErrStr = CheckPcdDatum(DecPcds[PcdCName, TokenSpaceGuid].DatumType, PcdValue)\r
-                    if not Valid:\r
-                        EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=Dummy4,\r
-                                    ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))\r
-\r
     _Macros             = property(_GetMacros)\r
     Arch                = property(_GetArch, _SetArch)\r
     Platform            = property(_GetPlatformName)\r
index d5ea3bd3e5fa077dc9c2e7eb7e98b480f43dfbcf..2058a7bae72d745ea6be01c69830c5f520009fa9 100644 (file)
@@ -4,7 +4,7 @@
 # This module contains the functionality to generate build report after\r
 # build all target completes successfully.\r
 #\r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2012, 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
@@ -72,6 +72,9 @@ gGlueLibEntryPoint = re.compile(r"__EDKII_GLUE_MODULE_ENTRY_POINT__\s*=\s*(\w+)"
 ## Tags for MaxLength of line in report\r
 gLineMaxLength = 120\r
 \r
+## Tags for end of line in report\r
+gEndOfLine = "\r\n"\r
+\r
 ## Tags for section start, end and separator\r
 gSectionStart = ">" + "=" * (gLineMaxLength-2) + "<"\r
 gSectionEnd = "<" + "=" * (gLineMaxLength-2) + ">" + "\n"\r
@@ -91,9 +94,9 @@ gPcdTypeMap = {
   'Dynamic'          : ('DYN',    'Dynamic'),\r
   'DynamicHii'       : ('DYNHII', 'Dynamic'),\r
   'DynamicVpd'       : ('DYNVPD', 'Dynamic'),\r
-  'DynamicEx'        : ('DEX',    'Dynamic'),\r
-  'DynamicExHii'     : ('DEXHII', 'Dynamic'),\r
-  'DynamicExVpd'     : ('DEXVPD', 'Dynamic'),\r
+  'DynamicEx'        : ('DEX',    'DynamicEx'),\r
+  'DynamicExHii'     : ('DEXHII', 'DynamicEx'),\r
+  'DynamicExVpd'     : ('DEXVPD', 'DynamicEx'),\r
   }\r
 \r
 ## The look up table to map module type to driver type\r
@@ -128,7 +131,7 @@ gOpCodeList = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "TRUE", "FALSE", "
 def FileWrite(File, String, Wrapper=False):\r
     if Wrapper:\r
         String = textwrap.fill(String, 120)\r
-    File.write(String + "\r\n")\r
+    File.write(String + gEndOfLine)\r
 \r
 ##\r
 # Find all the header file that the module source directly includes.\r
@@ -203,6 +206,8 @@ def FileLinesSplit(Content=None, MaxLength=None):
             NewContentList.append(Line)\r
     for NewLine in NewContentList:\r
         NewContent += NewLine + TAB_LINE_BREAK\r
+    \r
+    NewContent = NewContent.replace(TAB_LINE_BREAK, gEndOfLine).replace('\r\r\n', gEndOfLine)\r
     return NewContent\r
     \r
     \r
@@ -694,7 +699,8 @@ class PcdReport(object):
         # Collect PCDs defined in DSC common section\r
         #\r
         self.DscPcdDefault = {}\r
-        for Platform in Wa.BuildDatabase.WorkspaceDb.PlatformList:\r
+        for Arch in Wa.ArchList:\r
+            Platform = Wa.BuildDatabase[Wa.MetaFile, Arch, Wa.BuildTarget, Wa.ToolChain]\r
             for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:\r
                 DscDefaultValue = Platform.Pcds[(TokenCName, TokenSpaceGuidCName)].DefaultValue\r
                 if DscDefaultValue:\r
index a463c527be130c6745716d93d28ed893b6d55c49..24a6ed8168ba91df9b15449ef101cbf4e17cf644 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # build a platform or a module\r
 #\r
-#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2013, 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
@@ -23,7 +23,7 @@ import glob
 import time\r
 import platform\r
 import traceback\r
-import encodings.ascii \r
+import encodings.ascii\r
 \r
 from struct import *\r
 from threading import *\r
@@ -47,9 +47,9 @@ import Common.EdkLogger
 import Common.GlobalData as GlobalData\r
 \r
 # Version and Copyright\r
-VersionNumber = "0.5" + ' ' + gBUILD_VERSION\r
+VersionNumber = "0.51" + ' ' + gBUILD_VERSION\r
 __version__ = "%prog Version " + VersionNumber\r
-__copyright__ = "Copyright (c) 2007 - 2010, Intel Corporation  All rights reserved."\r
+__copyright__ = "Copyright (c) 2007 - 2013, Intel Corporation  All rights reserved."\r
 \r
 ## standard targets of build command\r
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']\r
@@ -119,12 +119,12 @@ def CheckEnvVariable():
     EfiSourceDir = os.path.normcase(os.path.normpath(os.environ["EFI_SOURCE"]))\r
     EdkSourceDir = os.path.normcase(os.path.normpath(os.environ["EDK_SOURCE"]))\r
     EcpSourceDir = os.path.normcase(os.path.normpath(os.environ["ECP_SOURCE"]))\r
\r
+\r
     os.environ["EFI_SOURCE"] = EfiSourceDir\r
     os.environ["EDK_SOURCE"] = EdkSourceDir\r
     os.environ["ECP_SOURCE"] = EcpSourceDir\r
     os.environ["EDK_TOOLS_PATH"] = os.path.normcase(os.environ["EDK_TOOLS_PATH"])\r
-    \r
+\r
     if not os.path.exists(EcpSourceDir):\r
         EdkLogger.verbose("ECP_SOURCE = %s doesn't exist. Edk modules could not be built." % EcpSourceDir)\r
     elif ' ' in EcpSourceDir:\r
@@ -313,7 +313,7 @@ class BuildUnit:
         if not BuildCommand:\r
             EdkLogger.error("build", OPTION_MISSING,\r
                             "No build command found for this module. "\r
-                            "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." % \r
+                            "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." %\r
                                 (Obj.BuildTarget, Obj.ToolChain, Obj.Arch),\r
                             ExtraData=str(Obj))\r
 \r
@@ -669,7 +669,7 @@ class PeImageInfo():
     #\r
     # Constructor will load all required image information.\r
     #\r
-    #   @param  BaseName          The full file path of image. \r
+    #   @param  BaseName          The full file path of image.\r
     #   @param  Guid              The GUID for image.\r
     #   @param  Arch              Arch of this image.\r
     #   @param  OutputDir         The output directory for image.\r
@@ -838,7 +838,7 @@ class Build():
     #\r
     def InitBuild(self):\r
         # parse target.txt, tools_def.txt, and platform file\r
-        self.LoadConfiguration()        \r
+        self.LoadConfiguration()\r
 \r
         # Allow case-insensitive for those from command line or configuration file\r
         ErrorCode, ErrorInfo = self.PlatformFile.Validate(".dsc", False)\r
@@ -897,7 +897,7 @@ class Build():
         if BuildCommand == None or len(BuildCommand) == 0:\r
             EdkLogger.error("build", OPTION_MISSING,\r
                             "No build command found for this module. "\r
-                            "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." % \r
+                            "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." %\r
                                 (AutoGenObject.BuildTarget, AutoGenObject.ToolChain, AutoGenObject.Arch),\r
                             ExtraData=str(AutoGenObject))\r
 \r
@@ -994,9 +994,9 @@ class Build():
                 elif SectionHeader[0] in ['.data', '.sdata']:\r
                     DataSectionAddress = SectionHeader[1]\r
             if AddrIsOffset:\r
-                MapBuffer.write('(GUID=%s, .textbaseaddress=-0x%010X, .databaseaddress=-0x%010X)\n' % (ModuleInfo.Guid, 0 - (BaseAddress + TextSectionAddress), 0 - (BaseAddress + DataSectionAddress))) \r
+                MapBuffer.write('(GUID=%s, .textbaseaddress=-0x%010X, .databaseaddress=-0x%010X)\n' % (ModuleInfo.Guid, 0 - (BaseAddress + TextSectionAddress), 0 - (BaseAddress + DataSectionAddress)))\r
             else:\r
-                MapBuffer.write('(GUID=%s, .textbaseaddress=0x%010X, .databaseaddress=0x%010X)\n' % (ModuleInfo.Guid, BaseAddress + TextSectionAddress, BaseAddress + DataSectionAddress)) \r
+                MapBuffer.write('(GUID=%s, .textbaseaddress=0x%010X, .databaseaddress=0x%010X)\n' % (ModuleInfo.Guid, BaseAddress + TextSectionAddress, BaseAddress + DataSectionAddress))\r
             #\r
             # Add debug image full path.\r
             #\r
@@ -1076,7 +1076,7 @@ class Build():
         for ModuleGuid in ModuleList:\r
             Module = ModuleList[ModuleGuid]\r
             GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (Module.MetaFile, Module.Arch, Module.ToolChain, Module.BuildTarget)\r
-            \r
+\r
             OutputImageFile = ''\r
             for ResultFile in Module.CodaTargetList:\r
                 if str(ResultFile.Target).endswith('.efi'):\r
@@ -1127,15 +1127,15 @@ class Build():
                         if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:\r
                             ModuleIsPatch = True\r
                             break\r
-                \r
+\r
                 if not ModuleIsPatch:\r
                     continue\r
                 #\r
                 # Module includes the patchable load fix address PCDs.\r
-                # It will be fixed up later. \r
+                # It will be fixed up later.\r
                 #\r
                 PatchEfiImageList.append (OutputImageFile)\r
-        \r
+\r
         #\r
         # Get Top Memory address\r
         #\r
@@ -1155,14 +1155,14 @@ class Build():
         #\r
         # Patch FixAddress related PCDs into EFI image\r
         #\r
-        for EfiImage in PatchEfiImageList: \r
+        for EfiImage in PatchEfiImageList:\r
             EfiImageMap = EfiImage.replace('.efi', '.map')\r
             if not os.path.exists(EfiImageMap):\r
                 continue\r
             #\r
             # Get PCD offset in EFI image by GenPatchPcdTable function\r
             #\r
-            PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) \r
+            PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage)\r
             #\r
             # Patch real PCD value by PatchPcdValue tool\r
             #\r
@@ -1178,16 +1178,16 @@ class Build():
                     ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str (SmmSize/0x1000))\r
                 if ReturnValue != 0:\r
                     EdkLogger.error("build", PARAMETER_INVALID, "Patch PCD value failed", ExtraData=ErrorInfo)\r
-        \r
+\r
         MapBuffer.write('PEI_CODE_PAGE_NUMBER      = 0x%x\n' % (PeiSize/0x1000))\r
         MapBuffer.write('BOOT_CODE_PAGE_NUMBER     = 0x%x\n' % (BtSize/0x1000))\r
         MapBuffer.write('RUNTIME_CODE_PAGE_NUMBER  = 0x%x\n' % (RtSize/0x1000))\r
         if len (SmmModuleList) > 0:\r
             MapBuffer.write('SMM_CODE_PAGE_NUMBER      = 0x%x\n' % (SmmSize/0x1000))\r
-        \r
-        PeiBaseAddr = TopMemoryAddress - RtSize - BtSize \r
+\r
+        PeiBaseAddr = TopMemoryAddress - RtSize - BtSize\r
         BtBaseAddr  = TopMemoryAddress - RtSize\r
-        RtBaseAddr  = TopMemoryAddress - ReservedRuntimeMemorySize \r
+        RtBaseAddr  = TopMemoryAddress - ReservedRuntimeMemorySize\r
 \r
         self._RebaseModule (MapBuffer, PeiBaseAddr, PeiModuleList, TopMemoryAddress == 0)\r
         self._RebaseModule (MapBuffer, BtBaseAddr, BtModuleList, TopMemoryAddress == 0)\r
@@ -1196,7 +1196,7 @@ class Build():
         MapBuffer.write('\n\n')\r
         sys.stdout.write ("\n")\r
         sys.stdout.flush()\r
-    \r
+\r
     ## Save platform Map file\r
     #\r
     def _SaveMapFile (self, MapBuffer, Wa):\r
@@ -1243,7 +1243,7 @@ class Build():
                 self.BuildReport.AddPlatformReport(Wa)\r
                 self.Progress.Stop("done!")\r
                 self._Build(self.Target, Wa)\r
-                \r
+\r
                 # Create MAP file when Load Fix Address is enabled.\r
                 if self.Target in ["", "all", "fds"]:\r
                     for Arch in Wa.ArchList:\r
@@ -1292,7 +1292,7 @@ class Build():
             GlobalData.gGlobalDefines['TARGET'] = BuildTarget\r
             for ToolChain in self.ToolChainList:\r
                 GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain\r
-                GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain             \r
+                GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain\r
                 #\r
                 # module build needs platform build information, so get platform\r
                 # AutoGen first\r
@@ -1383,7 +1383,7 @@ class Build():
             GlobalData.gGlobalDefines['TARGET'] = BuildTarget\r
             for ToolChain in self.ToolChainList:\r
                 GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain\r
-                GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain  \r
+                GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain\r
                 Wa = WorkspaceAutoGen(\r
                         self.WorkspaceDir,\r
                         self.PlatformFile,\r
@@ -1414,6 +1414,7 @@ class Build():
                     Pa = PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, ToolChain, Arch)\r
                     if Pa == None:\r
                         continue\r
+                    pModules = []\r
                     for Module in Pa.Platform.Modules:\r
                         # Get ModuleAutoGen object to generate C code file and makefile\r
                         Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile)\r
@@ -1433,6 +1434,9 @@ class Build():
                             if self.Target == "genmake":\r
                                 continue\r
                         self.Progress.Stop("done!")\r
+                        pModules.append(Ma)\r
+\r
+                    for Ma in pModules:\r
                         # Generate build task for the module\r
                         Bt = BuildTask.New(ModuleMakeUnit(Ma, self.Target))\r
                         # Break build if any build thread has error\r
@@ -1537,10 +1541,10 @@ class Build():
                 if not os.path.exists(FvDir):\r
                     continue\r
 \r
-                for Arch in self.ArchList:    \r
+                for Arch in self.ArchList:\r
                     # Build up the list of supported architectures for this build\r
                     prefix = '%s_%s_%s_' % (BuildTarget, ToolChain, Arch)\r
-    \r
+\r
                     # Look through the tool definitions for GUIDed tools\r
                     guidAttribs = []\r
                     for (attrib, value) in self.ToolDef.ToolsDefTxtDictionary.iteritems():\r
@@ -1555,7 +1559,7 @@ class Build():
                                 path = self.ToolDef.ToolsDefTxtDictionary[path]\r
                                 path = self.GetFullPathOfTool(path)\r
                                 guidAttribs.append((guid, toolName, path))\r
-    \r
+\r
                     # Write out GuidedSecTools.txt\r
                     toolsFile = os.path.join(FvDir, 'GuidedSectionTools.txt')\r
                     toolsFile = open(toolsFile, 'wt')\r
@@ -1632,7 +1636,7 @@ def ParseDefines(DefineList=[]):
                 EdkLogger.error('build', FORMAT_INVALID,\r
                                 "The macro name must be in the pattern [A-Z][A-Z0-9_]*",\r
                                 ExtraData=DefineTokenList[0])\r
-                \r
+\r
             if len(DefineTokenList) == 1:\r
                 DefineDict[DefineTokenList[0]] = "TRUE"\r
             else:\r
@@ -1656,8 +1660,8 @@ def SingleCheckCallback(option, opt_str, value, parser):
 #\r
 def MyOptionParser():\r
     Parser = OptionParser(description=__copyright__,version=__version__,prog="build.exe",usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")\r
-    Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC','ARM'], dest="TargetArch",\r
-        help="ARCHS is one of list: IA32, X64, IPF, ARM or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")\r
+    Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC','ARM', 'AARCH64'], dest="TargetArch",\r
+        help="ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")\r
     Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,\r
         help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")\r
     Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,\r
index c63c2166c318618c8442dc67134206b2cf350679..b7cb226da97c9d31cb2bfb078d27cbb25659e8e3 100644 (file)
@@ -1,5 +1,5 @@
 ## @file\r
-# Windows makefile for 'Tests' module build.\r
+# GNU/Linux makefile for 'Tests' module build.\r
 #\r
 # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
index 886e2da552aed5db30e759be70d5e5c21dc47029..ed9cecee28b9a44e46431dc3fdc8d1fda9f68dec 100644 (file)
@@ -9,7 +9,7 @@ If you do not have a tianocore.org account, you can make use of the 'guest'
 account with an empty password.
 
 In a web browser, you can 'browse' the relavent source at this location:
- https://buildtools.tianocore.org/source/browse/buildtools/trunk/BaseTools/gcc
+ http://sourceforge.net/p/edk2-buildtools/code/HEAD/tree/trunk/BaseTools/gcc
 
 Or, with subversion, you can download the relavent source with this command:
- svn co https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools/gcc
+ svn co https://svn.code.sf.net/p/edk2-buildtools/code/trunk/BaseTools/gcc
index 561cc408cb7f30cbb0e0db517304f9c605be55e4..98d0247aa1f356623e7d2dffaaeef56cadf26555 100755 (executable)
@@ -3,10 +3,10 @@
 @REM   however it may be executed directly from the BaseTools project folder\r
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.\r
 @REM\r
-@REM Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 @REM\r
 @REM This program and the accompanying materials are licensed and made available\r
-@REM under the terms and conditions of the BSD Licensewhich accompanies this \r
+@REM under the terms and conditions of the BSD License which accompanies this \r
 @REM distribution.  The full text of the license may be found at:\r
 @REM   http://opensource.org/licenses/bsd-license.php\r
 @REM\r