]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Sync EDKII BaseTools to BaseTools project r2068.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Oct 2010 06:30:37 +0000 (06:30 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Oct 2010 06:30:37 +0000 (06:30 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10937 6f19259b-4bc3-4df7-8a09-765794883524

25 files changed:
BaseTools/Bin/Win32/BootSectImage.exe
BaseTools/Bin/Win32/EfiLdrImage.exe
BaseTools/Bin/Win32/EfiRom.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/Spd2Dec.exe
BaseTools/Bin/Win32/Split.exe
BaseTools/Bin/Win32/TianoCompress.exe
BaseTools/Bin/Win32/Trim.exe
BaseTools/Bin/Win32/VfrCompile.exe
BaseTools/Bin/Win32/VolInfo.exe
BaseTools/Bin/Win32/build.exe
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/Trim/Trim.py
BaseTools/Source/Python/Workspace/MetaFileParser.py

index c628a946dd6d7a646e3b15a39245d7c60df0ab44..7c4dc10481b0905c7e069c8ed5b7b84b7a231cee 100755 (executable)
Binary files a/BaseTools/Bin/Win32/BootSectImage.exe and b/BaseTools/Bin/Win32/BootSectImage.exe differ
index 2d42e0fff48223ea5f53e5b3376c92ed3ca5a61e..8b760e51f5dc9386249eb5fead058bbecdf73da4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiLdrImage.exe and b/BaseTools/Bin/Win32/EfiLdrImage.exe differ
index 9a1db5f3d03e079b199e0d8e6877bb4c9ce7ecd5..ab969edab3b6447809821226991cdf23fc649e5b 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiRom.exe and b/BaseTools/Bin/Win32/EfiRom.exe differ
index 4e68e769670f44df79313d45971ae693e0f9755f..0327a9ec34d625a9e4195d94856cd02bbb1ef1c3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenBootSector.exe and b/BaseTools/Bin/Win32/GenBootSector.exe differ
index 671e04ee6a112f41c18bf6ab3f7f0baf4e5d5bf4..799d0be54ecd52b6348f45da180c230dd90dd4d2 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenCrc32.exe and b/BaseTools/Bin/Win32/GenCrc32.exe differ
index 3e6685ce388069bb14a8f82447a90243d3a4467d..4bea183fad1f45111e4dd359a8954407555fb8b2 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenDepex.exe and b/BaseTools/Bin/Win32/GenDepex.exe differ
index 1df44e67143cec5e0c4d7abb12c2706e39e5c676..dc0cc346ba6182fc81d575562defb06ac8f51112 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFds.exe and b/BaseTools/Bin/Win32/GenFds.exe differ
index 92a1c1540eeafe88de8e1a3a3a11882158945a78..46f56abbb1f65f0e84e84d1a6c8e0ccef2309f41 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFfs.exe and b/BaseTools/Bin/Win32/GenFfs.exe differ
index 882c2d1d096ea58e52e4e08ffa84bf71a0fcb337..aa505ba2ca2d19f0d3b1a024b51570468dc693e4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFv.exe and b/BaseTools/Bin/Win32/GenFv.exe differ
index 4db22ba547341008503e7b0588fdf3dc5d96f6d7..1b299bba323787f3bd84faa962279c0681f2b475 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFw.exe and b/BaseTools/Bin/Win32/GenFw.exe differ
index 0d3e6615aa62b2298ef400d95e1b17075531ddb6..e3eaad8bb4dfb1f1909163fa1d350a24e98c33de 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPage.exe and b/BaseTools/Bin/Win32/GenPage.exe differ
index 1262bf6f06cbdf8e4d00e6ef6830b1455b5de73f..d404b476427dee92086923c5ac773d517a591801 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPatchPcdTable.exe and b/BaseTools/Bin/Win32/GenPatchPcdTable.exe differ
index 74d3379adca5c52e1ce6bb08e889781c432f227e..4d78a1a916179c9d7e73760ad947d5afdbb5bb3c 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenSec.exe and b/BaseTools/Bin/Win32/GenSec.exe differ
index fc1f860fec7764dfdd4b9eb3c9ec5de9e4bf65fe..50fa7e9e6d47b86ece76ef91e0fdce652cc8bce1 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenVtf.exe and b/BaseTools/Bin/Win32/GenVtf.exe differ
index 2f74e0f8a97a232a6b19562ad128dbb0d286f948..c65ced3dc1f964857477a52a31b5b122da5e53ff 100755 (executable)
Binary files a/BaseTools/Bin/Win32/LzmaCompress.exe and b/BaseTools/Bin/Win32/LzmaCompress.exe differ
index bc58b468facbcffb21bc71b6c5efe4c704263ea7..436ae8942cde2291c0db3f5c12ca0fee448c8de2 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Spd2Dec.exe and b/BaseTools/Bin/Win32/Spd2Dec.exe differ
index 097824af6670e571f070aba67e3e3fc118087f1d..cd4b4aff6cbef677c1096e3dc734ed9cf788559d 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Split.exe and b/BaseTools/Bin/Win32/Split.exe differ
index 8fe45a52d9399056549b568050473049b45a26e1..994226ab574f2c83e33a8bdba85d537693290775 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TianoCompress.exe and b/BaseTools/Bin/Win32/TianoCompress.exe differ
index 4c6993bf3ba5cc8e3b5542a50b116c2bff9df20d..527bff8035213e46c50a4b7c5f50c6bdfb48edff 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Trim.exe and b/BaseTools/Bin/Win32/Trim.exe differ
index cf31c305a006843da2dad7c658edd48e784d0a08..21e66b81c723a4fb56f38add30f924ba3140b29e 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VfrCompile.exe and b/BaseTools/Bin/Win32/VfrCompile.exe differ
index d7d30c45d6d3eaf0a42a7c369163f653d90a1c82..0f1bbc820a2de2f7c827fa03a2bb530466826da1 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VolInfo.exe and b/BaseTools/Bin/Win32/VolInfo.exe differ
index 05ab7c1daf34d1ebc84d6e2e07e2675366a8aa2e..dd3a45b37c304f7a339ce20c6d6f3ea6980ab289 100755 (executable)
Binary files a/BaseTools/Bin/Win32/build.exe and b/BaseTools/Bin/Win32/build.exe differ
index 311749285f0af2c68ee41fc2ba60e6d0afd8061f..e2dc5a5e52749abd6731adbec7de72a628be1b96 100644 (file)
@@ -1172,14 +1172,15 @@ def ParseConsoleLog(Filename):
 #
 def CheckPcdDatum(Type, Value):
     if Type == "VOID*":
-        if not ((Value.startswith('L"') or Value.startswith('"') and Value.endswith('"'))
+        if not (((Value.startswith('L"') or Value.startswith('"')) and Value.endswith('"'))
                 or (Value.startswith('{') and Value.endswith('}'))
                ):
             return False, "Invalid value [%s] of type [%s]; must be in the form of {...} for array"\
                           ", or \"...\" for string, or L\"...\" for unicode string" % (Value, Type)
     elif Type == 'BOOLEAN':
-        if Value not in ['TRUE', 'FALSE']:
-            return False, "Invalid value [%s] of type [%s]; must be TRUE or FALSE" % (Value, Type)
+        if Value not in ['TRUE', 'True', 'true', '0x1', '0x01', '1', 'FALSE', 'False', 'false', '0x0', '0x00', '0']:
+            return False, "Invalid value [%s] of type [%s]; must be one of TRUE, True, true, 0x1, 0x01, 1"\
+                          ", FALSE, False, false, 0x0, 0x00, 0" % (Value, Type)
     elif type(Value) == type(""):
         try:
             Value = long(Value, 0)
index b3ad16715ae03cbf9185e5996e3ea1f070a97360..bfa2b7b590a9e9ccd927c0401313f8b5fe66c79d 100644 (file)
@@ -41,7 +41,7 @@ gHexNumberPattern = re.compile("0[xX]([0-9a-fA-F]+)")
 ## Regular expression for matching "Include ()" in asl file
 gAslIncludePattern = re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.MULTILINE)
 ## Regular expression for matching C style #include "XXX.asl" in asl file
-gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*[>"]', re.MULTILINE)
+gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*([>"])', re.MULTILINE)
 ## Regular expression for matching constant with 'ULL' and 'UL', 'LL', 'L' postfix
 gLongNumberPattern = re.compile("(0[xX][0-9a-fA-F]+|[0-9]+)U?LL", re.MULTILINE)
 ## Patterns used to convert EDK conventions to EDK2 ECP conventions
@@ -273,12 +273,23 @@ def TrimPreprocessedVfr(Source, Target):
 # @param  Source            File to be read
 # @param  Indent            Spaces before the Include() statement
 # @param  IncludePathList   The list of external include file
+# @param  LocalSearchPath   If LocalSearchPath is specified, this path will be searched
+#                           first for the included file; otherwise, only the path specified
+#                           in the IncludePathList will be searched.
 #
-def DoInclude(Source, Indent='', IncludePathList=[]):
+def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
     NewFileContent = []
 
     try:
-        for IncludePath in IncludePathList:
+        #
+        # Search LocalSearchPath first if it is specified.
+        #
+        if LocalSearchPath:
+            SearchPathList = [LocalSearchPath] + IncludePathList
+        else:
+            SearchPathList = IncludePathList
+  
+        for IncludePath in SearchPathList:
             IncludeFile = os.path.join(IncludePath, Source)
             if os.path.isfile(IncludeFile):
                 F = open(IncludeFile, "r")
@@ -298,15 +309,21 @@ def DoInclude(Source, Indent='', IncludePathList=[]):
     gIncludedAslFile.append(IncludeFile)
     
     for Line in F:
+        LocalSearchPath = None
         Result = gAslIncludePattern.findall(Line)
         if len(Result) == 0:
             Result = gAslCIncludePattern.findall(Line)
             if len(Result) == 0 or os.path.splitext(Result[0][1])[1].lower() not in [".asl", ".asi"]:
                 NewFileContent.append("%s%s" % (Indent, Line))
                 continue
+            #
+            # We should first search the local directory if current file are using pattern #include "XXX" 
+            #
+            if Result[0][2] == '"':
+                LocalSearchPath = os.path.dirname(IncludeFile)
         CurrentIndent = Indent + Result[0][0]
         IncludedFile = Result[0][1]
-        NewFileContent.extend(DoInclude(IncludedFile, CurrentIndent, IncludePathList))
+        NewFileContent.extend(DoInclude(IncludedFile, CurrentIndent, IncludePathList, LocalSearchPath))
         NewFileContent.append("\n")
 
     gIncludedAslFile.pop()
index 3c7d7fdf6ad4ef7138e5e93ef454d4524f0d1a9c..2b25dc42aeff5a07b1b5fb703c7312857ab70678 100644 (file)
@@ -503,6 +503,13 @@ class InfParser(MetaFileParser):
             EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
                             ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
                             File=self.MetaFile, Line=self._LineIndex+1)
+        # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
+        if self._ValueList[2] != '':
+            InfPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+            if InfPcdValueList[0] in ['True', 'true', 'TRUE']:
+                self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
+            elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
+                self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
 
     ## [depex] section parser
     def _DepexParser(self):
@@ -929,7 +936,13 @@ class DscParser(MetaFileParser):
             EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
                             ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
                             File=self.MetaFile, Line=self._LineIndex+1)
-
+        # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
+        DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+        if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
+            self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '1', 1);
+        elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
+            self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
+            
     ## [components] section parser
     def _ComponentParser(self):
         if self._CurrentLine[-1] == '{':
@@ -1226,6 +1239,10 @@ class DecParser(MetaFileParser):
         if not IsValid:
             EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
                             File=self.MetaFile, Line=self._LineIndex+1)
+        if ValueList[0] in ['True', 'true', 'TRUE']:
+            ValueList[0] = '1'
+        elif ValueList[0] in ['False', 'false', 'FALSE']:
+            ValueList[0] = '0'
 
         self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()