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

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11640 6f19259b-4bc3-4df7-8a09-765794883524

67 files changed:
BaseTools/Bin/Win32/BPDG.exe
BaseTools/Bin/Win32/BootSectImage.exe
BaseTools/Bin/Win32/EfiLdrImage.exe
BaseTools/Bin/Win32/EfiRom.exe
BaseTools/Bin/Win32/Fpd2Dsc.exe
BaseTools/Bin/Win32/GenBootSector.exe
BaseTools/Bin/Win32/GenCrc32.exe
BaseTools/Bin/Win32/GenDepex.exe
BaseTools/Bin/Win32/GenFds.exe
BaseTools/Bin/Win32/GenFfs.exe
BaseTools/Bin/Win32/GenFv.exe
BaseTools/Bin/Win32/GenFw.exe
BaseTools/Bin/Win32/GenPage.exe
BaseTools/Bin/Win32/GenPatchPcdTable.exe
BaseTools/Bin/Win32/GenSec.exe
BaseTools/Bin/Win32/GenVtf.exe
BaseTools/Bin/Win32/LzmaCompress.exe
BaseTools/Bin/Win32/MigrationMsa2Inf.exe
BaseTools/Bin/Win32/PatchPcdValue.exe
BaseTools/Bin/Win32/Spd2Dec.exe
BaseTools/Bin/Win32/Split.exe
BaseTools/Bin/Win32/TargetTool.exe
BaseTools/Bin/Win32/TianoCompress.exe
BaseTools/Bin/Win32/Trim.exe
BaseTools/Bin/Win32/VfrCompile.exe
BaseTools/Bin/Win32/VolInfo.exe
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
BaseTools/Bin/Win32/select.pyd
BaseTools/Conf/XMLSchema/DistributionPackage.xsd
BaseTools/Conf/build_rule.template
BaseTools/Conf/tools_def.template
BaseTools/Scripts/gcc4.4-ld-script
BaseTools/Source/C/Common/PeCoffLib.h
BaseTools/Source/C/Common/PeCoffLoaderEx.c
BaseTools/Source/C/GenFw/Elf32Convert.c
BaseTools/Source/C/GenFw/Elf64Convert.c
BaseTools/Source/C/GenFw/ElfConvert.c
BaseTools/Source/C/GenFw/ElfConvert.h
BaseTools/Source/C/GenFw/GenFw.c
BaseTools/Source/C/GenFw/GenFw.h
BaseTools/Source/C/Include/IndustryStandard/PeImage.h
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.h
BaseTools/Source/C/VfrCompile/VfrSyntax.g
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/AutoGen/GenC.py
BaseTools/Source/Python/AutoGen/GenMake.py
BaseTools/Source/Python/AutoGen/UniClassObject.py
BaseTools/Source/Python/Common/ToolDefClassObject.py
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/Section.py
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools/Source/Python/build/BuildReport.py
BaseTools/Source/Python/build/build.py
BaseTools/UserManuals/RmPkg_Utility_Man_Page.rtf

index fc5c09a66bdcd4f9dea8f12db5cc2c2e624c50cc..27a684e6663d27aaacea63ce7462f882d3d66d72 100644 (file)
Binary files a/BaseTools/Bin/Win32/BPDG.exe and b/BaseTools/Bin/Win32/BPDG.exe differ
index a2c13ce8db5b8389736d27225deb03f0c2225784..e13119d75cee75dcdbc49d8bbf0e0e4a8d65ce31 100755 (executable)
Binary files a/BaseTools/Bin/Win32/BootSectImage.exe and b/BaseTools/Bin/Win32/BootSectImage.exe differ
index d918320749915f0168174e522d70b1eb00221062..059186d5c9815aeee94d733a448e0f0f74d361e4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiLdrImage.exe and b/BaseTools/Bin/Win32/EfiLdrImage.exe differ
index 3b8930c8de027849af9aca1194c74be0093c0ead..090ab35a582d659a69ed9566b7af8df06f840116 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiRom.exe and b/BaseTools/Bin/Win32/EfiRom.exe differ
index 9cfeea5de2a4fe2595e3385a9e516def1ad24d92..77a457751d4940726fa4e43d1f06ef3b16466324 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Fpd2Dsc.exe and b/BaseTools/Bin/Win32/Fpd2Dsc.exe differ
index c6895aca1fbbf6eacc5a39c3fca67020da181bd6..f2a0bc57784f31e0032f5999848b395c555423b8 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenBootSector.exe and b/BaseTools/Bin/Win32/GenBootSector.exe differ
index cb484d0d5f998a322a0d7ead7f3c215bc79862f9..2455eaea0aef526468609a0e0a2ae5349a44ba68 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenCrc32.exe and b/BaseTools/Bin/Win32/GenCrc32.exe differ
index 6c01edb036c968152cfb76c9456f195aa5aa3e7b..bfb5abd669c5e782228cc1b0eec13210ed1aacc0 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenDepex.exe and b/BaseTools/Bin/Win32/GenDepex.exe differ
index 17139fa7b12eb42649aacd17fd3afbdb8f8a7483..e2480a1bc813c922285b7f7167b79c4b5b5d7dff 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFds.exe and b/BaseTools/Bin/Win32/GenFds.exe differ
index 610e275763fff1273588a751a5d1e1b9f7f0a329..6bd6ac5363457cfb00e1bd564a0a9faf5132dd1c 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFfs.exe and b/BaseTools/Bin/Win32/GenFfs.exe differ
index 18dca5c76e175b3771a101df79aa1e93a5033c91..761cc14d51b6e8f731da3443a158e2ef52424876 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFv.exe and b/BaseTools/Bin/Win32/GenFv.exe differ
index a99d6b88bf04399e9e0aa3e066549a014ef6731b..a7df5ebe5ba1d30d95027bd12f25829f0b59e95a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFw.exe and b/BaseTools/Bin/Win32/GenFw.exe differ
index 40e154e2a549d78f1e49e10f8707ffa266fa5cb6..fd1cacfbca2a5c467f32516f9ccddd4ea172af8f 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPage.exe and b/BaseTools/Bin/Win32/GenPage.exe differ
index 0163b10f37b9d4d05a3bcb6e7f6b8583396ec4e0..2afbeb656322d9869f2ec882053bb0f0dbddc64a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPatchPcdTable.exe and b/BaseTools/Bin/Win32/GenPatchPcdTable.exe differ
index 45af0ab7dc6e5a59c28ba6566ca9392282d7c264..45f5c1a910f5eff9b273c40468319d419e4669a1 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenSec.exe and b/BaseTools/Bin/Win32/GenSec.exe differ
index 4e1567cd2d8003a1e24b0ce04820ea12690218b1..41d513a71e12532dc2f0a8c86fe19cf747422fe0 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenVtf.exe and b/BaseTools/Bin/Win32/GenVtf.exe differ
index 3d3fae05acd35ce98a33cd8cd6c28e9c61a93244..84b013acee6b2885f815ff7e55fb4a3e85869bae 100755 (executable)
Binary files a/BaseTools/Bin/Win32/LzmaCompress.exe and b/BaseTools/Bin/Win32/LzmaCompress.exe differ
index c4ad8c23cf2fb820687c4d8f7c201788884a722b..ef32d4362b70f2b401e64753917d23c47fcbdee2 100755 (executable)
Binary files a/BaseTools/Bin/Win32/MigrationMsa2Inf.exe and b/BaseTools/Bin/Win32/MigrationMsa2Inf.exe differ
index afcaccfc6615e513e8aa5e61c0ecf9c210492f0f..ac433218db65283336717a709aedc82661f97bda 100755 (executable)
Binary files a/BaseTools/Bin/Win32/PatchPcdValue.exe and b/BaseTools/Bin/Win32/PatchPcdValue.exe differ
index 239f9465f11f92a0c75ce6fd47ea3d0b2620bae3..66c89d503f7cf978cf8f3d25f4c18043051161df 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Spd2Dec.exe and b/BaseTools/Bin/Win32/Spd2Dec.exe differ
index 8eb1351f5e36cceaa1bfc31932bb2660b7b6c0ea..2d41954bb3888ef5575237f2eba65152bf473bc1 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Split.exe and b/BaseTools/Bin/Win32/Split.exe differ
index cdfb75e4fcf29036ea22cc61f7d70965ec57a8d2..ecdcf0e832ac7753f2e1bea4914540ac413dc9fe 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TargetTool.exe and b/BaseTools/Bin/Win32/TargetTool.exe differ
index 0c76d2d3b2ce99888033c104ee60f30d216c2a5d..ab2c489e37f78f3da2ec711bfd859c92e5b08d77 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TianoCompress.exe and b/BaseTools/Bin/Win32/TianoCompress.exe differ
index 6ad1ce7bf9683ec2279ccbaa337493dd15ac01c7..50c4f76d11b94215344fa4f2abbfcf44332032b7 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Trim.exe and b/BaseTools/Bin/Win32/Trim.exe differ
index 2c4c1d7e547b23b6b2e3cd30c484b9f36f175a5f..a7ff7847470547c3dc421a749842425b4b713c82 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VfrCompile.exe and b/BaseTools/Bin/Win32/VfrCompile.exe differ
index 8286eadfa1f88f1f245711be48bc409dc696cad7..ff96ca3ae569f501c2ea0b7f9b8170f59b659b88 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VolInfo.exe and b/BaseTools/Bin/Win32/VolInfo.exe differ
index 8023eacb8d6b7564a432430526aea37e72cda874..3690e54853dc75ffd3461be70f82dded1fef4cb4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_hashlib.pyd and b/BaseTools/Bin/Win32/_hashlib.pyd differ
index 1255c1b7c083e89f2e14f38c8e18aa15d9aaac27..707853bd33d02bb09d3017125be2d4f4c3757190 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_socket.pyd and b/BaseTools/Bin/Win32/_socket.pyd differ
index ad05f521391e81308befb0829fcfdf13f862e08c..907de8ab4796d183664079ff46cd8f6298427de4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_sqlite3.pyd and b/BaseTools/Bin/Win32/_sqlite3.pyd differ
index 4c1d3b4c456567e86d1df568284cf5ce676ef79a..428b51b008b1dcfdf1eca76b58d7847143e260df 100755 (executable)
Binary files a/BaseTools/Bin/Win32/_ssl.pyd and b/BaseTools/Bin/Win32/_ssl.pyd differ
index f2a949571c81285c3acfc35ea69346cce080b2c4..cde024f0ec81d1f201bbf6e633c91a8dda3560d3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/build.exe and b/BaseTools/Bin/Win32/build.exe differ
index 7b93757919ad3d6c7d4bb33e0e925dec41d33e48..9914173a532d6eefe38b5b93adef7718b924ef16 100755 (executable)
Binary files a/BaseTools/Bin/Win32/pyexpat.pyd and b/BaseTools/Bin/Win32/pyexpat.pyd differ
index 3e971eea3acdd8f3f1ed5dbb6ce4c062e490003e..a116a9bdedd59e6323a16039fded6ef17918fed4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/python25.dll and b/BaseTools/Bin/Win32/python25.dll differ
index 7babc50645f4be441c342a0da2a5ed1ad4364a3d..cc70648a3cad9b88b781d82fdc47659e04b1eadb 100755 (executable)
Binary files a/BaseTools/Bin/Win32/select.pyd and b/BaseTools/Bin/Win32/select.pyd differ
index b7cda67cda4de6e8297b2ba24e050542a5576515..dfb4d382d951be4e28b8e861ac3520b9b0bd59d9 100644 (file)
@@ -2,7 +2,7 @@
 <!--
 Filename: DistributionPackage.xsd
 
-Copyright (c) 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2008, 2011 Intel Corporation. All rights reserved.
 
 This program and the accompanying materials are licensed and made available 
 under the terms and conditions of the BSD License which may be found at 
@@ -13,8 +13,8 @@ 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/2008/1.0"
-       xmlns="http://www.uefi.org/2008/1.0">
+       elementFormDefault="qualified" targetNamespace="http://www.uefi.org/2011/1.1"
+       xmlns="http://www.uefi.org/2011/1.1">
        <xs:element name="DistributionPackage">
                <xs:annotation>
                        <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI
@@ -253,18 +253,29 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                </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.0">
+                               <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.0 </xs:documentation>
+                                               <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:annotation>
                                </xs:element>
                        </xs:sequence>
@@ -1088,7 +1099,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                <xs:annotation>
                                                                        <xs:documentation xml:lang="en-us"> This is only required if
                                                                                the Copyright is different from either the Package or
-                                                                               Distribution copyright. </xs:documentation>
+                                                                               Distribution copyright. Multiple copyright lines are 
+                                                                               permitted within this section. </xs:documentation>
                                                                </xs:annotation>
                                                        </xs:element>
                                                        <xs:element minOccurs="0" maxOccurs="1" name="License"
@@ -1096,7 +1108,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                <xs:annotation>
                                                                        <xs:documentation xml:lang="en-us"> This is only required if
                                                                                the license is different from either the Package or
-                                                                               Distribution license. </xs:documentation>
+                                                                               Distribution license. Multiple licenses are permitted
+                                                                               within this section. </xs:documentation>
                                                                </xs:annotation>
                                                        </xs:element>
                                                        <xs:element minOccurs="0" maxOccurs="1" name="Abstract"
@@ -1226,6 +1239,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                                        <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>
@@ -1265,6 +1279,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                                </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:enumeration>
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -1322,6 +1343,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                                        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:enumeration>
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -1330,6 +1358,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                        <xs:restriction base="xs:NCName">
                                                                                                <xs:enumeration value="EVENT_TYPE_PERIODIC_TIMER" />
                                                                                                <xs:enumeration value="EVENT_TYPE_RELATIVE_TIMER" />
+                                                                                               <xs:enumeration value="UNDEFINED"/>
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
 
@@ -1362,6 +1391,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                <xs:enumeration value="RESOURCE_DESCRIPTOR" />
                                                                                                <xs:enumeration value="FIRMWARE_VOLUME" />
                                                                                                <xs:enumeration value="LOAD_PEIM" />
+                                                                                               <xs:enumeratino value="UNDEFINED" />
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -1393,6 +1423,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                                </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:enumeration>
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -1513,6 +1551,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                <xs:enumeration value="PRODUCES" />
                                                                                                <xs:enumeration value="CONSUMES" />
                                                                                                <xs:enumeration value="SOMETIMES_CONSUMES" />
+                                                <xs:enumeration value="UNDEFINED" />
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -1993,6 +2032,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                                </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:enumeration>
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -2034,6 +2080,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                <xs:enumeration value="SOMETIMES_CONSUMES" />
                                                                                                <xs:enumeration value="TO_START" />
                                                                                                <xs:enumeration value="BY_START" />
+                                                <xs:enumeration value="UNDEFINED" />
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -2072,6 +2119,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                <xs:enumeration value="SOMETIMES_PRODUCES" />
                                                                                                <xs:enumeration value="CONSUMES" />
                                                                                                <xs:enumeration value="SOMETIMES_CONSUMES" />
+                                                <xs:enumeration value="UNDEFINED" />
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
                                                                        </xs:attribute>
@@ -2154,6 +2202,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                                                                <xs:enumeration value="SOMETIMES_PRODUCES" />
                                                                                                <xs:enumeration value="CONSUMES" />
                                                                                                <xs:enumeration value="SOMETIMES_CONSUMES" />
+                                                <xs:enumeration value="UNDEFINED" />
                                                                                        </xs:restriction>
                                                                                </xs:simpleType>
 
@@ -2583,6 +2632,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                        <xs:enumeration value="SystemTable" />
                        <xs:enumeration value="TokenSpaceGuid" />
                        <xs:enumeration value="Variable" />
+            <xs:enumeration value="UNDEFINED" />
                </xs:restriction>
        </xs:simpleType>
 
@@ -2682,12 +2732,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                                applications. </xs:documentation>
                                </xs:annotation>
                        </xs:enumeration>
+                       <xs:enumeration value="SMM_CORE">
+                               <xs:annotation>
+                                       <xs:documentation xml:lang="en-us"> This module is only applicable to the SMM
+                                               core.</xs:documentation>
+                               </xs:annotation>
+                       </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: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:annotation>
+                       </xs:pattern>
                </xs:restriction>
        </xs:simpleType>
 
index 7c765d46b097354a95acc82f8b2fd40dc8f367a8..528bdb985a2a0a5215d78852ef30fd0f58b0de82 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #  Portions copyright (c) 2008 - 2010, Apple Inc. 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
         -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
 \r
     <Command.GCC>\r
-        $(OBJCOPY) --only-keep-debug ${src} $(BIN_DIR)(+)$(MODULE_NAME).debug\r
+        $(OBJCOPY) --only-keep-debug ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug\r
         $(OBJCOPY) --strip-unneeded ${src}\r
-        $(OBJCOPY) --add-gnu-debuglink=$(BIN_DIR)(+)$(MODULE_NAME).debug ${src}\r
+\r
+        #\r
+        #The below 2 lines are only needed for UNIXGCC tool chain, which genereates PE image directly\r
+        #\r
+        -$(OBJCOPY) --add-gnu-debuglink=$(DEBUG_DIR)(+)$(MODULE_NAME).debug ${src}\r
+        -$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug $(BIN_DIR)\r
+\r
         "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)\r
         $(CP) ${dst} $(OUTPUT_DIR)\r
         $(CP) ${dst} $(BIN_DIR)\r
index f54d507783a81b343c8d2d01217fbd793658e15c..495f55de74f6027bfcdf25ef50a5b212f441ca75 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
@@ -154,11 +154,11 @@ DEFINE DEFAULT_WIN_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
 \r
 DEFINE MSFT_ASLPP_FLAGS        = /nologo /E /C /FIAutoGen.h\r
 DEFINE MSFT_ASLCC_FLAGS        = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable\r
-DEFINE MSFT_ASLDLINK_FLAGS     = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER\r
+DEFINE MSFT_ASLDLINK_FLAGS     = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE\r
 \r
 DEFINE ICC_WIN_ASLPP_FLAGS     = /nologo /E /C /FIAutoGen.h\r
 DEFINE ICC_WIN_ASLCC_FLAGS     = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable\r
-DEFINE ICC_WIN_ASLDLINK_FLAGS  = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /NODEFAULTLIB:libmmt /NODEFAULTLIB:libirc\r
+DEFINE ICC_WIN_ASLDLINK_FLAGS  = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libmmt /NODEFAULTLIB:libirc\r
 \r
 DEFINE IPHONE_TOOLS            = /Developer/Platforms/iPhoneOS.platform/Developer\r
 DEFINE RVCT31_TOOLS_PATH       = c:/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium\r
@@ -167,6 +167,11 @@ DEFINE RVCT31CYGWIN_TOOLS_PATH = /cygdrive/c/Program Files/ARM/RVCT/Programs/3.1
 DEFINE SOURCERY_TOOLS        = c:/Program Files/CodeSourcery/Sourcery G++ Lite/bin\r
 DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin\r
 \r
+#\r
+# Change to the location clang was built\r
+#\r
+DEFINE CLANG_BIN = /usr/bin/\r
+\r
 ####################################################################################\r
 #\r
 # format: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE = <string>\r
@@ -1598,10 +1603,10 @@ DEFINE GCC_IPF_RC_FLAGS            = -I binary -O elf64-ia64-little -B ia64 --re
 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
 DEFINE GCC44_X64_CC_FLAGS            = DEF(GCC44_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large\r
-DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections\r
+DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.4-ld-script\r
 DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) --entry ReferenceAcpiTable -u ReferenceAcpiTable\r
 DEFINE GCC44_IA32_X64_DLINK_FLAGS    = DEF(GCC44_IA32_X64_DLINK_COMMON) --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
-DEFINE GCC44_X64_DLINK_FLAGS         = DEF(GCC44_IA32_X64_DLINK_FLAGS)  -melf_x86_64 --oformat=elf64-x86-64 --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.4-ld-script\r
+DEFINE GCC44_X64_DLINK_FLAGS         = DEF(GCC44_IA32_X64_DLINK_FLAGS)  -melf_x86_64 --oformat=elf64-x86-64\r
 DEFINE GCC44_ASM_FLAGS               = DEF(GCC_ASM_FLAGS)\r
 \r
 DEFINE GCC45_IA32_CC_FLAGS           = DEF(GCC44_IA32_CC_FLAGS)\r
@@ -1720,6 +1725,7 @@ DEFINE GCC45_ASM_FLAGS               = DEF(GCC44_ASM_FLAGS)
 ##################\r
 # GCC44 IA32 definitions\r
 ##################\r
+*_GCC44_IA32_OBJCOPY_PATH         = DEF(GCC44_IA32_PREFIX)objcopy\r
 *_GCC44_IA32_CC_PATH              = DEF(GCC44_IA32_PREFIX)gcc\r
 *_GCC44_IA32_SLINK_PATH           = DEF(GCC44_IA32_PREFIX)ar\r
 *_GCC44_IA32_DLINK_PATH           = DEF(GCC44_IA32_PREFIX)ld\r
@@ -1737,10 +1743,12 @@ DEFINE GCC45_ASM_FLAGS               = DEF(GCC44_ASM_FLAGS)
 *_GCC44_IA32_CC_FLAGS             = DEF(GCC44_IA32_CC_FLAGS) -Os\r
 *_GCC44_IA32_DLINK_FLAGS          = DEF(GCC44_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386\r
 *_GCC44_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)\r
+*_GCC44_IA32_OBJCOPY_FLAGS        = \r
 \r
 ##################\r
 # GCC44 X64 definitions\r
 ##################\r
+*_GCC44_X64_OBJCOPY_PATH         = DEF(GCC44_X64_PREFIX)objcopy\r
 *_GCC44_X64_CC_PATH              = DEF(GCC44_X64_PREFIX)gcc\r
 *_GCC44_X64_SLINK_PATH           = DEF(GCC44_X64_PREFIX)ar\r
 *_GCC44_X64_DLINK_PATH           = DEF(GCC44_X64_PREFIX)ld\r
@@ -1758,7 +1766,7 @@ DEFINE GCC45_ASM_FLAGS               = DEF(GCC44_ASM_FLAGS)
 *_GCC44_X64_CC_FLAGS             = DEF(GCC44_X64_CC_FLAGS)\r
 *_GCC44_X64_DLINK_FLAGS          = DEF(GCC44_X64_DLINK_FLAGS)\r
 *_GCC44_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)\r
-\r
+*_GCC44_X64_OBJCOPY_FLAGS        = \r
 \r
 ####################################################################################\r
 #\r
@@ -1782,6 +1790,7 @@ DEFINE GCC45_ASM_FLAGS               = DEF(GCC44_ASM_FLAGS)
 ##################\r
 # GCC45 IA32 definitions\r
 ##################\r
+*_GCC45_IA32_OBJCOPY_PATH         = DEF(GCC45_IA32_PREFIX)objcopy\r
 *_GCC45_IA32_CC_PATH              = DEF(GCC45_IA32_PREFIX)gcc\r
 *_GCC45_IA32_SLINK_PATH           = DEF(GCC45_IA32_PREFIX)ar\r
 *_GCC45_IA32_DLINK_PATH           = DEF(GCC45_IA32_PREFIX)ld\r
@@ -1799,10 +1808,12 @@ DEFINE GCC45_ASM_FLAGS               = DEF(GCC44_ASM_FLAGS)
 *_GCC45_IA32_CC_FLAGS             = DEF(GCC45_IA32_CC_FLAGS) -Os\r
 *_GCC45_IA32_DLINK_FLAGS          = DEF(GCC45_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386\r
 *_GCC45_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)\r
+*_GCC45_IA32_OBJCOPY_FLAGS        = \r
 \r
 ##################\r
 # GCC45 X64 definitions\r
 ##################\r
+*_GCC45_X64_OBJCOPY_PATH         = DEF(GCC45_X64_PREFIX)objcopy\r
 *_GCC45_X64_CC_PATH              = DEF(GCC45_X64_PREFIX)gcc\r
 *_GCC45_X64_SLINK_PATH           = DEF(GCC45_X64_PREFIX)ar\r
 *_GCC45_X64_DLINK_PATH           = DEF(GCC45_X64_PREFIX)ld\r
@@ -1820,7 +1831,7 @@ DEFINE GCC45_ASM_FLAGS               = DEF(GCC44_ASM_FLAGS)
 *_GCC45_X64_CC_FLAGS             = DEF(GCC45_X64_CC_FLAGS)\r
 *_GCC45_X64_DLINK_FLAGS          = DEF(GCC45_X64_DLINK_FLAGS)\r
 *_GCC45_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)\r
-\r
+*_GCC45_X64_OBJCOPY_FLAGS        = \r
 \r
 ####################################################################################\r
 #\r
@@ -3385,6 +3396,71 @@ RELEASE_XCODE32_ARM_ASM_FLAGS  = $(ARCHASM_FLAGS)
 RELEASE_XCODE32_ARM_CC_FLAGS   = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -Oz    -mabi=aapcs -mapcs -fno-short-enums  -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h  -fno-stack-protector\r
 \r
 \r
+####################################################################################\r
+#\r
+# Clang Support for building on Mac OS X\r
+#\r
+####################################################################################\r
+#   CLANG         - clang that produce Mach-O with EFI x86_64 ABI\r
+*_XCLANG_*_*_FAMILY            = GCC\r
+*_XCLANG_*_*_BUILDRULEFAMILY   = XCODE\r
+\r
+*_XCLANG_*_ASL_PATH          = /usr/bin/iasl\r
+\r
+*_XCLANG_*_MAKE_PATH        = make\r
+*_XCLANG_*_DSYMUTIL_PATH    = /usr/bin/dsymutil\r
+\r
+      *_*_*_MTOC_PATH  = /usr/local/bin/mtoc\r
+\r
+  DEBUG_XCLANG_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll\r
+RELEASE_XCLANG_*_MTOC_FLAGS = -align 0x20\r
+\r
+\r
+*_XCLANG_*_CC_PATH      = DEF(CLANG_BIN)clang\r
+*_XCLANG_*_SLINK_PATH   = libtool\r
+*_XCLANG_*_DLINK_PATH   = ld\r
+*_XCLANG_*_ASM_PATH     = as\r
+*_XCLANG_*_PP_PATH      = DEF(CLANG_BIN)clang\r
+*_XCLANG_*_VFRPP_PATH   = DEF(CLANG_BIN)clang\r
+*_XCLANG_*_ASL_PATH     = iasl\r
+*_XCLANG_*_ASLCC_PATH   = DEF(CLANG_BIN)clang\r
+*_XCLANG_*_ASLPP_PATH   = DEF(CLANG_BIN)clang\r
+*_XCLANG_*_ASLDLINK_PATH  = ld\r
+\r
+####################\r
+# IA-32 definitions\r
+####################\r
+  DEBUG_XCLANG_IA32_DLINK_FLAGS      = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20  -pie -all_load -dead_strip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+RELEASE_XCLANG_IA32_DLINK_FLAGS      = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20  -pie -all_load -dead_strip -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+*_XCLANG_IA32_SLINK_FLAGS      = -static -o\r
+  DEBUG_XCLANG_IA32_ASM_FLAGS  = -arch i386 -g\r
+RELEASE_XCLANG_IA32_ASM_FLAGS  = -arch i386 \r
+\r
+\r
+  DEBUG_XCLANG_IA32_CC_FLAGS   = -arch i386 -c -g -O0  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
+RELEASE_XCLANG_IA32_CC_FLAGS   = -arch i386 -c    -Os  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
+\r
+\r
+##################\r
+# X64 definitions\r
+##################\r
+  DEBUG_XCLANG_X64_DLINK_FLAGS      = -arch x86_64 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20  -pie -all_load -dead_strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+RELEASE_XCLANG_X64_DLINK_FLAGS      = -arch x86_64 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20  -pie -all_load -dead_strip -seg1addr 0x220 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+*_XCLANG_X64_SLINK_FLAGS      = -static -o\r
+  DEBUG_XCLANG_X64_ASM_FLAGS  = -arch x86_64 -g\r
+RELEASE_XCLANG_X64_ASM_FLAGS  = -arch x86_64 \r
+*_XCLANG_*_PP_FLAGS         = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h \r
+*_XCLANG_*_VFRPP_FLAGS      = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h \r
+\r
+\r
+  DEBUG_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c -g -O0  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
+RELEASE_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c    -Os  -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable \r
+*_XCLANG_*_ASLCC_FLAGS      = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic\r
+*_XCLANG_*_ASLDLINK_FLAGS   = -e _main -preload -segalign 0x20  -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
+*_XCLANG_*_ASLPP_FLAGS      = -x c -E \r
+*_XCLANG_*_ASL_FLAGS        =\r
+\r
+\r
 ####################################################################################\r
 #\r
 # ARM Tools\r
@@ -3527,14 +3603,10 @@ RELEASE_ARMGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) -mlittle-endian
 *_ARMGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS)  -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
 \r
 *_ARMGCC_ARM_SLINK_FLAGS =  -rc\r
-*_ARMGCC_ARM_DLINK_FLAGS =  $(ARCHDLINK_FLAGS)  --oformat=elf32-littlearm -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
-#\r
-# Had to remove --emit-relocs to get compile working. Images don't work correctly (linked at 0, no relocations)\r
-# --emit-relocs\r
-#\r
+*_ARMGCC_ARM_DLINK_FLAGS =  $(ARCHDLINK_FLAGS)  --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) -mfpu=fpa -mlittle-endian -g -O2 -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fsigned-char -fshort-wchar -fno-strict-aliasing -ffunction-sections -fdata-sections -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h\r
-RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mfpu=fpa -mlittle-endian    -O2 -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fsigned-char -fshort-wchar -fno-strict-aliasing -ffunction-sections -fdata-sections -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h\r
+  DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g -O0 -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fsigned-char -fshort-wchar -fno-strict-aliasing -ffunction-sections -fdata-sections -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h\r
+RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian    -Os -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fsigned-char -fshort-wchar -fno-strict-aliasing -ffunction-sections -fdata-sections -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h\r
 \r
 #################\r
 # ASM 16 linker defintions\r
@@ -3564,7 +3636,7 @@ RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mfpu=fpa -mlitt
 # Asl Compiler definitions\r
 ##################\r
 *_*_*_ASLCC_FLAGS                  = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable\r
-*_*_*_ASLDLINK_FLAGS               = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER\r
+*_*_*_ASLDLINK_FLAGS               = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE\r
 *_*_*_ASLPP_FLAGS                  = /nologo /EP /C\r
 *_*_*_ASL_FLAGS                    =\r
 \r
index bb5b7d16c36ffcaeb1723ee578ce199c4fed9611..d71dd9ca82ff840a040eed150508ea20fff02f63 100644 (file)
@@ -13,14 +13,11 @@ SECTIONS
     *(\r
       .rodata .rodata.* .gnu.linkonce.r.*\r
       .data .data.* .gnu.linkonce.d.*\r
+      .bss .bss.*\r
+      *COM*\r
     )\r
     . = ALIGN(0x20);\r
   }\r
-  .bss ALIGN(0x20) :\r
-  {\r
-    *(.bss .bss.*)\r
-    . = ALIGN(0x20);\r
-  }\r
   .got ALIGN(0x20) :\r
   {\r
     *(.got .got.*)\r
index 31c6f0fca136103e394c20e3a9c9610208572fa7..fe6b29251b61ba917625fde8a7eacd8904098a24 100644 (file)
@@ -159,6 +159,7 @@ PeCoffLoaderGetEntryPoint (
 \r
 **/\r
 UINT16\r
+EFIAPI\r
 ThumbMovtImmediateAddress (\r
   IN UINT16 *Instruction\r
   );\r
@@ -171,11 +172,41 @@ ThumbMovtImmediateAddress (
 \r
 **/\r
 VOID\r
+EFIAPI\r
 ThumbMovtImmediatePatch (\r
   IN OUT UINT16 *Instruction,\r
   IN     UINT16 Address\r
   );\r
 \r
 \r
+/**\r
+  Pass in a pointer to an ARM MOVW/MOVT instruciton pair and \r
+  return the immediate data encoded in the two` instruction\r
+\r
+  @param  Instructions  Pointer to ARM MOVW/MOVT insturction pair\r
+\r
+  @return Immediate address encoded in the instructions\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ThumbMovwMovtImmediateAddress (\r
+  IN UINT16 *Instructions\r
+  );\r
+\r
+/**\r
+  Update an ARM MOVW/MOVT immediate instruction instruction pair.\r
+\r
+  @param  Instructions  Pointer to ARM MOVW/MOVT instruction pair\r
+  @param  Address       New addres to patch into the instructions\r
+**/\r
+VOID\r
+EFIAPI\r
+ThumbMovwMovtImmediatePatch (\r
+  IN OUT UINT16 *Instructions,\r
+  IN     UINT32 Address\r
+  );\r
+\r
+\r
 \r
 #endif\r
index 5d827cefe42d32727a08f3af645949d6def2572c..2afd441845c4f45d1af191db7f3b3d9096f83c56 100644 (file)
@@ -24,6 +24,8 @@ Revision History
 #include <Common/UefiBaseTypes.h>\r
 #include <IndustryStandard/PeImage.h>\r
 #include "PeCoffLib.h"\r
+#include "CommonLib.h"\r
+\r
 \r
 #define EXT_IMM64(Value, Address, Size, InstPos, ValPos)  \\r
     Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos)\r
@@ -374,6 +376,55 @@ ThumbMovtImmediatePatch (
   *Instruction = (*Instruction & ~0x70ff) | Patch;\r
 }\r
 \r
+/**\r
+  Pass in a pointer to an ARM MOVW/MOVT instruciton pair and \r
+  return the immediate data encoded in the two` instruction\r
+\r
+  @param  Instructions  Pointer to ARM MOVW/MOVT insturction pair\r
+\r
+  @return Immediate address encoded in the instructions\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ThumbMovwMovtImmediateAddress (\r
+  IN UINT16 *Instructions\r
+  )\r
+{\r
+  UINT16  *Word;\r
+  UINT16  *Top;\r
+  \r
+  Word = Instructions;  // MOVW\r
+  Top  = Word + 2;      // MOVT\r
+  \r
+  return (ThumbMovtImmediateAddress (Top) << 16) + ThumbMovtImmediateAddress (Word);\r
+}\r
+\r
+\r
+/**\r
+  Update an ARM MOVW/MOVT immediate instruction instruction pair.\r
+\r
+  @param  Instructions  Pointer to ARM MOVW/MOVT instruction pair\r
+  @param  Address       New addres to patch into the instructions\r
+**/\r
+VOID\r
+EFIAPI\r
+ThumbMovwMovtImmediatePatch (\r
+  IN OUT UINT16 *Instructions,\r
+  IN     UINT32 Address\r
+  )\r
+{\r
+  UINT16  *Word;\r
+  UINT16  *Top;\r
+  \r
+  Word = (UINT16 *)Instructions;  // MOVW\r
+  Top  = Word + 2;                // MOVT\r
+\r
+  ThumbMovtImmediatePatch (Word, (UINT16)(Address & 0xffff));\r
+  ThumbMovtImmediatePatch (Top, (UINT16)(Address >> 16));\r
+}\r
+\r
+\r
 /**\r
   Performs an ARM-based specific relocation fixup and is a no-op on other\r
   instruction sets.\r
@@ -395,38 +446,26 @@ PeCoffLoaderRelocateArmImage (
   )\r
 {\r
   UINT16      *Fixup16;\r
-  UINT16      FixupVal;\r
-  UINT16      *Addend;\r
+  UINT32      FixupVal;\r
 \r
-  Fixup16    = (UINT16 *) Fixup;\r
+  Fixup16   = (UINT16 *) Fixup;\r
 \r
   switch ((**Reloc) >> 12) {\r
-  case EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW:\r
-    FixupVal = ThumbMovtImmediateAddress (Fixup16) + (UINT16)Adjust;\r
-    ThumbMovtImmediatePatch (Fixup16, FixupVal);\r
-\r
-    if (*FixupData != NULL) {\r
-      *FixupData             = ALIGN_POINTER (*FixupData, sizeof (UINT16));\r
-      *(UINT16 *)*FixupData  = *Fixup16;\r
-      *FixupData             = *FixupData + sizeof (UINT16);\r
-    }\r
-    break;\r
-\r
-  case EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT:\r
-    // For MOVT you need to know the lower 16-bits do do the math\r
-    // So this relocation entry is really two entries.\r
-    *Reloc = *Reloc + 1;\r
-    Addend = *Reloc; \r
-    FixupVal = (UINT16)(((ThumbMovtImmediateAddress (Fixup16) << 16) + Adjust + *Addend) >> 16);\r
-    ThumbMovtImmediatePatch (Fixup16, FixupVal);\r
-\r
+  \r
+  case EFI_IMAGE_REL_BASED_ARM_MOV32T:\r
+    FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;\r
+    ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);\r
+    \r
+    \r
     if (*FixupData != NULL) {\r
-      *FixupData             = ALIGN_POINTER (*FixupData, sizeof (UINT16));\r
-      *(UINT16 *)*FixupData  = *Fixup16;\r
-      *FixupData             = *FixupData + sizeof (UINT16);\r
+      *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
+      *(UINT64 *)(*FixupData) = *Fixup16;\r
+      CopyMem (*FixupData, Fixup16, sizeof (UINT64));\r
     }\r
     break;\r
   \r
+  case EFI_IMAGE_REL_BASED_ARM_MOV32A:\r
+     // break omitted - ARM instruction encoding not implemented\r
   default:\r
     return RETURN_UNSUPPORTED;\r
   }\r
index 539fdf560a4a37afbef509375c85703f539036a4..42ae35bfef27a0553a65dbcbac4443a24d204957 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, 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
@@ -263,6 +263,7 @@ ScanSections32 (
   EFI_IMAGE_DOS_HEADER            *DosHdr;
   EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
   UINT32                          CoffEntry;
+  UINT32                          SectionCount;
 
   CoffEntry = 0;
   mCoffOffset = 0;
@@ -291,6 +292,7 @@ ScanSections32 (
   //
   mCoffOffset = CoffAlign(mCoffOffset);
   mTextOffset = mCoffOffset;
+  SectionCount = 0;
   for (i = 0; i < mEhdr->e_shnum; i++) {
     Elf_Shdr *shdr = GetShdrByIndex(i);
     if (IsTextShdr(shdr)) {
@@ -315,6 +317,7 @@ ScanSections32 (
       }
       mCoffSectionsOffset[i] = mCoffOffset;
       mCoffOffset += shdr->sh_size;
+      SectionCount ++;
     }
   }
 
@@ -322,10 +325,15 @@ ScanSections32 (
     mCoffOffset = CoffAlign(mCoffOffset);
   }
 
+  if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
+    Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text section. Source level debug might not work correctly.", mInImageName);
+  }
+
   //
   //  Then data sections.
   //
   mDataOffset = mCoffOffset;
+  SectionCount = 0;
   for (i = 0; i < mEhdr->e_shnum; i++) {
     Elf_Shdr *shdr = GetShdrByIndex(i);
     if (IsDataShdr(shdr)) {
@@ -344,10 +352,15 @@ ScanSections32 (
       }
       mCoffSectionsOffset[i] = mCoffOffset;
       mCoffOffset += shdr->sh_size;
+      SectionCount ++;
     }
   }
   mCoffOffset = CoffAlign(mCoffOffset);
 
+  if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
+    Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName);
+  }
+
   //
   //  The HII resource sections.
   //
@@ -650,18 +663,18 @@ WriteSections32 (
           case R_ARM_THM_ALU_PREL_11_0:
           case R_ARM_THM_PC12:
           case R_ARM_REL32_NOI:
-          case R_ARM_ALU_PC_G0_NC:\r
-          case R_ARM_ALU_PC_G0:\r
-          case R_ARM_ALU_PC_G1_NC:\r
-          case R_ARM_ALU_PC_G1:\r
-          case R_ARM_ALU_PC_G2:\r
-          case R_ARM_LDR_PC_G1:\r
-          case R_ARM_LDR_PC_G2:\r
-          case R_ARM_LDRS_PC_G0:\r
-          case R_ARM_LDRS_PC_G1:\r
-          case R_ARM_LDRS_PC_G2:\r
-          case R_ARM_LDC_PC_G0:\r
-          case R_ARM_LDC_PC_G1:\r
+          case R_ARM_ALU_PC_G0_NC:
+          case R_ARM_ALU_PC_G0:
+          case R_ARM_ALU_PC_G1_NC:
+          case R_ARM_ALU_PC_G1:
+          case R_ARM_ALU_PC_G2:
+          case R_ARM_LDR_PC_G1:
+          case R_ARM_LDR_PC_G2:
+          case R_ARM_LDRS_PC_G0:
+          case R_ARM_LDRS_PC_G1:
+          case R_ARM_LDRS_PC_G2:
+          case R_ARM_LDC_PC_G0:
+          case R_ARM_LDC_PC_G1:
           case R_ARM_LDC_PC_G2:
           case R_ARM_GOT_PREL:
           case R_ARM_THM_JUMP11:
@@ -704,6 +717,8 @@ WriteSections32 (
   return TRUE;
 }
 
+UINTN gMovwOffset = 0;
+
 STATIC
 VOID
 WriteRelocations32 (
@@ -786,18 +801,18 @@ WriteRelocations32 (
             case R_ARM_THM_ALU_PREL_11_0:
             case R_ARM_THM_PC12:
             case R_ARM_REL32_NOI:
-            case R_ARM_ALU_PC_G0_NC:\r
-            case R_ARM_ALU_PC_G0:\r
-            case R_ARM_ALU_PC_G1_NC:\r
-            case R_ARM_ALU_PC_G1:\r
-            case R_ARM_ALU_PC_G2:\r
-            case R_ARM_LDR_PC_G1:\r
-            case R_ARM_LDR_PC_G2:\r
-            case R_ARM_LDRS_PC_G0:\r
-            case R_ARM_LDRS_PC_G1:\r
-            case R_ARM_LDRS_PC_G2:\r
-            case R_ARM_LDC_PC_G0:\r
-            case R_ARM_LDC_PC_G1:\r
+            case R_ARM_ALU_PC_G0_NC:
+            case R_ARM_ALU_PC_G0:
+            case R_ARM_ALU_PC_G1_NC:
+            case R_ARM_ALU_PC_G1:
+            case R_ARM_ALU_PC_G2:
+            case R_ARM_LDR_PC_G1:
+            case R_ARM_LDR_PC_G2:
+            case R_ARM_LDRS_PC_G0:
+            case R_ARM_LDRS_PC_G1:
+            case R_ARM_LDRS_PC_G2:
+            case R_ARM_LDC_PC_G0:
+            case R_ARM_LDC_PC_G1:
             case R_ARM_LDC_PC_G2:
             case R_ARM_GOT_PREL:
             case R_ARM_THM_JUMP11:
@@ -812,19 +827,18 @@ WriteRelocations32 (
               CoffAddFixup (
                 mCoffSectionsOffset[RelShdr->sh_info]
                 + (Rel->r_offset - SecShdr->sh_addr),
-                EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW
+                EFI_IMAGE_REL_BASED_ARM_MOV32T
                 );
+
+              // PE/COFF treats MOVW/MOVT relocation as single 64-bit instruction
+              // Track this address so we can log an error for unsupported sequence of MOVW/MOVT
+              gMovwOffset = mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr);
               break;
 
             case R_ARM_THM_MOVT_ABS:
-              CoffAddFixup (
-                mCoffSectionsOffset[RelShdr->sh_info]
-                + (Rel->r_offset - SecShdr->sh_addr),
-                EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT
-                );
-
-              // The relocation entry needs to contain the lower 16-bits so we can do math
-              CoffAddFixupEntry ((UINT16)(Sym->st_value - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]));
+              if ((gMovwOffset + 4) !=  (mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr))) {
+                Error (NULL, 0, 3000, "Not Supported", "PE/COFF requires MOVW+MOVT instruction sequence %x +4 != %x.", gMovwOffset, mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr));
+              }
               break;
 
             case R_ARM_ABS32:
index 7c2e87e68b08217d51997c5b7f826a635818c87c..fbe6ff8232e13c81239e18a3effdfb932566c82b 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, 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
@@ -256,6 +256,7 @@ ScanSections64 (
   EFI_IMAGE_DOS_HEADER            *DosHdr;
   EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
   UINT32                          CoffEntry;
+  UINT32                          SectionCount;
 
   CoffEntry = 0;
   mCoffOffset = 0;
@@ -284,6 +285,7 @@ ScanSections64 (
   //
   mCoffOffset = CoffAlign(mCoffOffset);
   mTextOffset = mCoffOffset;
+  SectionCount = 0;
   for (i = 0; i < mEhdr->e_shnum; i++) {
     Elf_Shdr *shdr = GetShdrByIndex(i);
     if (IsTextShdr(shdr)) {
@@ -308,6 +310,7 @@ ScanSections64 (
       }
       mCoffSectionsOffset[i] = mCoffOffset;
       mCoffOffset += (UINT32) shdr->sh_size;
+      SectionCount ++;
     }
   }
 
@@ -315,10 +318,15 @@ ScanSections64 (
     mCoffOffset = CoffAlign(mCoffOffset);
   }
 
+  if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
+    Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text section. Source level debug might not work correctly.", mInImageName);
+  }
+
   //
   //  Then data sections.
   //
   mDataOffset = mCoffOffset;
+  SectionCount = 0;
   for (i = 0; i < mEhdr->e_shnum; i++) {
     Elf_Shdr *shdr = GetShdrByIndex(i);
     if (IsDataShdr(shdr)) {
@@ -337,10 +345,15 @@ ScanSections64 (
       }
       mCoffSectionsOffset[i] = mCoffOffset;
       mCoffOffset += (UINT32) shdr->sh_size;
+      SectionCount ++;
     }
   }
   mCoffOffset = CoffAlign(mCoffOffset);
 
+  if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
+    Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName);
+  }
+
   //
   //  The HII resource sections.
   //
index 135fa90fa03b2a27da80e93aa15818824e9d36c0..e573554d03ab083fec3d67dafdf455780d4cc297 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, 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 
@@ -170,7 +170,7 @@ ConvertElf (
   //
   // Determine ELF type and set function table pointer correctly.
   //
-  VerboseMsg ("Check Efl Image Header");
+  VerboseMsg ("Check Elf Image Header");
   EiClass = (*FileBuffer)[EI_CLASS];
   if (EiClass == ELFCLASS32) {
     if (!InitializeElf32 (*FileBuffer, &ElfFunctions)) {
index edd9d529580fb4d76fbd4a0013d2f768170d56e9..185dbb759c32cb7f0cd53617849b9a4801128a49 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, 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 
@@ -27,6 +27,7 @@ extern CHAR8  *mInImageName;
 extern UINT32 mImageTimeStamp;
 extern UINT8  *mCoffFile;
 extern UINT32 mTableOffset;
+extern UINT32 mOutImageType;
 
 //
 // Common EFI specific data.
index e41fe6e82ba78091124d654f7ad1d6ba104f822b..90ba2511022ba9fd1853fb1a59b35beb9f9afb69 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -62,25 +62,6 @@ Abstract:
 \r
 #define HII_RESOURCE_SECTION_INDEX  1\r
 #define HII_RESOURCE_SECTION_NAME   "HII"\r
-//\r
-// Action for this tool.\r
-//\r
-#define FW_DUMMY_IMAGE                0\r
-#define FW_EFI_IMAGE                  1\r
-#define FW_TE_IMAGE                   2\r
-#define FW_ACPI_IMAGE                 3\r
-#define FW_BIN_IMAGE                  4\r
-#define FW_ZERO_DEBUG_IMAGE           5\r
-#define FW_SET_STAMP_IMAGE            6\r
-#define FW_MCI_IMAGE                  7\r
-#define FW_MERGE_IMAGE                8\r
-#define FW_RELOC_STRIPEED_IMAGE       9\r
-#define FW_HII_PACKAGE_LIST_RCIMAGE   10\r
-#define FW_HII_PACKAGE_LIST_BINIMAGE  11\r
-#define FW_REBASE_IMAGE               12\r
-#define FW_SET_ADDRESS_IMAGE          13\r
-\r
-#define DUMP_TE_HEADER  0x11\r
 \r
 #define DEFAULT_MC_PAD_BYTE_VALUE  0xFF\r
 #define DEFAULT_MC_ALIGNMENT       16\r
@@ -121,6 +102,7 @@ static const char *gHiiPackageRCFileHeader[] = {
 CHAR8  *mInImageName;\r
 UINT32 mImageTimeStamp = 0;\r
 UINT32 mImageSize = 0;\r
+UINT32 mOutImageType = FW_DUMMY_IMAGE;\r
 \r
 \r
 STATIC\r
@@ -1080,7 +1062,6 @@ Returns:
   char                             *OutImageName;\r
   char                             *ModuleType;\r
   CHAR8                            *TimeStamp;\r
-  UINT32                           OutImageType;\r
   FILE                             *fpIn;\r
   FILE                             *fpOut;\r
   FILE                             *fpInOut;\r
@@ -1147,7 +1128,6 @@ Returns:
   mInImageName      = NULL;\r
   OutImageName      = NULL;\r
   ModuleType        = NULL;\r
-  OutImageType      = FW_DUMMY_IMAGE;\r
   Type              = 0;\r
   Status            = STATUS_SUCCESS;\r
   FileBuffer        = NULL;\r
@@ -1221,8 +1201,8 @@ Returns:
         goto Finish;\r
       }\r
       ModuleType = argv[1];\r
-      if (OutImageType != FW_TE_IMAGE) {\r
-        OutImageType = FW_EFI_IMAGE;\r
+      if (mOutImageType != FW_TE_IMAGE) {\r
+        mOutImageType = FW_EFI_IMAGE;\r
       }\r
       argc -= 2;\r
       argv += 2;\r
@@ -1230,49 +1210,49 @@ Returns:
     }\r
 \r
     if ((stricmp (argv[0], "-l") == 0) || (stricmp (argv[0], "--stripped") == 0)) {\r
-      OutImageType = FW_RELOC_STRIPEED_IMAGE;\r
+      mOutImageType = FW_RELOC_STRIPEED_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-c") == 0) || (stricmp (argv[0], "--acpi") == 0)) {\r
-      OutImageType = FW_ACPI_IMAGE;\r
+      mOutImageType = FW_ACPI_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--terse") == 0)) {\r
-      OutImageType = FW_TE_IMAGE;\r
+      mOutImageType = FW_TE_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-u") == 0) || (stricmp (argv[0], "--dump") == 0)) {\r
-      OutImageType = DUMP_TE_HEADER;\r
+      mOutImageType = DUMP_TE_HEADER;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-b") == 0) || (stricmp (argv[0], "--exe2bin") == 0)) {\r
-      OutImageType = FW_BIN_IMAGE;\r
+      mOutImageType = FW_BIN_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-z") == 0) || (stricmp (argv[0], "--zero") == 0)) {\r
-      OutImageType = FW_ZERO_DEBUG_IMAGE;\r
+      mOutImageType = FW_ZERO_DEBUG_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--stamp") == 0)) {\r
-      OutImageType = FW_SET_STAMP_IMAGE;\r
+      mOutImageType = FW_SET_STAMP_IMAGE;\r
       if (argv[1] == NULL || argv[1][0] == '-') {\r
         Error (NULL, 0, 1003, "Invalid option value", "time stamp is missing for -s option");\r
         goto Finish;\r
@@ -1305,14 +1285,14 @@ Returns:
     }\r
 \r
     if ((stricmp (argv[0], "-m") == 0) || (stricmp (argv[0], "--mcifile") == 0)) {\r
-      OutImageType = FW_MCI_IMAGE;\r
+      mOutImageType = FW_MCI_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-j") == 0) || (stricmp (argv[0], "--join") == 0)) {\r
-      OutImageType = FW_MERGE_IMAGE;\r
+      mOutImageType = FW_MERGE_IMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
@@ -1341,7 +1321,7 @@ Returns:
         Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);\r
         goto Finish;\r
       }\r
-      OutImageType = FW_REBASE_IMAGE;\r
+      mOutImageType = FW_REBASE_IMAGE;\r
       NewBaseAddress = (UINT64) Temp64;\r
       argc -= 2;\r
       argv += 2;\r
@@ -1360,7 +1340,7 @@ Returns:
         Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);\r
         goto Finish;\r
       }\r
-      OutImageType = FW_SET_ADDRESS_IMAGE;\r
+      mOutImageType = FW_SET_ADDRESS_IMAGE;\r
       NewBaseAddress = (UINT64) Temp64;\r
       argc -= 2;\r
       argv += 2;\r
@@ -1423,14 +1403,14 @@ Returns:
     }\r
 \r
     if (stricmp (argv[0], "--hiipackage") == 0) {\r
-      OutImageType = FW_HII_PACKAGE_LIST_RCIMAGE;\r
+      mOutImageType = FW_HII_PACKAGE_LIST_RCIMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
     }\r
 \r
     if (stricmp (argv[0], "--hiibinpackage") == 0) {\r
-      OutImageType = FW_HII_PACKAGE_LIST_BINIMAGE;\r
+      mOutImageType = FW_HII_PACKAGE_LIST_BINIMAGE;\r
       argc --;\r
       argv ++;\r
       continue;\r
@@ -1475,7 +1455,7 @@ Returns:
 \r
   VerboseMsg ("%s tool start.", UTILITY_NAME);\r
 \r
-  if (OutImageType == FW_DUMMY_IMAGE) {\r
+  if (mOutImageType == FW_DUMMY_IMAGE) {\r
     Error (NULL, 0, 1001, "Missing option", "No create file action specified; pls specify -e, -c or -t option to create efi image, or acpi table or TeImage!");\r
     if (ReplaceFlag) {\r
       Error (NULL, 0, 1001, "Missing option", "-r option is not supported as the independent option. It can be used together with other create file option specified at the above.");\r
@@ -1494,7 +1474,7 @@ Returns:
   //\r
   // Combine MciBinary files to one file\r
   //\r
-  if ((OutImageType == FW_MERGE_IMAGE) && ReplaceFlag) {\r
+  if ((mOutImageType == FW_MERGE_IMAGE) && ReplaceFlag) {\r
     Error (NULL, 0, 1002, "Conflicting option", "-r replace option cannot be used with -j merge files option.");\r
     goto Finish;\r
   }\r
@@ -1502,12 +1482,12 @@ Returns:
   //\r
   // Combine HiiBinary packages to a single package list\r
   //\r
-  if ((OutImageType == FW_HII_PACKAGE_LIST_RCIMAGE) && ReplaceFlag) {\r
+  if ((mOutImageType == FW_HII_PACKAGE_LIST_RCIMAGE) && ReplaceFlag) {\r
     Error (NULL, 0, 1002, "Conflicting option", "-r replace option cannot be used with --hiipackage merge files option.");\r
     goto Finish;\r
   }\r
 \r
-  if ((OutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) && ReplaceFlag) {\r
+  if ((mOutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) && ReplaceFlag) {\r
     Error (NULL, 0, 1002, "Conflicting option", "-r replace option cannot be used with --hiibinpackage merge files option.");\r
     goto Finish;\r
   }\r
@@ -1521,7 +1501,7 @@ Returns:
   //\r
   // Action will be taken for the input file.\r
   //\r
-  switch (OutImageType) {\r
+  switch (mOutImageType) {\r
   case FW_EFI_IMAGE:\r
     VerboseMsg ("Create efi image on module type %s based on the input PE image.", ModuleType);\r
     break;\r
@@ -1599,7 +1579,7 @@ Returns:
       fpOut = NULL;\r
     }\r
     VerboseMsg ("Output file name is %s", OutImageName);\r
-  } else if (!ReplaceFlag && OutImageType != DUMP_TE_HEADER) {\r
+  } else if (!ReplaceFlag && mOutImageType != DUMP_TE_HEADER) {\r
     Error (NULL, 0, 1001, "Missing option", "output file");\r
     goto Finish;\r
   }\r
@@ -1634,7 +1614,7 @@ Returns:
   //\r
   // Combine multi binary HII package files.\r
   //\r
-  if (OutImageType == FW_HII_PACKAGE_LIST_RCIMAGE || OutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) {\r
+  if (mOutImageType == FW_HII_PACKAGE_LIST_RCIMAGE || mOutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) {\r
     //\r
     // Open output file handle.\r
     //\r
@@ -1711,7 +1691,7 @@ Returns:
     //\r
     // write the hii package into the binary package list file with the resource section header\r
     //\r
-    if (OutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) {\r
+    if (mOutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) {\r
       //\r
       // Create the resource section header\r
       //\r
@@ -1735,7 +1715,7 @@ Returns:
     //\r
     // write the hii package into the text package list rc file.\r
     //\r
-    if (OutImageType == FW_HII_PACKAGE_LIST_RCIMAGE) {\r
+    if (mOutImageType == FW_HII_PACKAGE_LIST_RCIMAGE) {\r
       for (Index = 0; gHiiPackageRCFileHeader[Index] != NULL; Index++) {\r
         fprintf (fpOut, "%s\n", gHiiPackageRCFileHeader[Index]);\r
       }\r
@@ -1770,7 +1750,7 @@ Returns:
   //\r
   // Combine MciBinary files to one file\r
   //\r
-  if (OutImageType == FW_MERGE_IMAGE) {\r
+  if (mOutImageType == FW_MERGE_IMAGE) {\r
     //\r
     // Open output file handle.\r
     //\r
@@ -1821,7 +1801,7 @@ Returns:
   //\r
   // Convert MicroCode.txt file to MicroCode.bin file\r
   //\r
-  if (OutImageType == FW_MCI_IMAGE) {\r
+  if (mOutImageType == FW_MCI_IMAGE) {\r
     fpIn = fopen (mInImageName, "r");\r
     if (fpIn == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", mInImageName);\r
@@ -1935,7 +1915,7 @@ Returns:
   //\r
   // Dump TeImage Header into output file.\r
   //\r
-  if (OutImageType == DUMP_TE_HEADER) {\r
+  if (mOutImageType == DUMP_TE_HEADER) {\r
     memcpy (&TEImageHeader, FileBuffer, sizeof (TEImageHeader));\r
     if (TEImageHeader.Signature != EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
       Error (NULL, 0, 3000, "Invalid", "TE header signature of file %s is not correct.", mInImageName);\r
@@ -1994,12 +1974,12 @@ Returns:
   // Following code to convert dll to efi image or te image.\r
   // Get new image type\r
   //\r
-  if ((OutImageType == FW_EFI_IMAGE) || (OutImageType == FW_TE_IMAGE)) {\r
+  if ((mOutImageType == FW_EFI_IMAGE) || (mOutImageType == FW_TE_IMAGE)) {\r
     if (ModuleType == NULL) {\r
-      if (OutImageType == FW_EFI_IMAGE) {\r
+      if (mOutImageType == FW_EFI_IMAGE) {\r
         Error (NULL, 0, 1001, "Missing option", "EFI_FILETYPE");\r
         goto Finish;\r
-      } else if (OutImageType == FW_TE_IMAGE) {\r
+      } else if (mOutImageType == FW_TE_IMAGE) {\r
         //\r
         // Default TE Image Type is Boot service driver\r
         //\r
@@ -2047,7 +2027,7 @@ Returns:
   }\r
 \r
   //\r
-  // Convert EFL image to PeImage\r
+  // Convert ELF image to PeImage\r
   //\r
   if (IsElfHeader(FileBuffer)) {\r
     VerboseMsg ("Convert %s from ELF to PE/COFF.", mInImageName);\r
@@ -2066,7 +2046,7 @@ Returns:
   //\r
   // Remove reloc section from PE or TE image\r
   //\r
-  if (OutImageType == FW_RELOC_STRIPEED_IMAGE) {\r
+  if (mOutImageType == FW_RELOC_STRIPEED_IMAGE) {\r
     //\r
     // Check TeImage\r
     //\r
@@ -2184,7 +2164,7 @@ Returns:
   //\r
   // Set new base address into image\r
   //\r
-  if (OutImageType == FW_REBASE_IMAGE || OutImageType == FW_SET_ADDRESS_IMAGE) {\r
+  if (mOutImageType == FW_REBASE_IMAGE || mOutImageType == FW_SET_ADDRESS_IMAGE) {\r
     if ((PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) && (PeHdr->Pe32.FileHeader.Machine != IMAGE_FILE_MACHINE_IA64)) {\r
       if (NewBaseAddress >= 0x100000000ULL) {\r
         Error (NULL, 0, 3000, "Invalid", "New base address is larger than 4G for 32bit PE image");\r
@@ -2198,7 +2178,7 @@ Returns:
       //\r
       NewBaseAddress = (UINT64) (0 - NewBaseAddress);\r
     }\r
-    if (OutImageType == FW_REBASE_IMAGE) {\r
+    if (mOutImageType == FW_REBASE_IMAGE) {\r
       Status = RebaseImage (mInImageName, FileBuffer, NewBaseAddress);\r
     } else {\r
       Status = SetAddressToSectionHeader (mInImageName, FileBuffer, NewBaseAddress);\r
@@ -2221,7 +2201,7 @@ Returns:
   //\r
   // Extract bin data from Pe image.\r
   //\r
-  if (OutImageType == FW_BIN_IMAGE) {\r
+  if (mOutImageType == FW_BIN_IMAGE) {\r
     if (FileLength < PeHdr->Pe32.OptionalHeader.SizeOfHeaders) {\r
       Error (NULL, 0, 3000, "Invalid", "FileSize of %s is not a legal size.", mInImageName);\r
       goto Finish;\r
@@ -2230,7 +2210,7 @@ Returns:
     // Output bin data from exe file\r
     //\r
     FileLength = FileLength - PeHdr->Pe32.OptionalHeader.SizeOfHeaders;\r
-    memcpy (FileBuffer, FileBuffer + PeHdr->Pe32.OptionalHeader.SizeOfHeaders, FileLength);\r
+    memmove (FileBuffer, FileBuffer + PeHdr->Pe32.OptionalHeader.SizeOfHeaders, FileLength);\r
     VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);\r
     goto WriteFile;\r
   }\r
@@ -2238,7 +2218,7 @@ Returns:
   //\r
   // Zero Debug Information of Pe Image\r
   //\r
-  if (OutImageType == FW_ZERO_DEBUG_IMAGE) {\r
+  if (mOutImageType == FW_ZERO_DEBUG_IMAGE) {\r
     Status = ZeroDebugData (FileBuffer, TRUE);\r
     if (EFI_ERROR (Status)) {\r
       Error (NULL, 0, 3000, "Invalid", "Zero DebugData Error status is 0x%x", (int) Status);\r
@@ -2255,7 +2235,7 @@ Returns:
   //\r
   // Set Time Stamp of Pe Image\r
   //\r
-  if (OutImageType == FW_SET_STAMP_IMAGE) {\r
+  if (mOutImageType == FW_SET_STAMP_IMAGE) {\r
     Status = SetStamp (FileBuffer, TimeStamp);\r
     if (EFI_ERROR (Status)) {\r
       goto Finish;\r
@@ -2271,7 +2251,7 @@ Returns:
   //\r
   // Extract acpi data from pe image.\r
   //\r
-  if (OutImageType == FW_ACPI_IMAGE) {\r
+  if (mOutImageType == FW_ACPI_IMAGE) {\r
     SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);\r
     for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {\r
       if (strcmp ((char *)SectionHeader->Name, ".data") == 0 || strcmp ((char *)SectionHeader->Name, ".sdata") == 0) {\r
@@ -2292,7 +2272,7 @@ Returns:
         //\r
         // Output Apci data to file\r
         //\r
-        memcpy (FileBuffer, FileBuffer + SectionHeader->PointerToRawData, FileLength);\r
+        memmove (FileBuffer, FileBuffer + SectionHeader->PointerToRawData, FileLength);\r
         VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);\r
         goto WriteFile;\r
       }\r
@@ -2599,7 +2579,7 @@ Returns:
   //\r
   ZeroDebugData (FileBuffer, FALSE);\r
 \r
-  if (OutImageType == FW_TE_IMAGE) {\r
+  if (mOutImageType == FW_TE_IMAGE) {\r
     if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type &~0xFF)) {\r
       //\r
       // Pack the subsystem and NumberOfSections into 1 byte. Make sure they fit both.\r
@@ -2622,7 +2602,7 @@ Returns:
     // Update Image to TeImage\r
     //\r
     FileLength = FileLength - TEImageHeader.StrippedSize;\r
-    memcpy (FileBuffer + sizeof (EFI_TE_IMAGE_HEADER), FileBuffer + TEImageHeader.StrippedSize, FileLength);\r
+    memmove (FileBuffer + sizeof (EFI_TE_IMAGE_HEADER), FileBuffer + TEImageHeader.StrippedSize, FileLength);\r
     FileLength = FileLength + sizeof (EFI_TE_IMAGE_HEADER);\r
     memcpy (FileBuffer, &TEImageHeader, sizeof (EFI_TE_IMAGE_HEADER));\r
     VerboseMsg ("the size of output file is %u bytes", (unsigned) (FileLength));\r
index 11b3aa941ebbc6250bfd49ccb986373363e82a82..e36dc085ffab4ea78efde078750d6e5ca15bdf88 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, 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 
@@ -15,6 +15,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _GEN_FW_H_
 #define _GEN_FW_H_
 
+//
+// Action for this tool.
+//
+#define FW_DUMMY_IMAGE                0
+#define FW_EFI_IMAGE                  1
+#define FW_TE_IMAGE                   2
+#define FW_ACPI_IMAGE                 3
+#define FW_BIN_IMAGE                  4
+#define FW_ZERO_DEBUG_IMAGE           5
+#define FW_SET_STAMP_IMAGE            6
+#define FW_MCI_IMAGE                  7
+#define FW_MERGE_IMAGE                8
+#define FW_RELOC_STRIPEED_IMAGE       9
+#define FW_HII_PACKAGE_LIST_RCIMAGE   10
+#define FW_HII_PACKAGE_LIST_BINIMAGE  11
+#define FW_REBASE_IMAGE               12
+#define FW_SET_ADDRESS_IMAGE          13
+
+#define DUMP_TE_HEADER  0x11
+
 VOID
 SetHiiResourceHeader (
   UINT8   *HiiBinData,
index f54ee63a83aef0b12d0108ca70f3fa8ec84e426a..8eaf4c3e78a92c911940b0f812d9a123d8cae02d 100644 (file)
@@ -516,8 +516,6 @@ typedef struct {
 #define EFI_IMAGE_REL_BASED_IA64_IMM64    9\r
 #define EFI_IMAGE_REL_BASED_DIR64         10\r
 \r
-#define EFI_IMAGE_REL_BASED_ARM_THUMB_MOVW  11\r
-#define EFI_IMAGE_REL_BASED_ARM_THUMB_MOVT  12\r
 \r
 ///\r
 /// Line number format.\r
index 24ac97789237d2275bc1b4d6e9af13627367e295..5985a7ad5db5017b0a79c0a3c35890c007498de1 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler main class and main function.\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -383,7 +383,7 @@ CVfrCompiler::Usage (
   CONST  CHAR8 *Help[] = {\r
     " ", \r
     "VfrCompile version " VFR_COMPILER_VERSION VFR_COMPILER_UPDATE_TIME,\r
-    "Copyright (c) 2004-2010 Intel Corporation. All rights reserved.",\r
+    "Copyright (c) 2004-2011 Intel Corporation. All rights reserved.",\r
     " ",\r
     "Usage: VfrCompile [options] VfrFile",\r
     " ",\r
index c32325f0b717efbc00e77db66735fa25ae08378e..7525bb5603c992f870c3d7e7cf7b5bd2a91e8c45 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler internal defintions.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define PROGRAM_NAME                       "VfrCompile"\r
 #define VFR_COMPILER_VERSION               " 1.95 (UEFI 2.1)"\r
-#define VFR_COMPILER_UPDATE_TIME           " updated on 2009/05/20"\r
+#define VFR_COMPILER_UPDATE_TIME           " updated on 2011/02/25"\r
 //\r
 // This is how we invoke the C preprocessor on the VFR source file\r
 // to resolve #defines, #includes, etc. To make C source files\r
index 3bfe5d576af2635ef232522418f54588bbfccb50..b0f9197e36334084fa6248900f291b1f942ade4d 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler error handler.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -34,6 +34,7 @@ static SVFR_ERROR_HANDLE VFR_ERROR_HANDLE_TABLE [] = {
   { VFR_RETURN_VARSTOREID_REDEFINED, ": varstore id already defined" },\r
   { VFR_RETURN_UNDEFINED, ": undefined" },\r
   { VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION, ": some variable has not defined by a question"},\r
+  { VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR, ": Data Structure is defined by more than one varstores, it can't be referred as varstore, only varstore name could be used."},\r
   { VFR_RETURN_GET_EFIVARSTORE_ERROR, ": get efi varstore error"},\r
   { VFR_RETURN_EFIVARSTORE_USE_ERROR, ": can not use the efi varstore like this" },\r
   { VFR_RETURN_EFIVARSTORE_SIZE_ERROR, ": unsupport efi varstore size should be <= 8 bytes" },\r
index 29cccabd297e34676d2b1c83a7e2f5b5522ba645..258ae9b8af4ece7548ec23f104d5e601ff74c2be 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler Error definition\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -32,6 +32,7 @@ typedef enum {
   VFR_RETURN_VARSTOREID_REDEFINED,\r
   VFR_RETURN_UNDEFINED,\r
   VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION,\r
+  VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR,\r
   VFR_RETURN_GET_EFIVARSTORE_ERROR,\r
   VFR_RETURN_EFIVARSTORE_USE_ERROR,\r
   VFR_RETURN_EFIVARSTORE_SIZE_ERROR,\r
index 88d3422162f78318f4c356f81de9def9ae9cbbed..4cdd1cc5db55c52dcef4a6455aab1423d06530fc 100644 (file)
@@ -2,7 +2,7 @@
   \r
   The definition of CFormPkg's member function\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -1697,6 +1697,25 @@ public:
   }\r
 };\r
 \r
+class CIfrGuid : public CIfrObj, public CIfrOpHeader {\r
+private:\r
+  EFI_IFR_GUID *mGuid;\r
+\r
+public:\r
+  CIfrGuid (UINT8 Size) : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mGuid, sizeof (EFI_IFR_GUID)+Size),\r
+                  CIfrOpHeader (EFI_IFR_GUID_OP, &mGuid->Header, sizeof (EFI_IFR_GUID)+Size) {\r
+    memset (&mGuid->Guid, 0, sizeof (EFI_GUID));\r
+  }\r
+\r
+  VOID SetGuid (IN EFI_GUID *Guid) {\r
+    memcpy (&mGuid->Guid, Guid, sizeof (EFI_GUID));\r
+  }\r
+\r
+  VOID SetData (IN UINT8* DataBuff, IN UINT8 Size) {\r
+    memcpy ((UINT8 *)mGuid + sizeof (EFI_IFR_GUID), DataBuff, Size);\r
+  }\r
+};\r
+\r
 class CIfrDup : public CIfrObj, public CIfrOpHeader {\r
 private:\r
   EFI_IFR_DUP *mDup;\r
index fc0215134dad408ac7ffb3154c787f3a3623be34..02a7b5c1f4382752f44efb6b64afcd56e0fbcfb8 100644 (file)
@@ -1,5 +1,5 @@
 /*++\r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -233,6 +233,11 @@ VfrParserStart (
 #token Refresh("refresh")                       "refresh"\r
 #token Interval("interval")                     "interval"\r
 #token VarstoreDevice("varstoredevice")         "varstoredevice"\r
+#token GuidOp("guidop")                         "guidop"\r
+#token EndGuidOp("endguidop")                   "endguidop"\r
+#token DataType("datatype")                     "datatype"\r
+#token Data("data")                             "data"\r
+\r
 //\r
 // Define the class and subclass tokens\r
 //\r
@@ -559,10 +564,195 @@ vfrFormSetList :
     vfrStatementVarStoreNameValue |\r
     vfrStatementDefaultStore      |\r
     vfrStatementDisableIfFormSet  |\r
-    vfrStatementSuppressIfFormSet\r
+    vfrStatementSuppressIfFormSet |\r
+    vfrStatementExtension\r
   )*\r
   ;\r
 \r
+vfrStatementExtension:\r
+  << \r
+     EFI_GUID Guid;\r
+     CIfrGuid *GuidObj = NULL;\r
+     CHAR8    *TypeName = NULL;\r
+     UINT32   TypeSize = 0;\r
+     UINT8    *DataBuff = NULL;\r
+     UINT32   Size = 0;\r
+     UINT8    Idx = 0;\r
+     UINT32   LineNum;\r
+     BOOLEAN  IsStruct = FALSE;\r
+     UINT32   ArrayNum = 0;\r
+  >>\r
+  L:GuidOp\r
+  Uuid "=" guidDefinition[Guid]\r
+  {"," DataType "=" \r
+    (\r
+        U64:"UINT64" {OpenBracket AN1:Number CloseBracket <<ArrayNum = _STOU32(AN1->getText());>>}\r
+                                                      << TypeName = U64->getText(); LineNum = U64->getLine(); >>\r
+      | U32:"UINT32" {OpenBracket AN2:Number CloseBracket <<ArrayNum = _STOU32(AN2->getText());>>}\r
+                                                      << TypeName = U32->getText(); LineNum = U32->getLine(); >>\r
+      | U16:"UINT16" {OpenBracket AN3:Number CloseBracket <<ArrayNum = _STOU32(AN3->getText());>>}\r
+                                                      << TypeName = U16->getText(); LineNum = U16->getLine(); >>\r
+      | U8:"UINT8"   {OpenBracket AN4:Number CloseBracket <<ArrayNum = _STOU32(AN4->getText());>>}\r
+                                                      << TypeName = U8->getText(); LineNum = U8->getLine(); >>\r
+      | BL:"BOOLEAN" {OpenBracket AN5:Number CloseBracket <<ArrayNum = _STOU32(AN5->getText());>>}\r
+                                                      << TypeName = BL->getText(); LineNum = BL->getLine(); >>\r
+      | SI:"EFI_STRING_ID" {OpenBracket AN6:Number CloseBracket <<ArrayNum = _STOU32(AN6->getText());>>}\r
+                                                      << TypeName = SI->getText(); LineNum = SI->getLine(); >>\r
+      | D:"EFI_HII_DATE" {OpenBracket AN7:Number CloseBracket <<ArrayNum = _STOU32(AN7->getText());>>}\r
+                                                      << TypeName = D->getText(); LineNum = D->getLine(); IsStruct = TRUE;>>\r
+      | T:"EFI_HII_TIME" {OpenBracket AN8:Number CloseBracket <<ArrayNum = _STOU32(AN8->getText());>>}\r
+                                                      << TypeName = T->getText(); LineNum = T->getLine(); IsStruct = TRUE;>>\r
+      | TN:StringIdentifier {OpenBracket AN9:Number CloseBracket <<ArrayNum = _STOU32(AN9->getText());>>}\r
+                                                      << TypeName = TN->getText(); LineNum = TN->getLine(); IsStruct = TRUE;>>\r
+    )\r
+                                                      <<\r
+                                                        _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &TypeSize), LineNum);\r
+                                                        if (ArrayNum > 0) {\r
+                                                          Size = TypeSize*ArrayNum;\r
+                                                        } else {\r
+                                                          Size = TypeSize;\r
+                                                        }\r
+                                                        if (Size > (128 - sizeof (EFI_IFR_GUID))) return;\r
+                                                        DataBuff = (UINT8 *)malloc(Size);\r
+                                                        for (Idx = 0; Idx < Size; Idx++) {\r
+                                                          DataBuff[Idx] = 0;\r
+                                                        }\r
+                                                      >>\r
+    vfrExtensionData [DataBuff, Size, TypeName, TypeSize, IsStruct, ArrayNum]\r
+  }\r
+                                                      <<\r
+                                                        {\r
+                                                         GuidObj = new CIfrGuid(Size);\r
+                                                         if (GuidObj != NULL) {\r
+                                                           GuidObj->SetLineNo(L->getLine());\r
+                                                           GuidObj->SetGuid (&Guid);\r
+                                                         }\r
+                                                        }\r
+                                                        if (TypeName != NULL) {\r
+                                                          GuidObj->SetData(DataBuff, Size);\r
+                                                        }\r
+                                                      >>\r
+  {","\r
+    (\r
+      vfrStatementExtension\r
+    )*\r
+  E:EndGuidOp                                         << GuidObj->SetScope(1); CRT_END_OP (E); >>\r
+  }\r
+                                                      <<\r
+                                                         if (GuidObj != NULL) delete GuidObj;\r
+                                                         if (DataBuff != NULL) free(DataBuff);\r
+                                                      >>\r
+  ";"\r
+;\r
+\r
+vfrExtensionData[UINT8 *DataBuff, UINT32 Size, CHAR8 *TypeName, UINT32 TypeSize, BOOLEAN IsStruct, UINT32 ArrayNum]:\r
+  <<\r
+     CHAR8    *TFName = NULL;\r
+     UINT32   ArrayIdx = 0;\r
+     UINT16   FieldOffset;\r
+     UINT8    FieldType;\r
+     UINT32   FieldSize;\r
+     UINT64   Data_U64 = 0;\r
+     UINT32   Data_U32 = 0;\r
+     UINT16   Data_U16 = 0;\r
+     UINT8    Data_U8 = 0;\r
+     BOOLEAN  Data_BL = 0;\r
+     EFI_STRING_ID Data_SID = 0;\r
+     BOOLEAN  IsArray = FALSE;\r
+     UINT8    *ByteOffset = NULL;\r
+  >>\r
+(\r
+  ("," "data" {OpenBracket IDX1:Number CloseBracket <<IsArray = TRUE;>>}\r
+          <<\r
+            ArrayIdx = 0;\r
+            if (IsArray == TRUE) {\r
+              ArrayIdx = _STOU8(IDX1->getText());\r
+              if (ArrayIdx >= ArrayNum) return;\r
+              IsArray = FALSE;\r
+            }\r
+            ByteOffset = DataBuff + (ArrayIdx * TypeSize);\r
+            if (IsStruct == TRUE) {\r
+              _STRCAT(&TFName, TypeName);\r
+            }\r
+          >>\r
+    ("." FN:StringIdentifier\r
+          <<\r
+            if (IsStruct == TRUE) {\r
+              _STRCAT(&TFName, ".");\r
+              _STRCAT(&TFName, FN->getText());\r
+            }\r
+          >>\r
+        {\r
+          OpenBracket IDX2:Number CloseBracket\r
+            <<\r
+              if (IsStruct == TRUE) {\r
+                _STRCAT(&TFName, "[");\r
+                _STRCAT(&TFName, IDX2->getText());\r
+                _STRCAT(&TFName, "]");\r
+              }\r
+            >>\r
+        }\r
+    )*\r
+    "=" RD:Number\r
+          <<\r
+            if (IsStruct == FALSE) {\r
+              if (strcmp ("UINT64", TypeName) == 0) {\r
+                Data_U64 = _STOU64(RD->getText());\r
+                memcpy (ByteOffset, &Data_U64, TypeSize);\r
+              }else if (strcmp ("UINT32", TypeName) == 0) {\r
+                Data_U32 = _STOU32(RD->getText());\r
+                memcpy (ByteOffset, &Data_U32, TypeSize);                                                    \r
+              }else if (strcmp ("UINT16", TypeName) == 0) {\r
+                Data_U16 = _STOU16(RD->getText());\r
+                memcpy (ByteOffset, &Data_U16, TypeSize);                                                    \r
+              }else if (strcmp ("UINT8", TypeName) == 0) {\r
+                Data_U8 = _STOU8(RD->getText());\r
+                memcpy (ByteOffset, &Data_U8, TypeSize);                                                    \r
+              }else if (strcmp ("BOOLEAN", TypeName)== 0) {\r
+                Data_BL = _STOU8(RD->getText());\r
+                memcpy (ByteOffset, &Data_BL, TypeSize);                                                    \r
+              }else if (strcmp ("EFI_STRING_ID", TypeName) == 0) {\r
+                Data_SID = _STOSID(RD->getText());\r
+                memcpy (ByteOffset, &Data_SID, TypeSize);                                                    \r
+              }\r
+            } else {\r
+              gCVfrVarDataTypeDB.GetDataFieldInfo(TFName, FieldOffset, FieldType, FieldSize);\r
+              switch (FieldType) {\r
+              case EFI_IFR_TYPE_NUM_SIZE_8:\r
+                 Data_U8 = _STOU8(RD->getText());\r
+                 memcpy (ByteOffset + FieldOffset, &Data_U8, FieldSize);\r
+                 break;\r
+              case EFI_IFR_TYPE_NUM_SIZE_16:\r
+                 Data_U16 = _STOU16(RD->getText());\r
+                 memcpy (ByteOffset + FieldOffset, &Data_U16, FieldSize);\r
+                 break;\r
+              case EFI_IFR_TYPE_NUM_SIZE_32:\r
+                 Data_U32 = _STOU32(RD->getText());\r
+                 memcpy (ByteOffset + FieldOffset, &Data_U32, FieldSize);\r
+                 break;\r
+              case EFI_IFR_TYPE_NUM_SIZE_64:\r
+                 Data_U64 = _STOU64(RD->getText());\r
+                 memcpy (ByteOffset + FieldOffset, &Data_U64, FieldSize);\r
+                 break;\r
+              case EFI_IFR_TYPE_BOOLEAN:\r
+                 Data_BL = _STOU8(RD->getText());\r
+                 memcpy (ByteOffset + FieldOffset, &Data_BL, FieldSize);\r
+                 break;\r
+              case EFI_IFR_TYPE_STRING:\r
+                 Data_SID = _STOSID(RD->getText());\r
+                 memcpy (ByteOffset + FieldOffset, &Data_SID, FieldSize);\r
+                 break;\r
+              default:\r
+                 break;\r
+              }\r
+            }\r
+            if (TFName != NULL) { delete TFName; TFName = NULL; }\r
+          >>\r
+  )*\r
+)\r
+;\r
+\r
+\r
 vfrStatementDefaultStore :\r
   << UINT16  DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD; >>\r
   D:DefaultStore N:StringIdentifier ","\r
@@ -1060,7 +1250,8 @@ vfrFormDefinition :
     vfrStatementLabel                        |\r
     vfrStatementBanner                       |\r
     // Just for framework vfr compatibility\r
-    vfrStatementInvalid\r
+    vfrStatementInvalid                      |\r
+    vfrStatementExtension\r
   )*\r
   E:EndForm                                         <<\r
                                                       if (mCompatibleMode) {\r
@@ -1118,7 +1309,8 @@ vfrFormMapDefinition :
     vfrStatementQuestions                    |\r
     vfrStatementConditional                  |\r
     vfrStatementLabel                        |\r
-    vfrStatementBanner\r
+    vfrStatementBanner                       |\r
+    vfrStatementExtension\r
   )*\r
   E:EndForm                                         << CRT_END_OP (E); >>\r
   ";"\r
@@ -2146,7 +2338,8 @@ vfrStatementQuestionTag :
   vfrStatementNoSubmitIf        |\r
   vfrStatementDisableIfQuest    |\r
   vfrStatementRefresh           |\r
-  vfrStatementVarstoreDevice\r
+  vfrStatementVarstoreDevice    |\r
+  vfrStatementExtension\r
   ;\r
 \r
 vfrStatementQuestionTagList :\r
@@ -2175,6 +2368,7 @@ vfrStatementStatList :
   vfrStatementQuestions                   |\r
   vfrStatementConditionalNew              |\r
   vfrStatementLabel                       |\r
+  vfrStatementExtension                   |\r
   // Just for framework vfr compatibility\r
   vfrStatementInvalid\r
   ;\r
index 3797cd822841d2f5eaa4c78fecdeef6428539be4..b839a0ab0e6a7d8ed98f97b22f5a4275429e3337 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Vfr common library functions.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -622,6 +622,9 @@ CVfrVarDataTypeDB::ExtractFieldNameAndArrary (
     if (*VarStr == ']') {\r
       VarStr++;\r
     }\r
+    if (*VarStr == '.') {\r
+      VarStr++;\r
+    }\r
     return VFR_RETURN_SUCCESS;\r
   case ']':\r
     return VFR_RETURN_DATA_STRING_ERROR;\r
@@ -1456,10 +1459,8 @@ CVfrDataStorage::DeclareNameVarStoreBegin (
     return VFR_RETURN_FATAL_ERROR;\r
   }\r
 \r
-  for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      return VFR_RETURN_REDEFINED;\r
-    }\r
+  if (GetVarStoreId (StoreName, &VarStoreId) == VFR_RETURN_SUCCESS) {\r
+    return VFR_RETURN_REDEFINED;\r
   }\r
 \r
   VarStoreId = GetFreeVarStoreId (EFI_VFR_VARSTORE_NAME);\r
@@ -1531,10 +1532,8 @@ CVfrDataStorage::DeclareEfiVarStore (
     return VFR_RETURN_EFIVARSTORE_SIZE_ERROR;\r
   }\r
 \r
-  for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
-    if (strcmp (pNode->mVarStoreName, StoreName) == 0) {\r
-      return VFR_RETURN_REDEFINED;\r
-    }\r
+  if (GetVarStoreId (StoreName, &VarStoreId) == VFR_RETURN_SUCCESS) {\r
+    return VFR_RETURN_REDEFINED;\r
   }\r
 \r
   VarStoreId = GetFreeVarStoreId (EFI_VFR_VARSTORE_EFI);\r
@@ -1560,11 +1559,16 @@ CVfrDataStorage::DeclareBufferVarStore (
 {\r
   SVfrVarStorageNode   *pNew = NULL;\r
   SVfrDataType         *pDataType = NULL;\r
+  EFI_VARSTORE_ID      TempVarStoreId;\r
 \r
   if ((StoreName == NULL) || (Guid == NULL) || (DataTypeDB == NULL)) {\r
     return VFR_RETURN_FATAL_ERROR;\r
   }\r
 \r
+  if (GetVarStoreId (StoreName, &TempVarStoreId) == VFR_RETURN_SUCCESS) {\r
+    return VFR_RETURN_REDEFINED;\r
+  }\r
+\r
   CHECK_ERROR_RETURN(DataTypeDB->GetDataType (TypeName, &pDataType), VFR_RETURN_SUCCESS);\r
 \r
   if (VarStoreId == EFI_VARSTORE_ID_INVALID) {\r
@@ -1590,12 +1594,51 @@ CVfrDataStorage::DeclareBufferVarStore (
   return VFR_RETURN_SUCCESS;\r
 }\r
 \r
+EFI_VFR_RETURN_CODE \r
+CVfrDataStorage::GetVarStoreByDataType (\r
+  IN  CHAR8              *DataTypeName,\r
+  OUT SVfrVarStorageNode **VarNode\r
+  )\r
+{\r
+  SVfrVarStorageNode    *pNode;\r
+  SVfrVarStorageNode    *MatchNode;\r
+  \r
+  //\r
+  // Framework VFR uses Data type name as varstore name, so don't need check again.\r
+  //\r
+  if (VfrCompatibleMode) {\r
+    return VFR_RETURN_UNDEFINED;\r
+  }\r
+\r
+  MatchNode = NULL;\r
+  for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
+    if (strcmp (pNode->mStorageInfo.mDataType->mTypeName, DataTypeName) == 0) {\r
+      if (MatchNode == NULL) {\r
+        MatchNode = pNode;\r
+      } else {\r
+        //\r
+        // More than one varstores referred the same data structures.\r
+        //\r
+        return VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR;\r
+      }\r
+    }\r
+  }\r
+  \r
+  if (MatchNode == NULL) {\r
+    return VFR_RETURN_UNDEFINED;\r
+  }\r
+\r
+  *VarNode = MatchNode;\r
+  return VFR_RETURN_SUCCESS;\r
+}\r
+\r
 EFI_VFR_RETURN_CODE \r
 CVfrDataStorage::GetVarStoreId (\r
   IN  CHAR8           *StoreName,\r
   OUT EFI_VARSTORE_ID *VarStoreId\r
   )\r
 {\r
+  EFI_VFR_RETURN_CODE   ReturnCode;\r
   SVfrVarStorageNode    *pNode;\r
 \r
   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {\r
@@ -1623,8 +1666,18 @@ CVfrDataStorage::GetVarStoreId (
   }\r
 \r
   mCurrVarStorageNode = NULL;\r
-  *VarStoreId        = EFI_VARSTORE_ID_INVALID;\r
-  return VFR_RETURN_UNDEFINED;\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
+  if (pNode != NULL) {\r
+    mCurrVarStorageNode = pNode;\r
+    *VarStoreId = pNode->mVarStoreId;\r
+  }\r
+  \r
+  return ReturnCode;\r
 }\r
 \r
 EFI_VFR_RETURN_CODE\r
@@ -1634,6 +1687,7 @@ CVfrDataStorage::GetBufferVarStoreDataTypeName (
   )\r
 {\r
   SVfrVarStorageNode    *pNode;\r
+  EFI_VFR_RETURN_CODE   ReturnCode;\r
 \r
   if ((StoreName == NULL) || (DataTypeName == NULL)) {\r
     return VFR_RETURN_FATAL_ERROR;\r
@@ -1645,8 +1699,16 @@ CVfrDataStorage::GetBufferVarStoreDataTypeName (
     }\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
-    return VFR_RETURN_UNDEFINED;\r
+    ReturnCode = GetVarStoreByDataType (StoreName, &pNode);\r
+  }\r
+\r
+  if (pNode == NULL) {\r
+    return ReturnCode;\r
   }\r
 \r
   if (pNode->mStorageInfo.mDataType == NULL) {\r
@@ -1664,6 +1726,7 @@ CVfrDataStorage::GetVarStoreType (
   )\r
 {\r
   SVfrVarStorageNode    *pNode;\r
+  EFI_VFR_RETURN_CODE   ReturnCode;\r
 \r
   if (StoreName == NULL) {\r
     return VFR_RETURN_FATAL_ERROR;\r
@@ -1691,7 +1754,16 @@ CVfrDataStorage::GetVarStoreType (
   }\r
 \r
   VarStoreType = EFI_VFR_VARSTORE_INVALID;\r
-  return VFR_RETURN_UNDEFINED;\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
 }\r
 \r
 EFI_VFR_VARSTORE_TYPE\r
@@ -1841,6 +1913,7 @@ CVfrDataStorage::BufferVarStoreRequestElementAdd (
 {\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
@@ -1848,8 +1921,16 @@ CVfrDataStorage::BufferVarStoreRequestElementAdd (
     }\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
-    return VFR_RETURN_UNDEFINED;\r
+    ReturnCode = GetVarStoreByDataType (StoreName, &pNode);\r
+  }\r
+\r
+  if (pNode == NULL) {\r
+    return ReturnCode;\r
   }\r
 \r
   gCVfrBufferConfig.Open ();\r
index bec5d67b94270857c7758c470bee74ef0970f621..b921115b0a5aeccdc2aca21f2a79152bd05876b1 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Vfr common library functions.\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -307,6 +307,7 @@ public:
   EFI_VFR_RETURN_CODE GetVarStoreType (IN CHAR8 *, OUT EFI_VFR_VARSTORE_TYPE &);\r
   EFI_VFR_VARSTORE_TYPE GetVarStoreType (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
 \r
   EFI_VFR_RETURN_CODE GetBufferVarStoreDataTypeName (IN CHAR8 *, OUT CHAR8 **);\r
   EFI_VFR_RETURN_CODE GetEfiVarStoreInfo (IN EFI_VARSTORE_INFO *);\r
index 4ecf2eafe711f523020373a3436abbeeb9c0d5c3..8090a06bf8c6c6a32075ef9b6f81d89e6a30d0c5 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Generate AutoGen.h, AutoGen.c and *.depex files\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -53,6 +53,39 @@ gAutoGenStringFileName = "%(module_name)sStrDefs.h"
 gAutoGenStringFormFileName = "%(module_name)sStrDefs.hpk"\r
 gAutoGenDepexFileName = "%(module_name)s.depex"\r
 \r
+#\r
+# Template string to generic AsBuilt INF\r
+#\r
+gAsBuiltInfHeaderString = TemplateString("""## @file\r
+# ${module_name}\r
+#\r
+# DO NOT EDIT\r
+# FILE auto-generated Binary INF\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                = 0x00010016\r
+  BASE_NAME                  = ${module_name}\r
+  FILE_GUID                  = ${module_guid}\r
+  MODULE_TYPE                = ${module_module_type}\r
+  VERSION_STRING             = ${module_version_string}${BEGIN}\r
+  UEFI_SPECIFICATION_VERSION = ${module_uefi_specification_version}${END}${BEGIN}\r
+  PI_SPECIFICATION_VERSION   = ${module_pi_specification_version}${END}\r
+\r
+[Packages]${BEGIN}\r
+  ${package_item}${END}\r
+\r
+[Binaries.${module_arch}]${BEGIN}\r
+  ${binary_item}${END}\r
+\r
+[PcdEx]${BEGIN}\r
+  ${pcd_item}${END}\r
+\r
+## @AsBuilt${BEGIN}\r
+##   ${flags_item}${END}\r
+""")\r
+\r
 ## Base class for AutoGen\r
 #\r
 #   This class just implements the cache mechanism of AutoGen objects.\r
@@ -499,6 +532,7 @@ class PlatformAutoGen(AutoGen):
                 Ma = ModuleAutoGen(self.Workspace, ModuleFile, self.BuildTarget,\r
                                    self.ToolChain, self.Arch, self.MetaFile)\r
                 Ma.CreateMakeFile(True)\r
+                Ma.CreateAsBuiltInf()\r
 \r
         # no need to create makefile for the platform more than once\r
         if self.IsMakeFileCreated:\r
@@ -1036,9 +1070,14 @@ class PlatformAutoGen(AutoGen):
         PlatformModule = self.Platform.Modules[str(Module)]\r
 \r
         # add forced library instances (specified under LibraryClasses sections)\r
-        for LibraryClass in self.Platform.LibraryClasses.GetKeys():\r
-            if LibraryClass.startswith("NULL"):\r
-                Module.LibraryClasses[LibraryClass] = self.Platform.LibraryClasses[LibraryClass]\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 self.Platform.LibraryClasses.GetKeys():\r
+                if LibraryClass.startswith("NULL") and self.Platform.LibraryClasses[LibraryClass, Module.ModuleType]:\r
+                    Module.LibraryClasses[LibraryClass] = self.Platform.LibraryClasses[LibraryClass, Module.ModuleType]\r
 \r
         # add forced library instances (specified in module overrides)\r
         for LibraryClass in PlatformModule.LibraryClasses:\r
@@ -1596,6 +1635,8 @@ class ModuleAutoGen(AutoGen):
 \r
         self.IsMakeFileCreated = False\r
         self.IsCodeFileCreated = False\r
+        self.IsAsBuiltInfCreated = False\r
+        self.DepexGenerated = False\r
 \r
         self.BuildDatabase = self.Workspace.BuildDatabase\r
 \r
@@ -1987,6 +2028,9 @@ class ModuleAutoGen(AutoGen):
                 CreateDirectory(Source.Dir)\r
 \r
             if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList:\r
+                # Skip all files that are not binary libraries\r
+                if not self.IsLibrary:\r
+                    continue\r
                 RuleObject = self.BuildRules[TAB_DEFAULT_BINARY_FILE]\r
             elif FileType in self.BuildRules:\r
                 RuleObject = self.BuildRules[FileType]\r
@@ -2214,6 +2258,107 @@ class ModuleAutoGen(AutoGen):
                         self._IncludePathList.append(str(Inc))\r
         return self._IncludePathList\r
 \r
+    ## Create AsBuilt INF file the module\r
+    #\r
+    def CreateAsBuiltInf(self):\r
+        if self.IsAsBuiltInfCreated:\r
+            return\r
+            \r
+        # Skip the following code for EDK I inf\r
+        if self.AutoGenVersion < 0x00010005:\r
+            return\r
+            \r
+        # Skip the following code for libraries\r
+        if self.IsLibrary:\r
+            return\r
+            \r
+        # Skip the following code for modules with no source files\r
+        if self.SourceFileList == None or self.SourceFileList == []:\r
+            return\r
+\r
+        # Skip the following code for modules without any binary files\r
+        if self.BinaryFileList <> None and self.BinaryFileList <> []:\r
+            return\r
+            \r
+        ### TODO: How to handles mixed source and binary modules\r
+\r
+        # Find all DynamicEx PCDs used by this module and dependent libraries\r
+        # Also find all packages that the DynamicEx PCDs depend on\r
+        Pcds = []\r
+        Packages = []        \r
+        for Pcd in self.ModulePcdList + self.LibraryPcdList:\r
+          if Pcd.Type in GenC.gDynamicExPcd:\r
+            if Pcd not in Pcds:\r
+              Pcds += [Pcd]\r
+            for Package in self.DerivedPackageList:\r
+              if Package not in Packages:\r
+                if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, 'DynamicEx') in Package.Pcds:\r
+                  Packages += [Package]\r
+                elif (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, 'Dynamic') in Package.Pcds:\r
+                  Packages += [Package]\r
+\r
+        ModuleType = self.ModuleType\r
+        if ModuleType == 'UEFI_DRIVER' and self.DepexGenerated:\r
+          ModuleType = 'DXE_DRIVER'\r
+\r
+        AsBuiltInfDict = {\r
+          'module_name'                       : self.Name,\r
+          'module_guid'                       : self.Guid,\r
+          'module_module_type'                : ModuleType,\r
+          'module_version_string'             : self.Version,\r
+          'module_uefi_specification_version' : [],\r
+          'module_pi_specification_version'   : [],\r
+          'module_arch'                       : self.Arch,\r
+          'package_item'                      : ['%s' % (Package.MetaFile.File.replace('\\','/')) for Package in Packages],\r
+          'binary_item'                       : [],\r
+          'pcd_item'                          : [],\r
+          'flags_item'                        : []\r
+        }\r
+\r
+        if 'UEFI_SPECIFICATION_VERSION' in self.Specification:\r
+          AsBuiltInfDict['module_uefi_specification_version'] += [self.Specification['UEFI_SPECIFICATION_VERSION']]\r
+        if 'PI_SPECIFICATION_VERSION' in self.Specification:\r
+          AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']]\r
+\r
+        OutputDir = self.OutputDir.replace('\\','/').strip('/')\r
+        if self.ModuleType in ['BASE', 'USER_DEFINED']:\r
+          for Item in self.CodaTargetList:\r
+            File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')\r
+            if Item.Target.Ext.lower() == '.aml': \r
+              AsBuiltInfDict['binary_item'] += ['ASL|' + File]\r
+            elif Item.Target.Ext.lower() == '.acpi': \r
+              AsBuiltInfDict['binary_item'] += ['ACPI|' + File]\r
+            else:\r
+              AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
+        else:\r
+          for Item in self.CodaTargetList:\r
+            File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')\r
+            if Item.Target.Ext.lower() == '.efi': \r
+              AsBuiltInfDict['binary_item'] += ['PE32|' + self.Name + '.efi']\r
+            else:\r
+              AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
+          if self.DepexGenerated:\r
+            if self.ModuleType in ['PEIM']:\r
+              AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']\r
+            if self.ModuleType in ['DXE_DRIVER','DXE_RUNTIME_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:\r
+              AsBuiltInfDict['binary_item'] += ['DXE_DEPEX|' + self.Name + '.depex']\r
+            if self.ModuleType in ['DXE_SMM_DRIVER']:\r
+              AsBuiltInfDict['binary_item'] += ['SMM_DEPEX|' + self.Name + '.depex']\r
+\r
+        for Pcd in Pcds:\r
+          AsBuiltInfDict['pcd_item'] += [Pcd.TokenSpaceGuidCName + '.' + Pcd.TokenCName]\r
+         \r
+        for Item in self.BuildOption:\r
+          if 'FLAGS' in self.BuildOption[Item]:\r
+            AsBuiltInfDict['flags_item'] += ['%s:%s_%s_%s_%s_FLAGS = %s' % (self.ToolChainFamily, self.BuildTarget, self.ToolChain, self.Arch, Item, self.BuildOption[Item]['FLAGS'].strip())]\r
+        \r
+        AsBuiltInf = TemplateString()\r
+        AsBuiltInf.Append(gAsBuiltInfHeaderString.Replace(AsBuiltInfDict))\r
+        \r
+        SaveFileOnChange(os.path.join(self.OutputDir, self.Name + '.inf'), str(AsBuiltInf), False)\r
+        \r
+        self.IsAsBuiltInfCreated = True\r
+        \r
     ## Create makefile for the module and its dependent libraries\r
     #\r
     #   @param      CreateLibraryMakeFile   Flag indicating if or not the makefiles of\r
@@ -2278,6 +2423,9 @@ class ModuleAutoGen(AutoGen):
             Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], ModuleType, True)\r
             DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name}\r
 \r
+            if len(Dpx.PostfixNotation) <> 0:\r
+              self.DepexGenerated = True\r
+\r
             if Dpx.Generate(path.join(self.OutputDir, DpxFile)):\r
                 AutoGenList.append(str(DpxFile))\r
             else:\r
index 3c256c8b74c83a3d0f4070aa9370378bfa7918f9..e6e884762340451ab492d01bbf2328ee4235094d 100644 (file)
@@ -1,7 +1,7 @@
 ## @file
 # Routines for generating AutoGen.h and AutoGen.c
 #
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2011, 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
@@ -1098,6 +1098,10 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
                         ExtraData="[%s]" % str(Info))
     TokenNumber = PcdTokenNumber[TokenCName, TokenSpaceGuidCName]
 
+    # If PCD is DynamicEx, then use TokenNumber declared in DEC file
+    if Pcd.Type in gDynamicExPcd:
+        TokenNumber = int(Pcd.TokenValue, 0)
+
     if Pcd.Type not in gItemTypeStringDatabase:
         EdkLogger.error("build", AUTOGEN_ERROR,
                         "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
@@ -1677,11 +1681,11 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
     if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:
         PiSpecVersion = Info.Module.Specification['PI_SPECIFICATION_VERSION']
     else:
-        PiSpecVersion = 0
+        PiSpecVersion = '0x00000000'
     if 'UEFI_SPECIFICATION_VERSION' in Info.Module.Specification:
         UefiSpecVersion = Info.Module.Specification['UEFI_SPECIFICATION_VERSION']
     else:
-        UefiSpecVersion = 0
+        UefiSpecVersion = '0x00000000'
     Dict = {
         'Function'       :   Info.Module.ModuleEntryPointList,
         'PiSpecVersion'  :   PiSpecVersion,
@@ -1689,14 +1693,15 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
     }
 
     if Info.ModuleType in ['PEI_CORE', 'DXE_CORE', 'SMM_CORE']:
-        if NumEntryPoints != 1:
-            EdkLogger.error(
-                "build",
-                AUTOGEN_ERROR,
-                '%s must have exactly one entry point' % Info.ModuleType,
-                File=str(Info),
-                ExtraData= ", ".join(Info.Module.ModuleEntryPointList)
-                )
+        if Info.SourceFileList <> None and Info.SourceFileList <> []:
+          if NumEntryPoints != 1:
+              EdkLogger.error(
+                  "build",
+                  AUTOGEN_ERROR,
+                  '%s must have exactly one entry point' % Info.ModuleType,
+                  File=str(Info),
+                  ExtraData= ", ".join(Info.Module.ModuleEntryPointList)
+                  )
     if Info.ModuleType == 'PEI_CORE':
         AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))
         AutoGenH.Append(gPeiCoreEntryPointPrototype.Replace(Dict))
@@ -1827,6 +1832,23 @@ def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
 #   @param      AutoGenH    The TemplateString object for header file
 #
 def CreatePcdCode(Info, AutoGenC, AutoGenH):
+
+    # Collect Token Space GUIDs used by DynamicEc PCDs
+    TokenSpaceList = []
+    for Pcd in Info.ModulePcdList:
+       if Pcd.Type in gDynamicExPcd and Pcd.TokenSpaceGuidCName not in TokenSpaceList:
+            TokenSpaceList += [Pcd.TokenSpaceGuidCName]
+            
+    # Add extern declarations to AutoGen.h if one or more Token Space GUIDs were found
+    if TokenSpaceList <> []:            
+        AutoGenH.Append("\n// Definition of PCD Token Space GUIDs used in this module\n\n")
+        if Info.ModuleType in ["USER_DEFINED", "BASE"]:
+            GuidType = "GUID"
+        else:
+            GuidType = "EFI_GUID"              
+        for Item in TokenSpaceList:
+            AutoGenH.Append('extern %s %s;\n' % (GuidType, Item))
+
     if Info.IsLibrary:
         if Info.ModulePcdList:
             AutoGenH.Append("\n// PCD definitions\n")
index 49ac33f47f39084216eb77efba563b3be734acdf..6396c612ad1cf4a1e1a17141c72a4831bd142fe2 100644 (file)
@@ -493,7 +493,7 @@ cleanlib:
 
         # convert source files and binary files to build targets
         self.ResultFileList = [str(T.Target) for T in self._AutoGenObject.CodaTargetList]
-        if len(self.ResultFileList) == 0:
+        if len(self.ResultFileList) == 0 and len(self._AutoGenObject.SourceFileList) <> 0:
             EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build",
                             ExtraData="[%s]" % str(self._AutoGenObject))
 
index 1eb65c1e9a4bd6bf9db105c2ad9411ab19cac233..1825c81d91f5e4148a7945e4a140f4b3d12dbc3d 100644 (file)
@@ -121,7 +121,7 @@ def GetLanguageCode(LangName, IsCompatibleMode, File):
         if length == 3 and LangName.isalpha():\r
             TempLangName = LangConvTable.get(LangName.lower())\r
             if TempLangName != None:\r
-               return TempLangName\r
+                return TempLangName\r
             return LangName\r
         else:\r
             EdkLogger.error("Unicode File Parser", FORMAT_INVALID, "Invalid ISO 639-2 language code : %s" % LangName, File)\r
@@ -298,13 +298,36 @@ class UniFileClassObject(object):
         #\r
         # Use unique identifier\r
         #\r
+        FindFlag = -1\r
+        LineCount = 0\r
         for Line in FileIn:\r
+            Line = FileIn[LineCount]\r
+            LineCount += 1\r
             Line = Line.strip()\r
             #\r
             # Ignore comment line and empty line\r
             #\r
             if Line == u'' or Line.startswith(u'//'):\r
                 continue\r
+            \r
+            #\r
+            # Process comment embeded in string define lines\r
+            #\r
+            FindFlag = Line.find(u'//')\r
+            if FindFlag != -1:\r
+                Line = Line.replace(Line[FindFlag:], u' ')\r
+                if FileIn[LineCount].strip().startswith('#language'):\r
+                    Line = Line + FileIn[LineCount]\r
+                    FileIn[LineCount-1] = Line\r
+                    FileIn[LineCount] = os.linesep\r
+                    LineCount -= 1\r
+                    for Index in xrange (LineCount + 1, len (FileIn) - 1):\r
+                        if (Index == len(FileIn) -1):\r
+                            FileIn[Index] = os.linesep\r
+                        else:\r
+                            FileIn[Index] = FileIn[Index + 1]\r
+                    continue\r
+                              \r
             Line = Line.replace(u'/langdef', u'#langdef')\r
             Line = Line.replace(u'/string', u'#string')\r
             Line = Line.replace(u'/language', u'#language')\r
@@ -566,6 +589,6 @@ class UniFileClassObject(object):
 if __name__ == '__main__':\r
     EdkLogger.Initialize()\r
     EdkLogger.SetLevel(EdkLogger.DEBUG_0)\r
-    a = UniFileClassObject(['C:\\Edk\\Strings.uni', 'C:\\Edk\\Strings2.uni'])\r
+    a = UniFileClassObject([PathClass("C:\\Edk\\Strings.uni"), PathClass("C:\\Edk\\Strings2.uni")])\r
     a.ReToken()\r
     a.ShowMe()\r
index b5cd5ee435ef153c14e4495359ea01c9169506d2..0f49457449cd698d1e972ab38ca5f04d86066204 100644 (file)
@@ -180,8 +180,10 @@ class ToolDefClassObject(object):
         EnvReference = gEnvRefPattern.findall(Value)\r
         for Ref in EnvReference:\r
             if Ref not in self.MacroDictionary:\r
-                return False, Ref\r
-            Value = Value.replace(Ref, self.MacroDictionary[Ref])\r
+                Value = Value.replace(Ref, "")\r
+            else:\r
+                Value = Value.replace(Ref, self.MacroDictionary[Ref])\r
\r
 \r
         MacroReference = gMacroRefPattern.findall(Value)\r
         for Ref in MacroReference:\r
index 52d32a9e98779009ab97e9c1c77399dd822ffaa0..9e7771dc7de8b2c14cb266426c5400ad1130cb90 100644 (file)
@@ -564,7 +564,17 @@ class FdfParser:
 \r
         self.Rewind()\r
 \r
-    \r
+    def __GetIfListCurrentItemStat(self, IfList):\r
+        if len(IfList) == 0:\r
+            return True\r
+        \r
+        for Item in IfList:\r
+            if Item[1] == False:\r
+                return False\r
+        \r
+        return True\r
+                   \r
+\r
     ## PreprocessConditionalStatement() method\r
     #\r
     #   Preprocess conditional statement.\r
@@ -577,27 +587,28 @@ class FdfParser:
         IfList = []\r
         while self.__GetNextToken():\r
             if self.__Token == 'DEFINE':\r
-                DefineLine = self.CurrentLineNumber - 1\r
-                DefineOffset = self.CurrentOffsetWithinLine - len('DEFINE')\r
-                if not self.__GetNextToken():\r
-                    raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)\r
-                Macro = self.__Token\r
-                if not self.__IsToken( "="):\r
-                    raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
-\r
-                if not self.__GetNextToken():\r
-                    raise Warning("expected value", self.FileName, self.CurrentLineNumber)\r
-\r
-                if self.__GetStringData():\r
-                    pass\r
-                Value = self.__Token\r
-                if not Macro in InputMacroDict:\r
-                    FileLineTuple = GetRealFileLine(self.FileName, DefineLine + 1)\r
-                    MacProfile = MacroProfile(FileLineTuple[0], FileLineTuple[1])\r
-                    MacProfile.MacroName = Macro\r
-                    MacProfile.MacroValue = Value\r
-                    AllMacroList.append(MacProfile)\r
-                self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))\r
+                if self.__GetIfListCurrentItemStat(IfList):\r
+                    DefineLine = self.CurrentLineNumber - 1\r
+                    DefineOffset = self.CurrentOffsetWithinLine - len('DEFINE')\r
+                    if not self.__GetNextToken():\r
+                        raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)\r
+                    Macro = self.__Token\r
+                    if not self.__IsToken( "="):\r
+                        raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
+    \r
+                    if not self.__GetNextToken():\r
+                        raise Warning("expected value", self.FileName, self.CurrentLineNumber)\r
+    \r
+                    if self.__GetStringData():\r
+                        pass\r
+                    Value = self.__Token\r
+                    if not Macro in InputMacroDict:\r
+                        FileLineTuple = GetRealFileLine(self.FileName, DefineLine + 1)\r
+                        MacProfile = MacroProfile(FileLineTuple[0], FileLineTuple[1])\r
+                        MacProfile.MacroName = Macro\r
+                        MacProfile.MacroValue = Value\r
+                        AllMacroList.append(MacProfile)\r
+                    self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))\r
 \r
             elif self.__Token in ('!ifdef', '!ifndef', '!if'):\r
                 IfStartPos = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len(self.__Token))\r
index d2397e07da33154a3c4633db7c67d0c7be2691da..2b556135d211543081b74b9ecfb232ef5779ce9e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FFS generation from INF statement\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -18,6 +18,8 @@
 import Rule\r
 import os\r
 import shutil\r
+import StringIO\r
+from struct import *\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import Ffs\r
 import subprocess\r
@@ -50,7 +52,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         self.KeepRelocFromRule = None\r
         self.InDsc = True\r
         self.OptRomDefs = {}\r
-        self.PiSpecVersion = 0\r
+        self.PiSpecVersion = '0x00000000'\r
         \r
     ## __InfParse() method\r
     #\r
@@ -121,7 +123,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         if len(self.SourceFileList) != 0 and not self.InDsc:\r
             EdkLogger.warn("GenFds", GENFDS_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % (self.InfFileName))\r
 \r
-        if self.ModuleType == 'SMM_CORE' and self.PiSpecVersion < 0x0001000A:\r
+        if self.ModuleType == 'SMM_CORE' and int(self.PiSpecVersion, 16) < 0x0001000A:\r
             EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.InfFileName)      \r
 \r
         if Inf._Defs != None and len(Inf._Defs) > 0:\r
@@ -177,13 +179,13 @@ class FfsInfStatement(FfsInfStatementClassObject):
         #\r
         # Convert Fv File Type for PI1.1 SMM driver.\r
         #\r
-        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion >= 0x0001000A:\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) >= 0x0001000A:\r
             if Rule.FvFileType == 'DRIVER':\r
                 Rule.FvFileType = 'SMM'\r
         #\r
         # Framework SMM Driver has no SMM FV file type\r
         #\r
-        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion < 0x0001000A:\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) < 0x0001000A:\r
             if Rule.FvFileType == 'SMM' or Rule.FvFileType == 'SMM_CORE':\r
                 EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM or SMM_CORE FV file type", File=self.InfFileName)\r
         #\r
@@ -409,9 +411,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
         GenSecInputFile = None\r
         if Rule.FileName != None:\r
             GenSecInputFile = self.__ExtendMacro__(Rule.FileName)\r
-            if os.path.isabs(GenSecInputFile):
-                GenSecInputFile = os.path.normpath(GenSecInputFile)
-            else:
+            if os.path.isabs(GenSecInputFile):\r
+                GenSecInputFile = os.path.normpath(GenSecInputFile)\r
+            else:\r
                 GenSecInputFile = os.path.normpath(os.path.join(self.EfiOutputPath, GenSecInputFile))\r
         else:\r
             FileList, IsSect = Section.Section.GetFileList(self, '', Rule.FileExtension)\r
@@ -421,13 +423,13 @@ class FfsInfStatement(FfsInfStatementClassObject):
         #\r
         # Convert Fv Section Type for PI1.1 SMM driver.\r
         #\r
-        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion >= 0x0001000A:\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) >= 0x0001000A:\r
             if SectionType == 'DXE_DEPEX':\r
                 SectionType = 'SMM_DEPEX'\r
         #\r
         # Framework SMM Driver has no SMM_DEPEX section type\r
         #\r
-        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion < 0x0001000A:\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) < 0x0001000A:\r
             if SectionType == 'SMM_DEPEX':\r
                 EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)\r
         NoStrip = True\r
@@ -583,19 +585,20 @@ class FfsInfStatement(FfsInfStatementClassObject):
         SectFiles = []\r
         SectAlignments = []\r
         Index = 1\r
+        HasGneratedFlag = False\r
         for Sect in Rule.SectionList:\r
             SecIndex = '%d' %Index\r
             SectList  = []\r
             #\r
             # Convert Fv Section Type for PI1.1 SMM driver.\r
             #\r
-            if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion >= 0x0001000A:\r
+            if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) >= 0x0001000A:\r
                 if Sect.SectionType == 'DXE_DEPEX':\r
                     Sect.SectionType = 'SMM_DEPEX'\r
             #\r
             # Framework SMM Driver has no SMM_DEPEX section type\r
             #\r
-            if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion < 0x0001000A:\r
+            if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) < 0x0001000A:\r
                 if Sect.SectionType == 'SMM_DEPEX':\r
                     EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)\r
             #\r
@@ -613,6 +616,51 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 SectList, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, SecIndex, Rule.KeyStringList, self)\r
             else :\r
                 SectList, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, SecIndex, self.KeyStringList, self)\r
+            \r
+            if not HasGneratedFlag:\r
+                UniVfrOffsetFileSection = ""    \r
+                ModuleFileName = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName)\r
+                InfData = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(ModuleFileName), self.CurrentArch]\r
+                #\r
+                # Search the source list in InfData to find if there are .vfr file exist.\r
+                #\r
+                VfrUniBaseName = {}\r
+                VfrUniOffsetList = []\r
+                for SourceFile in InfData.Sources:\r
+                    if SourceFile.Type.upper() == ".VFR" :\r
+                        #\r
+                        # search the .map file to find the offset of vfr binary in the PE32+/TE file. \r
+                        #\r
+                        VfrUniBaseName[SourceFile.BaseName] = (SourceFile.BaseName + "Bin")\r
+                    if SourceFile.Type.upper() == ".UNI" :\r
+                        #\r
+                        # search the .map file to find the offset of Uni strings binary in the PE32+/TE file. \r
+                        #\r
+                        VfrUniBaseName["UniOffsetName"] = (self.BaseName + "Strings")\r
+                    \r
+                \r
+                if len(VfrUniBaseName) > 0:\r
+                    VfrUniOffsetList = self.__GetBuildOutputMapFileVfrUniInfo(VfrUniBaseName)\r
+                    #\r
+                    # Generate the Raw data of raw section\r
+                    #\r
+                    os.path.join( self.OutputPath, self.BaseName + '.offset')\r
+                    UniVfrOffsetFileName    =  os.path.join( self.OutputPath, self.BaseName + '.offset')\r
+                    UniVfrOffsetFileSection =  os.path.join( self.OutputPath, self.BaseName + 'Offset' + '.raw')\r
+                    \r
+                    self.__GenUniVfrOffsetFile (VfrUniOffsetList, UniVfrOffsetFileName)\r
+                    \r
+                    UniVfrOffsetFileNameList = []\r
+                    UniVfrOffsetFileNameList.append(UniVfrOffsetFileName)\r
+                    """Call GenSection"""\r
+                    GenFdsGlobalVariable.GenerateSection(UniVfrOffsetFileSection,\r
+                                                         UniVfrOffsetFileNameList,\r
+                                                         "EFI_SECTION_RAW"\r
+                                                         )\r
+                    os.remove(UniVfrOffsetFileName)         \r
+                    SectList.append(UniVfrOffsetFileSection)\r
+                    HasGneratedFlag = True\r
+                \r
             for SecName in  SectList :\r
                 SectFiles.append(SecName)\r
                 SectAlignments.append(Align)\r
@@ -672,3 +720,116 @@ class FfsInfStatement(FfsInfStatementClassObject):
             result += ('-a', Rule.Alignment)\r
 \r
         return result\r
\r
+    ## __GetBuildOutputMapFileVfrUniInfo() method\r
+    #\r
+    #   Find the offset of UNI/INF object offset in the EFI image file.\r
+    #\r
+    #   @param  self                  The object pointer\r
+    #   @param  VfrUniBaseName        A name list contain the UNI/INF object name.\r
+    #   @retval RetValue              A list contain offset of UNI/INF object.\r
+    #    \r
+    def __GetBuildOutputMapFileVfrUniInfo(self, VfrUniBaseName):\r
+        \r
+        RetValue = []\r
+        \r
+        MapFileName = os.path.join(self.EfiOutputPath, self.BaseName + ".map")\r
+        try:\r
+            fInputfile = open(MapFileName, "r", 0)\r
+            try:\r
+                FileLinesList = fInputfile.readlines()\r
+            except:\r
+                EdkLogger.error("GenFds", FILE_READ_FAILURE, "File read failed for %s" %MapFileName,None)\r
+            finally:\r
+                fInputfile.close()\r
+        except:\r
+            EdkLogger.error("GenFds", FILE_OPEN_FAILURE, "File open failed for %s" %MapFileName,None)\r
+        \r
+        IsHex = False\r
+        for eachLine in FileLinesList:\r
+            for eachName in VfrUniBaseName.values():\r
+                if eachLine.find(eachName) != -1:\r
+                    eachLine = eachLine.strip()\r
+                    Element  = eachLine.split()\r
+                    #\r
+                    # MSFT/ICC/EBC map file\r
+                    #\r
+                    if (len(Element) == 4):\r
+                        try:\r
+                            int (Element[2], 16)\r
+                            IsHex = True\r
+                        except:\r
+                            IsHex = False\r
+                    \r
+                        if IsHex:\r
+                            RetValue.append((eachName, Element[2]))\r
+                            IsHex = False\r
+                    #\r
+                    # GCC map file\r
+                    #\r
+                    elif (len(Element) == 2) and Element[0].startswith("0x"):\r
+                        RetValue.append((eachName, Element[0]))\r
+        \r
+        return RetValue\r
+    \r
+    ## __GenUniVfrOffsetFile() method\r
+    #\r
+    #   Generate the offset file for the module which contain VFR or UNI file.\r
+    #\r
+    #   @param  self                    The object pointer\r
+    #   @param  VfrUniOffsetList        A list contain the VFR/UNI offsets in the EFI image file.\r
+    #   @param  UniVfrOffsetFileName    The output offset file name.\r
+    #\r
+    def __GenUniVfrOffsetFile(self, VfrUniOffsetList, UniVfrOffsetFileName):\r
+        \r
+        try:\r
+            fInputfile = open(UniVfrOffsetFileName, "wb+", 0)\r
+        except:\r
+            EdkLogger.error("GenFds", FILE_OPEN_FAILURE, "File open failed for %s" %UniVfrOffsetFileName,None)\r
+            \r
+        # Use a instance of StringIO to cache data\r
+        fStringIO = StringIO.StringIO('')  \r
+        \r
+        for Item in VfrUniOffsetList:\r
+            if (Item[0].find("Strings") != -1):\r
+                #\r
+                # UNI offset in image.\r
+                # GUID + Offset\r
+                # { 0x8913c5e0, 0x33f6, 0x4d86, { 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66 } }\r
+                #\r
+                UniGuid = [0xe0, 0xc5, 0x13, 0x89, 0xf6, 0x33, 0x86, 0x4d, 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66]\r
+                UniGuid = [chr(ItemGuid) for ItemGuid in UniGuid]\r
+                fStringIO.write(''.join(UniGuid))            \r
+                UniValue = pack ('Q', int (Item[1], 16))\r
+                fStringIO.write (UniValue)\r
+            else:\r
+                #\r
+                # VFR binary offset in image.\r
+                # GUID + Offset\r
+                # { 0xd0bc7cb4, 0x6a47, 0x495f, { 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2 } };\r
+                #\r
+                VfrGuid = [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x49, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2]\r
+                VfrGuid = [chr(ItemGuid) for ItemGuid in VfrGuid]\r
+                fStringIO.write(''.join(VfrGuid))                   \r
+                type (Item[1]) \r
+                VfrValue = pack ('Q', int (Item[1], 16))\r
+                fStringIO.write (VfrValue)\r
+            \r
+        #\r
+        # write data into file.\r
+        #\r
+        try :  \r
+            fInputfile.write (fStringIO.getvalue())\r
+        except:\r
+            EdkLogger.error("GenFds", FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %UniVfrOffsetFileName,None)\r
+        \r
+        fStringIO.close ()\r
+        fInputfile.close ()\r
+        \r
+                \r
+                    \r
+            \r
+            \r
+        \r
+                                \r
+        \r
index 8c884b6e1085d85cdb2134b70f755451b9626a49..a6d3c6319da6da184a99805575cdcd5058e91916 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # section base class\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -129,7 +129,7 @@ class Section (SectionClassObject):
         if FileType != None:\r
             for File in FfsInf.BinFileList:\r
                 if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:\r
-                    if File.Type == FileType or (FfsInf.PiSpecVersion >= 0x0001000A and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX'):\r
+                    if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX'):\r
                         if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:\r
                             FileList.append(File.Path)\r
                         else:\r
index 4b00dff84de3c873e7f819cf8c4845b73a10f2c9..4a97b8a93b125027057ad477fe2ccbdb696043cc 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create a database used by build tool\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -1425,7 +1425,17 @@ class InfBuildData(ModuleBuildClassObject):
             if not self._ModuleType:\r
                 EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,\r
                                 "MODULE_TYPE is not given", File=self.MetaFile)\r
-            if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (self._Specification['PI_SPECIFICATION_VERSION'] < 0x0001000A):\r
+            if self._ModuleType not in SUP_MODULE_LIST:\r
+                RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]\r
+                for Record in RecordList:\r
+                    Name = Record[0]\r
+                    if Name == "MODULE_TYPE":\r
+                        LineNo = Record[6]\r
+                        break\r
+                EdkLogger.error("build", FORMAT_NOT_SUPPORTED,\r
+                                "MODULE_TYPE %s is not supported for EDK II, valid values are:\n %s" % (self._ModuleType,' '.join(l for l in SUP_MODULE_LIST)), \r
+                                File=self.MetaFile, Line=LineNo)             \r
+            if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A):\r
                 if self._ModuleType == SUP_MODULE_SMM_CORE:\r
                     EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile)                \r
             if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \\r
@@ -1894,7 +1904,12 @@ class InfBuildData(ModuleBuildClassObject):
         if self._Depex == None:\r
             self._Depex = tdict(False, 2)\r
             RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]\r
-\r
+            \r
+            # If the module has only Binaries and no Sources, then ignore [Depex] \r
+            if self.Sources == None or self.Sources == []:\r
+              if self.Binaries <> None and self.Binaries <> []:\r
+                return self._Depex\r
+                \r
             # PEIM and DXE drivers must have a valid [Depex] section\r
             if len(self.LibraryClass) == 0 and len(RecordList) == 0:\r
                 if self.ModuleType == 'DXE_DRIVER' or self.ModuleType == 'PEIM' or self.ModuleType == 'DXE_SMM_DRIVER' or \\r
index c5793ad057f5426acdec5ffeab2d657f22827c2f..13d28ff3bad73996982ef75e301907164fbf7772 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 - 2011, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -486,7 +486,7 @@ class ModuleReport(object):
             #\r
             if ModuleType == "DXE_SMM_DRIVER":\r
                 PiSpec =  M.Module.Specification.get("PI_SPECIFICATION_VERSION", "0x00010000")\r
-                if int(PiSpec, 0) >= 0x0001000A:\r
+                if int(PiSpec, 16) >= 0x0001000A:\r
                     ModuleType = "SMM_DRIVER"\r
             self.DriverType = gDriverTypeMap.get(ModuleType, "0x2 (FREE_FORM)")\r
         self.UefiSpecVersion = M.Module.Specification.get("UEFI_SPECIFICATION_VERSION", "")\r
index 84f5636414f0867aaf2eca0bca3cab74bb67f787..b794c0a361ea95de7a01477eb1c7ed0d3bd9dc54 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # build a platform or a module\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -102,7 +102,8 @@ def CheckEnvVariable():
     #\r
     # Check EFI_SOURCE (R8 build convention). EDK_SOURCE will always point to ECP\r
     #\r
-    os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)\r
+    if "ECP_SOURCE" not in os.environ:\r
+        os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)\r
     if "EFI_SOURCE" not in os.environ:\r
         os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]\r
     if "EDK_SOURCE" not in os.environ:\r
@@ -888,7 +889,7 @@ class Build():
                     self.LoadFixAddress = int (LoadFixAddressString, 16)\r
                 else:\r
                     self.LoadFixAddress = int (LoadFixAddressString)\r
-            except:
+            except:\r
                 EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (LoadFixAddressString))\r
             if self.LoadFixAddress < 0:\r
                 EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS is set to the invalid negative value %s" % (LoadFixAddressString))\r
@@ -908,6 +909,8 @@ class Build():
                 self.FvList = []\r
         else:\r
             FdfParserObj = FdfParser(str(self.Fdf))\r
+            for key in self.Db._GlobalMacros:\r
+                InputMacroDict[key] = self.Db._GlobalMacros[key]\r
             FdfParserObj.ParseFile()\r
             for fvname in self.FvList:\r
                 if fvname.upper() not in FdfParserObj.Profile.FvDict.keys():\r
@@ -974,6 +977,7 @@ class Build():
             if not self.SkipAutoGen or Target == 'genmake':\r
                 self.Progress.Start("Generating makefile")\r
                 AutoGenObject.CreateMakeFile(CreateDepsMakeFile)\r
+                AutoGenObject.CreateAsBuiltInf()\r
                 self.Progress.Stop("done!")\r
             if Target == "genmake":\r
                 return True\r
@@ -1007,8 +1011,8 @@ class Build():
         InfFileNameList = ModuleList.keys()\r
         #InfFileNameList.sort()\r
         for InfFile in InfFileNameList:\r
-            sys.stdout.write (".")
-            sys.stdout.flush()
+            sys.stdout.write (".")\r
+            sys.stdout.flush()\r
             ModuleInfo = ModuleList[InfFile]\r
             ModuleName = ModuleInfo.BaseName\r
             ModuleOutputImage = ModuleInfo.Image.FileName\r
@@ -1141,8 +1145,8 @@ class Build():
     ## Collect MAP information of all modules\r
     #\r
     def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):\r
-        sys.stdout.write ("Generate Load Module At Fix Address Map")
-        sys.stdout.flush()
+        sys.stdout.write ("Generate Load Module At Fix Address Map")\r
+        sys.stdout.flush()\r
         PatchEfiImageList = []\r
         PeiModuleList  = {}\r
         BtModuleList   = {}\r
@@ -1187,11 +1191,11 @@ class Build():
                         SmmModuleList[Module.MetaFile] = ImageInfo\r
                         SmmSize += ImageInfo.Image.Size\r
                         if Module.ModuleType == 'DXE_SMM_DRIVER':\r
-                            PiSpecVersion = 0
-                            if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification:
-                                PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION']
+                            PiSpecVersion = '0x00000000'\r
+                            if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification:\r
+                                PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION']\r
                             # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver.\r
-                            if PiSpecVersion < 0x0001000A:\r
+                            if int(PiSpecVersion, 16) < 0x0001000A:\r
                                 BtModuleList[Module.MetaFile] = ImageInfo\r
                                 BtSize += ImageInfo.Image.Size\r
                     break\r
@@ -1245,7 +1249,7 @@ class Build():
             #\r
             # Get PCD offset in EFI image by GenPatchPcdTable function\r
             #\r
-            PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) 
+            PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) \r
             #\r
             # Patch real PCD value by PatchPcdValue tool\r
             #\r
@@ -1277,8 +1281,8 @@ class Build():
         self._RebaseModule (MapBuffer, RtBaseAddr, RtModuleList, TopMemoryAddress == 0)\r
         self._RebaseModule (MapBuffer, 0x1000, SmmModuleList, AddrIsOffset = False, ModeIsSmm = True)\r
         MapBuffer.write('\n\n')\r
-        sys.stdout.write ("\n")
-        sys.stdout.flush()
+        sys.stdout.write ("\n")\r
+        sys.stdout.flush()\r
     \r
     ## Save platform Map file\r
     #\r
@@ -1291,10 +1295,10 @@ class Build():
         # Save address map into MAP file.\r
         #\r
         SaveFileOnChange(MapFilePath, MapBuffer.getvalue(), False)\r
-        MapBuffer.close()
-        if self.LoadFixAddress != 0:
-            sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath))
-        sys.stdout.flush()
+        MapBuffer.close()\r
+        if self.LoadFixAddress != 0:\r
+            sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath))\r
+        sys.stdout.flush()\r
 \r
     ## Build active platform for different build targets and different tool chains\r
     #\r
@@ -1487,6 +1491,7 @@ class Build():
 \r
                             if not self.SkipAutoGen or self.Target == 'genmake':\r
                                 Ma.CreateMakeFile(True)\r
+                                Ma.CreateAsBuiltInf()\r
                             if self.Target == "genmake":\r
                                 continue\r
                         self.Progress.Stop("done!")\r
index 7175dcf3ca71c06a9c457ecf7c7d7e3fa5f0e832..b593efb2a190df7fabf842052196a9bef2ad5d46 100644 (file)
Binary files a/BaseTools/UserManuals/RmPkg_Utility_Man_Page.rtf and b/BaseTools/UserManuals/RmPkg_Utility_Man_Page.rtf differ