You can subscribe to this list here.
| 2010 |
Jan
(18) |
Feb
(75) |
Mar
(40) |
Apr
(18) |
May
(12) |
Jun
(13) |
Jul
(17) |
Aug
(25) |
Sep
(31) |
Oct
(16) |
Nov
(20) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(5) |
Feb
(7) |
Mar
(6) |
Apr
(21) |
May
(12) |
Jun
(35) |
Jul
(29) |
Aug
(56) |
Sep
(64) |
Oct
(43) |
Nov
(60) |
Dec
(26) |
| 2012 |
Jan
(6) |
Feb
(12) |
Mar
(17) |
Apr
(10) |
May
(11) |
Jun
(13) |
Jul
(6) |
Aug
(2) |
Sep
(3) |
Oct
(9) |
Nov
(1) |
Dec
(2) |
| 2013 |
Jan
(5) |
Feb
(5) |
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(3) |
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
(4) |
Nov
(14) |
Dec
(10) |
| 2014 |
Jan
(22) |
Feb
(7) |
Mar
(3) |
Apr
(4) |
May
(1) |
Jun
(6) |
Jul
(4) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: <js...@us...> - 2011-11-24 06:17:05
|
Revision: 2429
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2429&view=rev
Author: jsu1
Date: 2011-11-24 06:16:59 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
Remove one extra empty line generated for autogen.h
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-24 02:51:37 UTC (rev 2428)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-24 06:16:59 UTC (rev 2429)
@@ -312,7 +312,7 @@
""")
-gAutoGenHCppPrologueString = """
+gAutoGenHCppPrologueString = """\
#ifdef __cplusplus
extern "C" {
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2011-11-24 02:51:44
|
Revision: 2428
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2428&view=rev
Author: xfzyr
Date: 2011-11-24 02:51:37 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
Since Coding style spec has added chapter 7.3.2 for copyright notice format. So add check for copyright notice according to coding style spec chapter 7.3.2(Revision 1.0, March, 2010).
Signed-off-by: yzeng15
Reviewed-by: hchen30
Revision Links:
--------------
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1&view=rev
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Ecc/Check.py
trunk/BaseTools/Source/Python/Ecc/MetaDataParser.py
trunk/BaseTools/Source/Python/Ecc/c.py
Modified: trunk/BaseTools/Source/Python/Ecc/Check.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Check.py 2011-11-23 09:38:15 UTC (rev 2427)
+++ trunk/BaseTools/Source/Python/Ecc/Check.py 2011-11-24 02:51:37 UTC (rev 2428)
@@ -15,6 +15,7 @@
from CommonDataClass.DataClass import *
from Common.DataType import SUP_MODULE_LIST_STRING, TAB_VALUE_SPLIT
from EccToolError import *
+from MetaDataParser import ParseHeaderCommentSection
import EccGlobalData
import c
@@ -415,13 +416,79 @@
elif Ext in ('.inf', '.dec', '.dsc', '.fdf'):
FullName = os.path.join(Dirpath, F)
op = open(FullName).readlines()
- if not op[0].startswith('## @file') and op[6].startswith('## @file') and op[7].startswith('## @file'):
+ FileLinesList = op
+ LineNo = 0
+ CurrentSection = MODEL_UNKNOWN
+ HeaderSectionLines = []
+ HeaderCommentStart = False
+ HeaderCommentEnd = False
+
+ for Line in FileLinesList:
+ LineNo = LineNo + 1
+ Line = Line.strip()
+ if (LineNo < len(FileLinesList) - 1):
+ NextLine = FileLinesList[LineNo].strip()
+
+ #
+ # blank line
+ #
+ if (Line == '' or not Line) and LineNo == len(FileLinesList):
+ LastSectionFalg = True
+
+ #
+ # check whether file header comment section started
+ #
+ if Line.startswith('##') and \
+ (Line.find('@file') > -1) and \
+ not HeaderCommentStart:
+ if CurrentSection != MODEL_UNKNOWN:
+ SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
+ ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
+ for Result in ResultSet:
+ Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" at the very top file'
+ EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
+
+ else:
+ CurrentSection = MODEL_IDENTIFIER_FILE_HEADER
+ #
+ # Append the first line to section lines.
+ #
+ HeaderSectionLines.append((Line, LineNo))
+ HeaderCommentStart = True
+ continue
+
+ #
+ # Collect Header content.
+ #
+ if (Line.startswith('#') and CurrentSection == MODEL_IDENTIFIER_FILE_HEADER) and\
+ HeaderCommentStart and not Line.startswith('##') and not\
+ HeaderCommentEnd and NextLine != '':
+ HeaderSectionLines.append((Line, LineNo))
+ continue
+ #
+ # Header content end
+ #
+ if (Line.startswith('##') or not Line.strip().startswith("#")) and HeaderCommentStart \
+ and not HeaderCommentEnd:
+ if Line.startswith('##'):
+ HeaderCommentEnd = True
+ HeaderSectionLines.append((Line, LineNo))
+ ParseHeaderCommentSection(HeaderSectionLines, FullName)
+ break
+ if HeaderCommentStart == False:
SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
for Result in ResultSet:
- Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file""'
+ Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" at the very top file'
EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
+ if HeaderCommentEnd == False:
+ SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
+ ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
+ for Result in ResultSet:
+ Msg = 'INF/DEC/DSC/FDF file header comment should end with ""##"" at the end of file header comment block'
+ EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
+
# Check whether the function headers are followed Doxygen special documentation blocks in section 2.3.5
def DoxygenCheckFunctionHeader(self):
Modified: trunk/BaseTools/Source/Python/Ecc/MetaDataParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/MetaDataParser.py 2011-11-23 09:38:15 UTC (rev 2427)
+++ trunk/BaseTools/Source/Python/Ecc/MetaDataParser.py 2011-11-24 02:51:37 UTC (rev 2428)
@@ -13,8 +13,9 @@
import os
from CommonDataClass.DataClass import *
-
-
+from EccToolError import *
+import EccGlobalData
+import re
## Get the inlcude path list for a source file
#
# 1. Find the source file belongs to which inf file
@@ -76,3 +77,188 @@
return TableList
+## ParseHeaderCommentSection
+#
+# Parse Header comment section lines, extract Abstract, Description, Copyright
+# , License lines
+#
+# @param CommentList: List of (Comment, LineNumber)
+# @param FileName: FileName of the comment
+#
+def ParseHeaderCommentSection(CommentList, FileName = None):
+
+ Abstract = ''
+ Description = ''
+ Copyright = ''
+ License = ''
+ EndOfLine = "\n"
+ STR_HEADER_COMMENT_START = "@file"
+
+ #
+ # used to indicate the state of processing header comment section of dec,
+ # inf files
+ #
+ HEADER_COMMENT_NOT_STARTED = -1
+ HEADER_COMMENT_STARTED = 0
+ HEADER_COMMENT_FILE = 1
+ HEADER_COMMENT_ABSTRACT = 2
+ HEADER_COMMENT_DESCRIPTION = 3
+ HEADER_COMMENT_COPYRIGHT = 4
+ HEADER_COMMENT_LICENSE = 5
+ HEADER_COMMENT_END = 6
+ #
+ # first find the last copyright line
+ #
+ Last = 0
+ HeaderCommentStage = HEADER_COMMENT_NOT_STARTED
+ for Index in xrange(len(CommentList)-1, 0, -1):
+ Line = CommentList[Index][0]
+ if _IsCopyrightLine(Line):
+ Last = Index
+ break
+
+ for Item in CommentList:
+ Line = Item[0]
+ LineNo = Item[1]
+
+ if not Line.startswith('#') and Line:
+ SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName
+ ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
+ for Result in ResultSet:
+ Msg = 'Comment must start with #'
+ EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
+ Comment = CleanString2(Line)[1]
+ Comment = Comment.strip()
+ #
+ # if there are blank lines between License or Description, keep them as they would be
+ # indication of different block; or in the position that Abstract should be, also keep it
+ # as it indicates that no abstract
+ #
+ if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICENSE, \
+ HEADER_COMMENT_DESCRIPTION, HEADER_COMMENT_ABSTRACT]:
+ continue
+
+ if HeaderCommentStage == HEADER_COMMENT_NOT_STARTED:
+ if Comment.startswith(STR_HEADER_COMMENT_START):
+ HeaderCommentStage = HEADER_COMMENT_ABSTRACT
+ else:
+ License += Comment + EndOfLine
+ else:
+ if HeaderCommentStage == HEADER_COMMENT_ABSTRACT:
+ #
+ # in case there is no abstract and description
+ #
+ if not Comment:
+ Abstract = ''
+ HeaderCommentStage = HEADER_COMMENT_DESCRIPTION
+ elif _IsCopyrightLine(Comment):
+ Copyright += Comment + EndOfLine
+ HeaderCommentStage = HEADER_COMMENT_COPYRIGHT
+ else:
+ Abstract += Comment + EndOfLine
+ HeaderCommentStage = HEADER_COMMENT_DESCRIPTION
+ elif HeaderCommentStage == HEADER_COMMENT_DESCRIPTION:
+ #
+ # in case there is no description
+ #
+ if _IsCopyrightLine(Comment):
+ Copyright += Comment + EndOfLine
+ HeaderCommentStage = HEADER_COMMENT_COPYRIGHT
+ else:
+ Description += Comment + EndOfLine
+ elif HeaderCommentStage == HEADER_COMMENT_COPYRIGHT:
+ if _IsCopyrightLine(Comment):
+ Copyright += Comment + EndOfLine
+ else:
+ #
+ # Contents after copyright line are license, those non-copyright lines in between
+ # copyright line will be discarded
+ #
+ if LineNo > Last:
+ if License:
+ License += EndOfLine
+ License += Comment + EndOfLine
+ HeaderCommentStage = HEADER_COMMENT_LICENSE
+ else:
+ if not Comment and not License:
+ continue
+ License += Comment + EndOfLine
+
+ if not Copyright:
+ SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName
+ ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
+ for Result in ResultSet:
+ Msg = 'Header comment section must have copyright information'
+ EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
+
+ if not License:
+ SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName
+ ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
+ for Result in ResultSet:
+ Msg = 'Header comment section must have license information'
+ EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
+
+ return Abstract.strip(), Description.strip(), Copyright.strip(), License.strip()
+
+## _IsCopyrightLine
+# check whether current line is copyright line, the criteria is whether there is case insensitive keyword "Copyright"
+# followed by zero or more white space characters followed by a "(" character
+#
+# @param LineContent: the line need to be checked
+# @return: True if current line is copyright line, False else
+#
+def _IsCopyrightLine (LineContent):
+ LineContent = LineContent.upper()
+ Result = False
+
+ ReIsCopyrightRe = re.compile(r"""(^|\s)COPYRIGHT *\(""", re.DOTALL)
+ if ReIsCopyrightRe.search(LineContent):
+ Result = True
+
+ return Result
+
+
+## CleanString2
+#
+# Split comments in a string
+# Remove spaces
+#
+# @param Line: The string to be cleaned
+# @param CommentCharacter: Comment char, used to ignore comment content,
+# default is DataType.TAB_COMMENT_SPLIT
+#
+def CleanString2(Line, CommentCharacter='#', AllowCppStyleComment=False):
+ #
+ # remove whitespace
+ #
+ Line = Line.strip()
+ #
+ # Replace EDK1's comment character
+ #
+ if AllowCppStyleComment:
+ Line = Line.replace('//', CommentCharacter)
+ #
+ # separate comments and statements
+ #
+ LineParts = Line.split(CommentCharacter, 1)
+ #
+ # remove whitespace again
+ #
+ Line = LineParts[0].strip()
+ if len(LineParts) > 1:
+ Comment = LineParts[1].strip()
+ #
+ # Remove prefixed and trailing comment characters
+ #
+ Start = 0
+ End = len(Comment)
+ while Start < End and Comment.startswith(CommentCharacter, Start, End):
+ Start += 1
+ while End >= 0 and Comment.endswith(CommentCharacter, Start, End):
+ End -= 1
+ Comment = Comment[Start:End]
+ Comment = Comment.strip()
+ else:
+ Comment = ''
+
+ return Line, Comment
Modified: trunk/BaseTools/Source/Python/Ecc/c.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/c.py 2011-11-23 09:38:15 UTC (rev 2427)
+++ trunk/BaseTools/Source/Python/Ecc/c.py 2011-11-24 02:51:37 UTC (rev 2428)
@@ -2301,32 +2301,75 @@
FileTable = 'Identifier' + str(FileID)
SqlStatement = """ select Value, ID
from %s
- where Model = %d and (StartLine = 1 or StartLine = 7 or StartLine = 8) and StartColumn = 0
+ where Model = %d and StartLine = 1 and StartColumn = 0
""" % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT)
ResultSet = Db.TblFile.Exec(SqlStatement)
if len(ResultSet) == 0:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'No Comment appear at the very beginning of file.', 'File', FileID)
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'No File License header appear at the very beginning of file.', 'File', FileID)
return ErrorMsgList
- IsFoundError1 = True
- IsFoundError2 = True
- IsFoundError3 = True
+ NoHeaderCommentStartFlag = True
+ NoHeaderCommentEndFlag = True
+ NoHeaderCommentPeriodFlag = True
+ NoCopyrightFlag = True
+ NoLicenseFlag = True
+ NoRevReferFlag = True
+ NextLineIndex = 0
for Result in ResultSet:
CommentStr = Result[0].strip()
+ CommentStrList = CommentStr.split('\r\n')
ID = Result[1]
+ Index = 0
if CommentStr.startswith('/** @file'):
- IsFoundError1 = False
+ NoHeaderCommentStartFlag = False
+ else:
+ continue
if CommentStr.endswith('**/'):
- IsFoundError2 = False
- if CommentStr.find('.') != -1:
- IsFoundError3 = False
+ NoHeaderCommentEndFlag = False
+ else:
+ continue
- if IsFoundError1:
+ for CommentLine in CommentStrList:
+ Index = Index + 1
+ NextLineIndex = Index
+ if CommentLine.startswith('/** @file'):
+ continue
+ if CommentLine.startswith('**/'):
+ break
+ if CommentLine.startswith('/** @file') == False and CommentLine.startswith('**/') == False and CommentLine.strip() and CommentLine.startswith(' ') == False:
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment content should start with two spaces at each line', FileTable, ID)
+
+ CommentLine = CommentLine.strip()
+ if CommentLine.startswith('Copyright'):
+ NoCopyrightFlag = False
+ if CommentLine.find('All rights reserved') == -1:
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All rights reserved"" announcement should be following the ""Copyright"" at the same line', FileTable, ID)
+ if CommentLine.endswith('<BR>') == -1:
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'The ""<BR>"" at the end of the Copyright line is required', FileTable, ID)
+ if NextLineIndex < len(CommentStrList) and CommentStrList[NextLineIndex].strip().startswith('Copyright') == False and CommentStrList[NextLineIndex].strip():
+ NoLicenseFlag = False
+ if CommentLine.startswith('@par Revision Reference:'):
+ NoRevReferFlag = False
+ RefListFlag = False
+ for RefLine in CommentStrList[NextLineIndex:]:
+ if RefLine.strip() and (NextLineIndex + 1) < len(CommentStrList) and CommentStrList[NextLineIndex+1].strip() and CommentStrList[NextLineIndex+1].strip().startswith('**/') == False:
+ RefListFlag = True
+ if RefLine.strip() == False or RefLine.strip().startswith('**/'):
+ RefListFlag = False
+ break
+ if RefListFlag == True:
+ if RefLine.strip() and RefLine.strip().startswith('**/') == False and RefLine.startswith(' -') == False:
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Each reference on a separate line should begin with a bullet character ""-"" ', FileTable, ID)
+ if NoHeaderCommentStartFlag:
PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header comment should begin with ""/** @file""', FileTable, ID)
- if IsFoundError2:
+ return
+ if NoHeaderCommentEndFlag:
PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should end with ""**/""', FileTable, ID)
- if IsFoundError3:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION, 'Comment description should end with period "".""', FileTable, ID)
+ return
+ if NoCopyrightFlag:
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment missing the ""Copyright""', FileTable, ID)
+ if NoLicenseFlag:
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should have the License immediately after the ""Copyright"" line', FileTable, ID)
def CheckFuncHeaderDoxygenComments(FullFileName):
ErrorMsgList = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2011-11-23 09:38:22
|
Revision: 2427
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2427&view=rev
Author: xfzyr
Date: 2011-11-23 09:38:15 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Enhance ECC to catch duplicate Library Class name while Library Class instance is different.
Signed-off-by: yzeng15
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Ecc/Check.py
Modified: trunk/BaseTools/Source/Python/Ecc/Check.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Check.py 2011-11-23 08:51:42 UTC (rev 2426)
+++ trunk/BaseTools/Source/Python/Ecc/Check.py 2011-11-23 09:38:15 UTC (rev 2427)
@@ -592,7 +592,7 @@
SqlCommand = """
select A.ID, A.Value1, A.BelongsToFile, A.StartLine, B.StartLine from Dsc as A left join Dsc as B
where A.Model = %s and B.Model = %s and A.Value3 = B.Value3 and A.Arch = B.Arch and A.ID <> B.ID
- and A.Value1 = B.Value1 and A.StartLine <> B.StartLine and B.BelongsToFile = A.BelongsToFile""" \
+ and A.Value1 = B.Value1 and A.Value2 <> B.Value2 and A.StartLine <> B.StartLine and B.BelongsToFile = A.BelongsToFile""" \
% (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)
RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)
for Record in RecordSet:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-11-23 08:51:49
|
Revision: 2426
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2426&view=rev
Author: yingke
Date: 2011-11-23 08:51:42 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Fix FDF macro bugs.
Signed-off-by: yingke
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/GenFds/FdfParser.py
Modified: trunk/BaseTools/Source/Python/GenFds/FdfParser.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2011-11-23 08:27:38 UTC (rev 2425)
+++ trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2011-11-23 08:51:42 UTC (rev 2426)
@@ -52,6 +52,8 @@
from Common import GlobalData
from Common.String import ReplaceMacro
+from Common.Misc import tdict
+
import re
import os
@@ -77,10 +79,6 @@
RegionSizeGuidPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*\|\s*(?P<size>\w+\.\w+)\s*")
IncludeFileList = []
-# Macro passed from command line, which has greatest priority and can NOT be overridden by those in FDF
-InputMacroDict = {}
-# All Macro values when parsing file, not replace existing Macro
-AllMacroList = []
def GetRealFileLine (File, Line):
@@ -215,14 +213,17 @@
self.__Token = ""
self.__SkippedChars = ""
+ # Used to section info
+ self.__CurSection = []
+ # Key: [section name, UI name, arch]
+ # Value: {MACRO_NAME : MACRO_VALUE}
+ self.__MacroDict = tdict(True, 3)
+ self.__PcdDict = {}
+
self.__WipeOffArea = []
if GenFdsGlobalVariable.WorkSpaceDir == '':
GenFdsGlobalVariable.WorkSpaceDir = os.getenv("WORKSPACE")
- InputMacroDict.update(GlobalData.gPlatformDefines)
- InputMacroDict.update(GlobalData.gGlobalDefines)
- InputMacroDict.update(GlobalData.gCommandLineDefines)
-
## __IsWhiteSpace() method
#
# Whether char at current FileBufferPos is whitespace
@@ -381,30 +382,6 @@
self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesList]
self.Profile.FileLinesList[-1].append(' ')
- def __ReplaceMacros(self, Str, File, Line):
- MacroEnd = 0
- while Str.find('$(', MacroEnd) >= 0:
- MacroStart = Str.find('$(', MacroEnd)
- if Str.find(')', MacroStart) > 0:
- MacroEnd = Str.find(')', MacroStart)
- Name = Str[MacroStart + 2 : MacroEnd]
- Value = None
- if Name in InputMacroDict:
- Value = InputMacroDict[Name]
-
- else:
- for Profile in AllMacroList:
- if Profile.FileName == File and Profile.MacroName == Name and Profile.DefinedAtLine <= Line:
- Value = Profile.MacroValue
-
- if Value != None:
- Str = Str.replace('$(' + Name + ')', Value)
- MacroEnd = MacroStart + len(Value)
-
- else:
- raise Warning("Macro not complete", self.FileName, self.CurrentLineNumber)
- return Str
-
def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
if StartPos[0] == EndPos[0]:
Offset = StartPos[1]
@@ -446,7 +423,67 @@
self.FileName, self.CurrentLineNumber)
MacroName = MacroName[2:-1]
return MacroName, NotFlag
-
+
+ def __SetMacroValue(self, Macro, Value):
+ if not self.__CurSection:
+ return
+
+ MacroDict = {}
+ if not self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]]:
+ self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]] = MacroDict
+ else:
+ MacroDict = self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]]
+ MacroDict[Macro] = Value
+
+ def __GetMacroValue(self, Macro):
+ # Highest priority
+ if Macro in GlobalData.gCommandLineDefines:
+ return GlobalData.gCommandLineDefines[Macro]
+ if Macro in GlobalData.gGlobalDefines:
+ return GlobalData.gGlobalDefines[Macro]
+
+ if self.__CurSection:
+ MacroDict = self.__MacroDict[
+ self.__CurSection[0],
+ self.__CurSection[1],
+ self.__CurSection[2]
+ ]
+ if MacroDict and Macro in MacroDict:
+ return MacroDict[Macro]
+
+ # Lowest priority
+ if Macro in GlobalData.gPlatformDefines:
+ return GlobalData.gPlatformDefines[Macro]
+ return None
+
+ def __SectionHeaderParser(self, Section):
+ # [Defines]
+ # [FD.UiName]: use dummy instead if UI name is optional
+ # [FV.UiName]
+ # [Capsule.UiName]
+ # [Rule]: don't take rule section into account, macro is not allowed in this section
+ # [VTF.arch.UiName, arch]
+ # [OptionRom.DriverName]
+ self.__CurSection = []
+ Section = Section.strip()[1:-1].upper().replace(' ', '').strip('.')
+ ItemList = Section.split('.')
+ Item = ItemList[0]
+ if Item == '' or Item == 'RULE':
+ return
+
+ if Item == 'DEFINES':
+ self.__CurSection = ['COMMON', 'COMMON', 'COMMON']
+ elif Item == 'VTF' and len(ItemList) == 3:
+ UiName = ItemList[2]
+ Pos = UiName.find(',')
+ if Pos != -1:
+ UiName = UiName[:Pos]
+ self.__CurSection = ['VTF', UiName, ItemList[1]]
+ elif len(ItemList) > 1:
+ self.__CurSection = [ItemList[0], ItemList[1], 'COMMON']
+ elif len(ItemList) > 0:
+ self.__CurSection = [ItemList[0], 'DUMMY', 'COMMON']
+
## PreprocessFile() method
#
# Preprocess file contents, replace comments with spaces.
@@ -530,10 +567,10 @@
raise Warning("expected include file name", self.FileName, self.CurrentLineNumber)
IncFileName = self.__Token
__IncludeMacros = {}
- __IncludeMacros['WORKSPACE'] = InputMacroDict['WORKSPACE']
- __IncludeMacros['ECP_SOURCE'] = InputMacroDict['ECP_SOURCE']
- __IncludeMacros['EFI_SOURCE'] = InputMacroDict['EFI_SOURCE']
- __IncludeMacros['EDK_SOURCE'] = InputMacroDict['EDK_SOURCE']
+ __IncludeMacros['WORKSPACE'] = self.__GetMacroValue('WORKSPACE')
+ __IncludeMacros['ECP_SOURCE'] = self.__GetMacroValue('ECP_SOURCE')
+ __IncludeMacros['EFI_SOURCE'] = self.__GetMacroValue('EFI_SOURCE')
+ __IncludeMacros['EDK_SOURCE'] = self.__GetMacroValue('EDK_SOURCE')
IncludedFile = NormPath(ReplaceMacro(IncFileName, __IncludeMacros, RaiseError=True))
#
@@ -609,8 +646,47 @@
IfList = []
RegionLayoutLine = 0
while self.__GetNextToken():
+ # Determine section name and the location dependent macro
+ if self.__GetIfListCurrentItemStat(IfList):
+ if self.__Token.startswith('['):
+ Header = self.__Token
+ if not self.__Token.endswith(']'):
+ self.__SkipToToken(']')
+ Header += self.__SkippedChars
+ if Header.find('$(') != -1:
+ raise Warning("macro cannot be used in section header", self.FileName, self.CurrentLineNumber)
+ self.__SectionHeaderParser(Header)
+ continue
+ # Replace macros except in RULE section or out of section
+ elif self.__CurSection and self.__Token.find('$(') != -1:
+ CurIndex = self.CurrentOffsetWithinLine
+ self.__UndoToken()
+ PreIndex = self.CurrentOffsetWithinLine
+ CurLine = self.Profile.FileLinesList[self.CurrentLineNumber - 1]
+ MacroReplaced = False
+ StartPos = CurLine.find('$(', PreIndex, CurIndex+1)
+ EndPos = CurLine.find(')', StartPos+2, CurIndex+1)
+ while StartPos != -1 and EndPos != -1:
+ MacroName = CurLine[StartPos+2 : EndPos]
+ MacorValue = self.__GetMacroValue(MacroName)
+ if MacorValue != None:
+ MacroReplaced = True
+ CurLine = CurLine.replace('$(' + MacroName + ')', MacorValue, 1)
+ PreIndex = StartPos + len(MacorValue)
+ CurIndex = CurIndex - (len(MacroName) + 3 - len(MacorValue))
+ else:
+ PreIndex = EndPos + 1
+ StartPos = CurLine.find('$(', PreIndex, CurIndex+1)
+ EndPos = CurLine.find(')', StartPos+2, CurIndex+1)
+ if not MacroReplaced:
+ self.CurrentOffsetWithinLine = CurIndex
+ self.Profile.FileLinesList[self.CurrentLineNumber - 1] = CurLine
+ continue
+
if self.__Token == 'DEFINE':
- if self.__GetIfListCurrentItemStat(IfList):
+ if self.__GetIfListCurrentItemStat(IfList):
+ if not self.__CurSection:
+ raise Warning("macro cannot be defined in Rule section or out of section", self.FileName, self.CurrentLineNumber)
DefineLine = self.CurrentLineNumber - 1
DefineOffset = self.CurrentOffsetWithinLine - len('DEFINE')
if not self.__GetNextToken():
@@ -625,13 +701,7 @@
if self.__GetStringData():
pass
Value = self.__Token
- if not Macro in InputMacroDict:
- FileLineTuple = GetRealFileLine(self.FileName, DefineLine + 1)
- MacProfile = MacroProfile(FileLineTuple[0], FileLineTuple[1])
- MacProfile.MacroName = Macro
- MacProfile.MacroValue = Value
- AllMacroList.append(MacProfile)
- InputMacroDict[MacProfile.MacroName] = MacProfile.MacroValue
+ self.__SetMacroValue(Macro, Value)
self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
elif self.__Token == 'SET':
PcdPair = self.__GetNextPcdName()
@@ -649,7 +719,7 @@
raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
Value += self.__SkippedChars
- InputMacroDict[PcdName] = Value
+ self.__PcdDict[PcdName] = Value
elif self.__Token in ('!ifdef', '!ifndef', '!if'):
IfStartPos = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len(self.__Token))
IfList.append([IfStartPos, None, None])
@@ -709,19 +779,50 @@
if not RegionSizeGuid:
RegionLayoutLine = self.CurrentLineNumber + 1
continue
- InputMacroDict[RegionSizeGuid.group('base')] = RegionSize.group('base')
- InputMacroDict[RegionSizeGuid.group('size')] = RegionSize.group('size')
+ self.__PcdDict[RegionSizeGuid.group('base')] = RegionSize.group('base')
+ self.__PcdDict[RegionSizeGuid.group('size')] = RegionSize.group('size')
RegionLayoutLine = self.CurrentLineNumber + 1
if IfList:
raise Warning("Missing !endif", self.FileName, self.CurrentLineNumber)
self.Rewind()
+ def __CollectMacroPcd(self):
+ MacroDict = {}
+
+ # PCD macro
+ MacroDict.update(self.__PcdDict)
+
+ # Lowest priority
+ MacroDict.update(GlobalData.gPlatformDefines)
+
+ if self.__CurSection:
+ # Defines macro
+ ScopeMacro = self.__MacroDict['COMMON', 'COMMON', 'COMMON']
+ if ScopeMacro:
+ MacroDict.update(ScopeMacro)
+
+ # Section macro
+ ScopeMacro = self.__MacroDict[
+ self.__CurSection[0],
+ self.__CurSection[1],
+ self.__CurSection[2]
+ ]
+ if ScopeMacro:
+ MacroDict.update(ScopeMacro)
+
+ MacroDict.update(GlobalData.gGlobalDefines)
+ MacroDict.update(GlobalData.gCommandLineDefines)
+ # Highest priority
+
+ return MacroDict
+
def __EvaluateConditional(self, Expression, Line, Op = None, Value = None):
FileLineTuple = GetRealFileLine(self.FileName, Line)
+ MacroPcdDict = self.__CollectMacroPcd()
if Op == 'eval':
try:
- return ValueExpression(Expression, InputMacroDict)()
+ return ValueExpression(Expression, MacroPcdDict)()
except SymbolNotFound:
return False
except WrnExpression, Excpt:
@@ -738,7 +839,7 @@
else:
if Expression.startswith('$(') and Expression[-1] == ')':
Expression = Expression[2:-1]
- return Expression in InputMacroDict
+ return Expression in MacroPcdDict
## __IsToken() method
#
@@ -1150,12 +1251,6 @@
while self.__GetDefines():
pass
-
- Index = 0
- while Index < len(self.Profile.FileLinesList):
- FileLineTuple = GetRealFileLine(self.FileName, Index + 1)
- self.Profile.FileLinesList[Index] = self.__ReplaceMacros(self.Profile.FileLinesList[Index], FileLineTuple[0], FileLineTuple[1])
- Index += 1
## ParseFile() method
#
@@ -1239,11 +1334,6 @@
if not self.__GetNextToken() or self.__Token.startswith('['):
raise Warning("expected MACRO value", self.FileName, self.CurrentLineNumber)
Value = self.__Token
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- MacProfile = MacroProfile(FileLineTuple[0], FileLineTuple[1])
- MacProfile.MacroName = Macro
- MacProfile.MacroValue = Value
- AllMacroList.append(MacProfile)
return False
@@ -2420,7 +2510,7 @@
if ErrorCode != 0:
EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
else:
- if not InputMacroDict["OUTPUT_DIRECTORY"] in FfsFileObj.FileName:
+ if not self.__GetMacroValue("OUTPUT_DIRECTORY") in FfsFileObj.FileName:
#do case sensitive check for file path
ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
if ErrorCode != 0:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-11-23 08:27:45
|
Revision: 2425
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2425&view=rev
Author: yingke
Date: 2011-11-23 08:27:38 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Fix DEC macro bugs.
Signed-off-by: yingke
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-23 01:23:11 UTC (rev 2424)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-23 08:27:38 UTC (rev 2425)
@@ -59,10 +59,17 @@
EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*",
ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- self._ItemType = self.DataType[Type]
+ Value = ReplaceMacro(Value, self._Macros)
+ self._ItemType = MODEL_META_DATA_DEFINE
# DEFINE defined macros
- if self._ItemType == MODEL_META_DATA_DEFINE:
- if self._SectionType == MODEL_META_DATA_HEADER:
+ if Type == TAB_DSC_DEFINES_DEFINE:
+ if type(self) == DecParser:
+ if MODEL_META_DATA_HEADER in self._SectionType:
+ self._FileLocalMacros[Name] = Value
+ else:
+ for Scope in self._Scope:
+ self._SectionsMacroDict.setdefault((Scope[2], Scope[0], Scope[1]), {})[Name] = Value
+ elif self._SectionType == MODEL_META_DATA_HEADER:
self._FileLocalMacros[Name] = Value
else:
SectionDictKey = self._SectionType, self._Scope[0][0], self._Scope[0][1]
@@ -310,6 +317,7 @@
EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
Name, Value = self._ValueList[1], self._ValueList[2]
# Sometimes, we need to make differences between EDK and EDK2 modules
if Name == 'INF_VERSION':
@@ -319,7 +327,6 @@
EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version number",
ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- Value = ReplaceMacro(Value, self._Macros)
if type(self) == InfParser and self._Version < 0x00010005:
# EDK module allows using defines as macros
self._FileLocalMacros[Name] = Value
@@ -359,11 +366,10 @@
## that share the same name while scope is wider
def _GetApplicableSectionMacro(self):
Macros = {}
-
- for SectionType, Scope1, Scope2 in self._SectionsMacroDict:
- if (SectionType == self._SectionType) and (Scope1 == self._Scope[0][0] or Scope1 == "COMMON") and (Scope2 == self._Scope[0][1] or Scope2 == "COMMON"):
- Macros.update(self._SectionsMacroDict[(SectionType, Scope1, Scope2)])
-
+ for Scope1, Scope2 in [("COMMON", "COMMON"), ("COMMON", self._Scope[0][1]),
+ (self._Scope[0][0], "COMMON"), (self._Scope[0][0], self._Scope[0][1])]:
+ if (self._SectionType, Scope1, Scope2) in self._SectionsMacroDict:
+ Macros.update(self._SectionsMacroDict[(self._SectionType, Scope1, Scope2)])
return Macros
_SectionParser = {}
@@ -499,7 +505,8 @@
self._ValueList = ['','','']
# parse current line, result will be put in self._ValueList
self._SectionParser[self._SectionType](self)
- if self._ValueList == None:
+ if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
+ self._ItemType = -1
continue
#
# Model, Value1, Value2, Value3, Arch, Platform, BelongsToItem=-1,
@@ -1380,6 +1387,7 @@
# DEC file supported data types (one type per section)
DataType = {
TAB_DEC_DEFINES.upper() : MODEL_META_DATA_HEADER,
+ TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
TAB_GUIDS.upper() : MODEL_EFI_GUID,
@@ -1441,7 +1449,8 @@
# section content
self._ValueList = ['','','']
self._SectionParser[self._SectionType[0]](self)
- if self._ValueList == None:
+ if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
+ self._ItemType = -1
self._Comments = []
continue
@@ -1482,6 +1491,14 @@
self._Comments = []
self._Done()
+ def _GetApplicableSectionMacro(self):
+ Macros = {}
+ for S1, S2, SectionType in self._Scope:
+ for Scope1, Scope2 in [("COMMON", "COMMON"), ("COMMON", S2), (S1, "COMMON"), (S1, S2)]:
+ if (SectionType, Scope1, Scope2) in self._SectionsMacroDict:
+ Macros.update(self._SectionsMacroDict[(SectionType, Scope1, Scope2)])
+ return Macros
+
## Section header parser
#
# The section header is always in following format:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-23 01:23:17
|
Revision: 2424
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2424&view=rev
Author: jsu1
Date: 2011-11-23 01:23:11 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Update UPT to not treat '//' as comment if line start with '#'
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/UPT/Library/Misc.py
Modified: trunk/BaseTools/Source/Python/UPT/Library/Misc.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/Library/Misc.py 2011-11-22 06:18:47 UTC (rev 2423)
+++ trunk/BaseTools/Source/Python/UPT/Library/Misc.py 2011-11-23 01:23:11 UTC (rev 2424)
@@ -875,7 +875,7 @@
for Index in xrange(StartPos, EndPos+1):
LineList[Index] = ''
FindEdkBlockComment = False
- elif Line.find("//") != -1:
+ elif Line.find("//") != -1 and not Line.startswith("#"):
#
# handling cpp style comment
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-11-22 06:18:53
|
Revision: 2423
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2423&view=rev
Author: ydong10
Date: 2011-11-22 06:18:47 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
Patch includes:
1.Refine support for Question_Ref3 opcode.
2.Add set default value logic.
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2011-11-21 08:41:08 UTC (rev 2422)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2011-11-22 06:18:47 UTC (rev 2423)
@@ -670,6 +670,25 @@
Info.mVarType = EFI_IFR_TYPE_NUM_SIZE_8;
}
CNObj.SetFlags (0, Info.mVarType);
+ //
+ // Use maximum value not to limit the vaild value for the undefined question.
+ //
+ switch (Info.mVarType) {
+ case EFI_IFR_TYPE_NUM_SIZE_64:
+ CNObj.SetMinMaxStepData ((UINT64) 0, (UINT64) -1 , (UINT64) 0);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_32:
+ CNObj.SetMinMaxStepData ((UINT32) 0, (UINT32) -1 , (UINT32) 0);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_16:
+ CNObj.SetMinMaxStepData ((UINT16) 0, (UINT16) -1 , (UINT16) 0);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_8:
+ CNObj.SetMinMaxStepData ((UINT8) 0, (UINT8) -1 , (UINT8) 0);
+ break;
+ default:
+ break;
+ }
//
// For undefined Efi VarStore type question
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-11-21 08:41:08 UTC (rev 2422)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-11-22 06:18:47 UTC (rev 2423)
@@ -3218,7 +3218,7 @@
| ideqvalExp[$RootLevel, $ExpOpCount]
| ideqidExp[$RootLevel, $ExpOpCount]
| ideqvallistExp[$RootLevel, $ExpOpCount]
- | questionref13Exp[$RootLevel, $ExpOpCount]
+ | questionref1Exp[$RootLevel, $ExpOpCount]
| rulerefExp[$RootLevel, $ExpOpCount]
| stringref1Exp[$RootLevel, $ExpOpCount]
| pushthisExp[$RootLevel, $ExpOpCount]
@@ -3453,50 +3453,26 @@
>>
;
-questionref13Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
+questionref1Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
<<
- UINT8 Type = 0x1;
- EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
- EFI_GUID Guid = {0,};
EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
UINT32 BitMask;
CHAR8 *QName = NULL;
UINT32 LineNo = 0;
>>
L:QuestionRef
- (
- (
- << Type = 0x3; >>
- {
- Path "=" "STRING_TOKEN" "\(" S:Number "\)" << Type = 0x4; DevPath = _STOSID(S->getText()); >>
- }
- {
- Uuid "=" guidDefinition[Guid] << Type = 0x5; >>
- }
- )
- |
- (
- "\("
- (
+ "\("
+ (
QN:StringIdentifier <<
QName = QN->getText();
- LineNo = QN->getLine();
+ LineNo = QN->getLine();
mCVfrQuestionDB.GetQuestionId (QN->getText(), NULL, QId, BitMask);
>>
| ID:Number << QId = _STOQID(ID->getText()); >>
)
- "\)"
- )
- )
+ "\)"
<<
- switch (Type) {
- case 0x1: {CIfrQuestionRef1 QR1Obj(L->getLine()); _SAVE_OPHDR_COND (QR1Obj, ($ExpOpCount == 0), L->getLine()); QR1Obj.SetQuestionId (QId, QName, LineNo); break;}
- case 0x3: {CIfrQuestionRef3 QR3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3Obj, ($ExpOpCount == 0), L->getLine()); break;}
- case 0x4: {CIfrQuestionRef3_2 QR3_2Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_2Obj, ($ExpOpCount == 0), L->getLine()); QR3_2Obj.SetDevicePath (DevPath); break;}
- case 0x5: {CIfrQuestionRef3_3 QR3_3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_3Obj, ($ExpOpCount == 0), L->getLine()); QR3_3Obj.SetDevicePath (DevPath); QR3_3Obj.SetGuid (&Guid); break;}
- }
- $ExpOpCount++;
- >>
+ { CIfrQuestionRef1 QR1Obj(L->getLine()); _SAVE_OPHDR_COND (QR1Obj, ($ExpOpCount == 0), L->getLine()); QR1Obj.SetQuestionId (QId, QName, LineNo); } $ExpOpCount++; >>
;
rulerefExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
@@ -3628,7 +3604,7 @@
vfrExpressionUnaryOp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
lengthExp[$RootLevel, $ExpOpCount]
| bitwisenotExp[$RootLevel, $ExpOpCount]
- | question2refExp[$RootLevel, $ExpOpCount]
+ | question23refExp[$RootLevel, $ExpOpCount]
| stringref2Exp[$RootLevel, $ExpOpCount]
| toboolExp[$RootLevel, $ExpOpCount]
| tostringExp[$RootLevel, $ExpOpCount]
@@ -3650,10 +3626,30 @@
<< { CIfrBitWiseNot BWNObj(L->getLine()); $ExpOpCount++; } >>
;
-question2refExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
+question23refExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
+ <<
+ UINT8 Type = 0x1;
+ EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
+ EFI_GUID Guid = {0,};
+ >>
L:QuestionRefVal
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrQuestionRef2 QR2Obj(L->getLine()); $ExpOpCount++; } >>
+ "\("
+ {
+ DevicePath "=" "STRING_TOKEN" "\(" S:Number "\)" "," << Type = 0x2; DevPath = _STOSID(S->getText()); >>
+ }
+ {
+ Uuid "=" guidDefinition[Guid] "," << Type = 0x3; >>
+ }
+ vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
+ "\)"
+ <<
+ switch (Type) {
+ case 0x1: {CIfrQuestionRef2 QR2Obj(L->getLine()); _SAVE_OPHDR_COND (QR2Obj, ($ExpOpCount == 0), L->getLine()); break;}
+ case 0x2: {CIfrQuestionRef3_2 QR3_2Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_2Obj, ($ExpOpCount == 0), L->getLine()); QR3_2Obj.SetDevicePath (DevPath); break;}
+ case 0x3: {CIfrQuestionRef3_3 QR3_3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_3Obj, ($ExpOpCount == 0), L->getLine()); QR3_3Obj.SetDevicePath (DevPath); QR3_3Obj.SetGuid (&Guid); break;}
+ }
+ $ExpOpCount++;
+ >>
;
stringref2Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-11-21 08:41:14
|
Revision: 2422
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2422&view=rev
Author: yingke
Date: 2011-11-21 08:41:08 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
Modify a GenFv error message to make it more clear.
Signed-off-by: yingke
Reviewed-by: djboyer
Modified Paths:
--------------
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-11-21 08:40:57 UTC (rev 2421)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-11-21 08:41:08 UTC (rev 2422)
@@ -1535,7 +1535,7 @@
//
Status = FindApResetVectorPosition (FvImage, &BytePointer);
if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "Cannot find the appropriate location in FvImage to add Ap reset vector!");
+ Error (NULL, 0, 3000, "Invalid", "FV image does not have enough space to place AP reset vector. The FV image needs to reserve at least 4KB of unused space.");
return EFI_ABORTED;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-21 08:41:10
|
Revision: 2421
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2421&view=rev
Author: jsu1
Date: 2011-11-21 08:40:57 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
Update UPT to not break on EDKI style comment for EDKI INFs
Reviewed-by: yingke
Reviewed-by: djboyer
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/UPT/Library/Misc.py
trunk/BaseTools/Source/Python/UPT/Logger/StringTable.py
trunk/BaseTools/Source/Python/UPT/Parser/InfParser.py
Modified: trunk/BaseTools/Source/Python/UPT/Library/Misc.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/Library/Misc.py 2011-11-21 07:00:55 UTC (rev 2420)
+++ trunk/BaseTools/Source/Python/UPT/Library/Misc.py 2011-11-21 08:40:57 UTC (rev 2421)
@@ -834,6 +834,59 @@
return NewList
+## ProcessEdkComment
+#
+# Process EDK style comment in LineList: c style /* */ comment or cpp style // comment
+#
+#
+# @param LineList The LineList need to be processed.
+#
+# @return LineList The LineList been processed.
+# @return FirstPos Where Edk comment is first found, -1 if not found
+#
+def ProcessEdkComment(LineList):
+ FindEdkBlockComment = False
+ Count = 0
+ StartPos = -1
+ EndPos = -1
+ FirstPos = -1
+
+ while(Count < len(LineList)):
+ Line = LineList[Count].strip()
+ if Line.startswith("/*"):
+ #
+ # handling c style comment
+ #
+ StartPos = Count
+ while Count < len(LineList):
+ Line = LineList[Count].strip()
+ if Line.endswith("*/"):
+ if (Count == StartPos) and Line.strip() == '/*/':
+ Count = Count + 1
+ continue
+ EndPos = Count
+ FindEdkBlockComment = True
+ break
+ Count = Count + 1
+
+ if FindEdkBlockComment:
+ if FirstPos == -1:
+ FirstPos = StartPos
+ for Index in xrange(StartPos, EndPos+1):
+ LineList[Index] = ''
+ FindEdkBlockComment = False
+ elif Line.find("//") != -1:
+ #
+ # handling cpp style comment
+ #
+ LineList[Count] = Line.replace("//", '#')
+ if FirstPos == -1:
+ FirstPos = Count
+
+ Count = Count + 1
+
+ return LineList, FirstPos
+
## GetLibInstanceInfo
#
# Get the information from Library Instance INF file.
Modified: trunk/BaseTools/Source/Python/UPT/Logger/StringTable.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/Logger/StringTable.py 2011-11-21 07:00:55 UTC (rev 2420)
+++ trunk/BaseTools/Source/Python/UPT/Logger/StringTable.py 2011-11-21 08:40:57 UTC (rev 2421)
@@ -196,6 +196,7 @@
_("The INF file %s defines both VERSION_NUMBER and VERSION_STRING, "
"using VERSION_STRING")
ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF = _("EDKI INF is not supported")
+ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII = _("The EDKI style comment is not supported in EDKII modules")
ERR_INF_PARSER_FEATUREPCD_USAGE_INVALID = _("The usage for FeaturePcd can only"
" be type of \"CONSUMES\".")
Modified: trunk/BaseTools/Source/Python/UPT/Parser/InfParser.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/Parser/InfParser.py 2011-11-21 07:00:55 UTC (rev 2420)
+++ trunk/BaseTools/Source/Python/UPT/Parser/InfParser.py 2011-11-21 08:40:57 UTC (rev 2421)
@@ -26,6 +26,7 @@
from Library.String import GetSplitValueList
from Library.String import ConvertSpecialChar
from Library.Misc import ProcessLineExtender
+from Library.Misc import ProcessEdkComment
from Library.Parsing import NormPath
from Library.ParserValidate import IsValidInfMoudleTypeList
from Library.ParserValidate import IsValidArch
@@ -165,6 +166,12 @@
FileLinesList = ProcessLineExtender(FileLinesList)
#
+ # Process EdkI INF style comment if found
+ #
+ OrigLines = [Line for Line in FileLinesList]
+ FileLinesList, EdkCommentStartPos = ProcessEdkComment(FileLinesList)
+
+ #
# Judge whether the INF file is Binary INF or not
#
if IsBinaryInf(FileLinesList):
@@ -339,6 +346,17 @@
File=self.FullPath)
#
+ # EDKII INF should not have EDKI style comment
+ #
+ if EdkCommentStartPos != -1:
+ Logger.Error("InfParser",
+ FORMAT_INVALID,
+ ST.ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII,
+ File=self.FullPath,
+ Line=EdkCommentStartPos + 1,
+ ExtraData=OrigLines[EdkCommentStartPos])
+
+ #
# extract [Event] [Hob] [BootMode] sections
#
self._ExtractEventHobBootMod(FileLinesList)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-11-21 07:01:01
|
Revision: 2420
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2420&view=rev
Author: yingke
Date: 2011-11-21 07:00:55 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
Remove duplicated macro definition options for GenFds command line.
Signed-off-by: yingke
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenMake.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenMake.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenMake.py 2011-11-21 03:29:22 UTC (rev 2419)
+++ trunk/BaseTools/Source/Python/AutoGen/GenMake.py 2011-11-21 07:00:55 UTC (rev 2420)
@@ -1321,16 +1321,16 @@
# macros passed to GenFds
MacroList.append('"%s=%s"' % ("EFI_SOURCE", GlobalData.gEfiSource.replace('\\', '\\\\')))
MacroList.append('"%s=%s"' % ("EDK_SOURCE", GlobalData.gEdkSource.replace('\\', '\\\\')))
- for MacroName in GlobalData.gGlobalDefines:
- if GlobalData.gGlobalDefines[MacroName] != "":
- MacroList.append('"%s=%s"' % (MacroName, GlobalData.gGlobalDefines[MacroName].replace('\\', '\\\\')))
+ MacroDict = {}
+ MacroDict.update(GlobalData.gGlobalDefines)
+ MacroDict.update(GlobalData.gCommandLineDefines)
+ MacroDict.pop("EFI_SOURCE", "dummy")
+ MacroDict.pop("EDK_SOURCE", "dummy")
+ for MacroName in MacroDict:
+ if MacroDict[MacroName] != "":
+ MacroList.append('"%s=%s"' % (MacroName, MacroDict[MacroName].replace('\\', '\\\\')))
else:
MacroList.append('"%s"' % MacroName)
- for MacroName in GlobalData.gCommandLineDefines:
- if GlobalData.gCommandLineDefines[MacroName] != "":
- MacroList.append('"%s=%s"' % (MacroName, GlobalData.gCommandLineDefines[MacroName].replace('\\', '\\\\')))
- else:
- MacroList.append('"%s"' % MacroName)
else:
FdfFileList = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2011-11-21 03:29:29
|
Revision: 2419
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2419&view=rev
Author: xfzyr
Date: 2011-11-21 03:29:22 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
Add XmlRoutines library to ECC since BaseTool Common library has remove it.
Signed-off-by: yzeng15
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Ecc/Exception.py
Added Paths:
-----------
trunk/BaseTools/Source/Python/Ecc/Xml/
trunk/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
trunk/BaseTools/Source/Python/Ecc/Xml/__init__.py
Modified: trunk/BaseTools/Source/Python/Ecc/Exception.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Exception.py 2011-11-18 07:09:30 UTC (rev 2418)
+++ trunk/BaseTools/Source/Python/Ecc/Exception.py 2011-11-21 03:29:22 UTC (rev 2419)
@@ -14,7 +14,7 @@
##
# Import Modules
#
-from Common.XmlRoutines import *
+from Xml.XmlRoutines import *
import os.path
# ExceptionXml to parse Exception Node of XML file
Added: trunk/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py (rev 0)
+++ trunk/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py 2011-11-21 03:29:22 UTC (rev 2419)
@@ -0,0 +1,228 @@
+## @file
+# This is an XML API that uses a syntax similar to XPath, but it is written in
+# standard python so that no extra python packages are required to use it.
+#
+# Copyright (c) 2007, 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
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+##
+# Import Modules
+#
+import xml.dom.minidom
+
+## Create a element of XML
+#
+# @param Name
+# @param String
+# @param NodeList
+# @param AttributeList
+#
+# @revel Element
+#
+def CreateXmlElement(Name, String, NodeList, AttributeList):
+ Doc = xml.dom.minidom.Document()
+ Element = Doc.createElement(Name)
+ if String != '' and String != None:
+ Element.appendChild(Doc.createTextNode(String))
+
+ for Item in NodeList:
+ if type(Item) == type([]):
+ Key = Item[0]
+ Value = Item[1]
+ if Key != '' and Key != None and Value != '' and Value != None:
+ Node = Doc.createElement(Key)
+ Node.appendChild(Doc.createTextNode(Value))
+ Element.appendChild(Node)
+ else:
+ Element.appendChild(Item)
+ for Item in AttributeList:
+ Key = Item[0]
+ Value = Item[1]
+ if Key != '' and Key != None and Value != '' and Value != None:
+ Element.setAttribute(Key, Value)
+
+ return Element
+
+## Get a list of XML nodes using XPath style syntax.
+#
+# Return a list of XML DOM nodes from the root Dom specified by XPath String.
+# If the input Dom or String is not valid, then an empty list is returned.
+#
+# @param Dom The root XML DOM node.
+# @param String A XPath style path.
+#
+# @revel Nodes A list of XML nodes matching XPath style Sting.
+#
+def XmlList(Dom, String):
+ if String == None or String == "" or Dom == None or Dom == "":
+ return []
+ if Dom.nodeType == Dom.DOCUMENT_NODE:
+ Dom = Dom.documentElement
+ if String[0] == "/":
+ String = String[1:]
+ TagList = String.split('/')
+ Nodes = [Dom]
+ Index = 0
+ End = len(TagList) - 1
+ while Index <= End:
+ ChildNodes = []
+ for Node in Nodes:
+ if Node.nodeType == Node.ELEMENT_NODE and Node.tagName == TagList[Index]:
+ if Index < End:
+ ChildNodes.extend(Node.childNodes)
+ else:
+ ChildNodes.append(Node)
+ Nodes = ChildNodes
+ ChildNodes = []
+ Index += 1
+
+ return Nodes
+
+
+## Get a single XML node using XPath style syntax.
+#
+# Return a single XML DOM node from the root Dom specified by XPath String.
+# If the input Dom or String is not valid, then an empty string is returned.
+#
+# @param Dom The root XML DOM node.
+# @param String A XPath style path.
+#
+# @revel Node A single XML node matching XPath style Sting.
+#
+def XmlNode(Dom, String):
+ if String == None or String == "" or Dom == None or Dom == "":
+ return ""
+ if Dom.nodeType == Dom.DOCUMENT_NODE:
+ Dom = Dom.documentElement
+ if String[0] == "/":
+ String = String[1:]
+ TagList = String.split('/')
+ Index = 0
+ End = len(TagList) - 1
+ ChildNodes = [Dom]
+ while Index <= End:
+ for Node in ChildNodes:
+ if Node.nodeType == Node.ELEMENT_NODE and Node.tagName == TagList[Index]:
+ if Index < End:
+ ChildNodes = Node.childNodes
+ else:
+ return Node
+ break
+ Index += 1
+ return ""
+
+
+## Get a single XML element using XPath style syntax.
+#
+# Return a single XML element from the root Dom specified by XPath String.
+# If the input Dom or String is not valid, then an empty string is returned.
+#
+# @param Dom The root XML DOM object.
+# @param Strin A XPath style path.
+#
+# @revel Element An XML element matching XPath style Sting.
+#
+def XmlElement(Dom, String):
+ try:
+ return XmlNode(Dom, String).firstChild.data.strip()
+ except:
+ return ""
+
+
+## Get a single XML element of the current node.
+#
+# Return a single XML element specified by the current root Dom.
+# If the input Dom is not valid, then an empty string is returned.
+#
+# @param Dom The root XML DOM object.
+#
+# @revel Element An XML element in current root Dom.
+#
+def XmlElementData(Dom):
+ try:
+ return Dom.firstChild.data.strip()
+ except:
+ return ""
+
+
+## Get a list of XML elements using XPath style syntax.
+#
+# Return a list of XML elements from the root Dom specified by XPath String.
+# If the input Dom or String is not valid, then an empty list is returned.
+#
+# @param Dom The root XML DOM object.
+# @param String A XPath style path.
+#
+# @revel Elements A list of XML elements matching XPath style Sting.
+#
+def XmlElementList(Dom, String):
+ return map(XmlElementData, XmlList(Dom, String))
+
+
+## Get the XML attribute of the current node.
+#
+# Return a single XML attribute named Attribute from the current root Dom.
+# If the input Dom or Attribute is not valid, then an empty string is returned.
+#
+# @param Dom The root XML DOM object.
+# @param Attribute The name of Attribute.
+#
+# @revel Element A single XML element matching XPath style Sting.
+#
+def XmlAttribute(Dom, Attribute):
+ try:
+ return Dom.getAttribute(Attribute).strip()
+ except:
+ return ''
+
+
+## Get the XML node name of the current node.
+#
+# Return a single XML node name from the current root Dom.
+# If the input Dom is not valid, then an empty string is returned.
+#
+# @param Dom The root XML DOM object.
+#
+# @revel Element A single XML element matching XPath style Sting.
+#
+def XmlNodeName(Dom):
+ try:
+ return Dom.nodeName.strip()
+ except:
+ return ''
+
+## Parse an XML file.
+#
+# Parse the input XML file named FileName and return a XML DOM it stands for.
+# If the input File is not a valid XML file, then an empty string is returned.
+#
+# @param FileName The XML file name.
+#
+# @revel Dom The Dom object achieved from the XML file.
+#
+def XmlParseFile(FileName):
+ try:
+ XmlFile = open(FileName)
+ Dom = xml.dom.minidom.parse(XmlFile)
+ XmlFile.close()
+ return Dom
+ except Exception, X:
+ print X
+ return ""
+
+# This acts like the main() function for the script, unless it is 'import'ed
+# into another script.
+if __name__ == '__main__':
+ # Nothing to do here. Could do some unit tests.
+ A = CreateXmlElement('AAA', 'CCC', [['AAA', '111'], ['BBB', '222']], [['A', '1'], ['B', '2']])
+ B = CreateXmlElement('ZZZ', 'CCC', [['XXX', '111'], ['YYY', '222']], [['A', '1'], ['B', '2']])
+ C = CreateXmlList('DDD', 'EEE', [A, B], ['FFF', 'GGG'])
+ print C.toprettyxml(indent = " ")
+ pass
Added: trunk/BaseTools/Source/Python/Ecc/Xml/__init__.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Xml/__init__.py (rev 0)
+++ trunk/BaseTools/Source/Python/Ecc/Xml/__init__.py 2011-11-21 03:29:22 UTC (rev 2419)
@@ -0,0 +1,20 @@
+## @file
+# Python 'Library' package initialization file.
+#
+# This file is required to make Python interpreter treat the directory
+# as containing package.
+#
+# Copyright (c) 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
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+'''
+Xml
+'''
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-18 07:09:36
|
Revision: 2418
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2418&view=rev
Author: jsu1
Date: 2011-11-18 07:09:30 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
Fix Trim to skip the postfix 'U' for hexadecimal and decimal numbers
Reviewed-by: gikidy
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Trim/Trim.py
Modified: trunk/BaseTools/Source/Python/Trim/Trim.py
===================================================================
--- trunk/BaseTools/Source/Python/Trim/Trim.py 2011-11-18 01:35:57 UTC (rev 2417)
+++ trunk/BaseTools/Source/Python/Trim/Trim.py 2011-11-18 07:09:30 UTC (rev 2418)
@@ -37,7 +37,9 @@
## Regular expression for matching "#pragma pack"
gPragmaPattern = re.compile("^\s*#pragma\s+pack", re.MULTILINE)
## Regular expression for matching HEX number
-gHexNumberPattern = re.compile("0[xX]([0-9a-fA-F]+)")
+gHexNumberPattern = re.compile("(0[xX])([0-9a-fA-F]+)U?")
+## Regular expression for matching decimal number with 'U' postfix
+gDecNumberPattern = re.compile("([0-9]+)U")
## 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
@@ -169,10 +171,15 @@
# convert HEX number format if indicated
if ConvertHex:
- Line = gHexNumberPattern.sub(r"0\1h", Line)
+ Line = gHexNumberPattern.sub(r"0\2h", Line)
+ else:
+ Line = gHexNumberPattern.sub(r"\1\2", Line)
if TrimLong:
Line = gLongNumberPattern.sub(r"\1", Line)
+ # convert Decimal number format
+ Line = gDecNumberPattern.sub(r"\1", Line)
+
if LineNumber != None:
EdkLogger.verbose("Got line directive: line=%d" % LineNumber)
# in case preprocessor removed some lines, like blank or comment lines
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-11-18 01:36:03
|
Revision: 2417
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2417&view=rev
Author: ydong10
Date: 2011-11-18 01:35:57 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
According to PI errata 0000718 and PI 1.2c Vol 3 3.2.1, comment out "Types" for EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE structure and "Data" for EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE structure.
Signed-off-by: lzeng14
Reviewed-by: hhtian
Modified Paths:
--------------
trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
Modified: trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
===================================================================
--- trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2011-11-18 01:35:41 UTC (rev 2416)
+++ trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2011-11-18 01:35:57 UTC (rev 2417)
@@ -553,7 +553,7 @@
EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES FvbAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvbAttributes;
UINTN offset;
UINTN fsize;
UINTN newSize;
@@ -869,7 +869,7 @@
EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES FvbAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvbAttributes;
UINTN fsize;
EFI_STATUS Status;
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-18 01:35:41 UTC (rev 2416)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-18 01:35:57 UTC (rev 2417)
@@ -226,7 +226,7 @@
BOOLEAN FvNameGuidSet;
CHAR8 FvExtHeaderFile[_MAX_PATH];
UINTN Size;
- EFI_FVB_ATTRIBUTES FvAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvAttributes;
CHAR8 FvName[_MAX_PATH];
EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
Modified: trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-18 01:35:41 UTC (rev 2416)
+++ trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-18 01:35:57 UTC (rev 2417)
@@ -14,7 +14,7 @@
File Name: PiFirmwareVolume.h
@par Revision Reference:
- Version 1.0.
+ Version 1.2C
**/
@@ -33,7 +33,7 @@
#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
-typedef UINT32 EFI_FVB_ATTRIBUTES;
+typedef UINT32 EFI_FVB_ATTRIBUTES_2;
//
// Attributes bit definitions
@@ -101,7 +101,7 @@
EFI_GUID FileSystemGuid;
UINT64 FvLength;
UINT32 Signature;
- EFI_FVB_ATTRIBUTES Attributes;
+ EFI_FVB_ATTRIBUTES_2 Attributes;
UINT16 HeaderLength;
UINT16 Checksum;
UINT16 ExtHeaderOffset;
@@ -139,8 +139,20 @@
// Array of GUIDs.
// Each GUID represents an OEM file type.
//
- EFI_GUID Types[1];
+ // EFI_GUID Types[1];
+ //
} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
+#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002
+typedef struct {
+ EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
+ EFI_GUID FormatType;
+ //
+ // An arry of bytes of length Length.
+ //
+ // UINT8 Data[1];
+ //
+} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-18 01:35:47
|
Revision: 2416
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2416&view=rev
Author: jsu1
Date: 2011-11-18 01:35:41 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
Removing md for vfr build rule
Reviewed-by: lgao4
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Conf/build_rule.template
Modified: trunk/BaseTools/Conf/build_rule.template
===================================================================
--- trunk/BaseTools/Conf/build_rule.template 2011-11-17 09:38:42 UTC (rev 2415)
+++ trunk/BaseTools/Conf/build_rule.template 2011-11-18 01:35:41 UTC (rev 2416)
@@ -195,10 +195,8 @@
$(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
<Command>
- -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1
- "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
- -$(MD) ${d_path} > NUL 2>&1
- "$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
+ "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_base}.i
+ "$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_base}.i
[Object-File]
<InputFile>
@@ -513,9 +511,7 @@
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.hpk
<Command>
- -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1
"$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
- -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1
"$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
[Hii-Binary-Package.UEFI_HII]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-11-17 09:38:52
|
Revision: 2415
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2415&view=rev
Author: gikidy
Date: 2011-11-17 09:38:42 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Remove binary tools from BaseTools trunk and remove build number information.
Signed-off-by: gikidy
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/ReadMe.txt
trunk/BaseTools/Source/C/Include/Common/BuildVersion.h
trunk/BaseTools/Source/Python/Common/BuildVersion.py
Removed Paths:
-------------
trunk/BaseTools/Bin/Darwin-i386/
trunk/BaseTools/Bin/Win32/
Modified: trunk/BaseTools/ReadMe.txt
===================================================================
--- trunk/BaseTools/ReadMe.txt 2011-11-17 08:32:56 UTC (rev 2414)
+++ trunk/BaseTools/ReadMe.txt 2011-11-17 09:38:42 UTC (rev 2415)
@@ -43,10 +43,4 @@
The Python distributed with most recent Linux will have sqlite3 module
built in. If not, please install sqlit3 package separately.
-2. The binary tools will be updated only after passing developer testing.
-
-Current state of the tools is Proto-Type - not all tool functions have been implemented
-and there may be bugs in these tools. These tools are under constant development at
-this time.
-
26-OCT-2011
Modified: trunk/BaseTools/Source/C/Include/Common/BuildVersion.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/BuildVersion.h 2011-11-17 08:32:56 UTC (rev 2414)
+++ trunk/BaseTools/Source/C/Include/Common/BuildVersion.h 2011-11-17 09:38:42 UTC (rev 2415)
@@ -1,3 +1,3 @@
//This file is for build version number auto generation
//
-#define __BUILD_VERSION "Build 2396"
+#define __BUILD_VERSION ""
Modified: trunk/BaseTools/Source/Python/Common/BuildVersion.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/BuildVersion.py 2011-11-17 08:32:56 UTC (rev 2414)
+++ trunk/BaseTools/Source/Python/Common/BuildVersion.py 2011-11-17 09:38:42 UTC (rev 2415)
@@ -1,3 +1,3 @@
#This file is for build version number auto generation
#
-gBUILD_VERSION = "Build 2396"
+gBUILD_VERSION = ""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-11-17 08:33:05
|
Revision: 2414
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2414&view=rev
Author: yingke
Date: 2011-11-17 08:32:56 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Check if FD or FV name exist when FD or FV statement are in capsule section.
Signed-off-by: yingke
Reviewed-by: jsu1
Reviewed-by: gikidy
Modified Paths:
--------------
trunk/BaseTools/Source/Python/GenFds/FdfParser.py
Modified: trunk/BaseTools/Source/Python/GenFds/FdfParser.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2011-11-17 08:32:46 UTC (rev 2413)
+++ trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2011-11-17 08:32:56 UTC (rev 2414)
@@ -2953,6 +2953,9 @@
if not self.__GetNextToken():
raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)
+ if self.__Token.upper() not in self.Profile.FvDict.keys():
+ raise Warning("FV name does not exist", self.FileName, self.CurrentLineNumber)
+
CapsuleFv = CapsuleData.CapsuleFv()
CapsuleFv.FvName = self.__Token
CapsuleObj.CapsuleDataList.append(CapsuleFv)
@@ -2978,6 +2981,9 @@
if not self.__GetNextToken():
raise Warning("expected FD name", self.FileName, self.CurrentLineNumber)
+ if self.__Token.upper() not in self.Profile.FdDict.keys():
+ raise Warning("FD name does not exist", self.FileName, self.CurrentLineNumber)
+
CapsuleFd = CapsuleData.CapsuleFd()
CapsuleFd.FdName = self.__Token
CapsuleObj.CapsuleDataList.append(CapsuleFd)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-11-17 08:32:53
|
Revision: 2413
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2413&view=rev
Author: gikidy
Date: 2011-11-17 08:32:46 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Enhance tool to report error at meta-data file parse phase while string token name contain lower case in ECP UNI files.
Signed-off-by: gikidy
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/StrGather.py
trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py
Modified: trunk/BaseTools/Source/Python/AutoGen/StrGather.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/StrGather.py 2011-11-17 07:28:13 UTC (rev 2412)
+++ trunk/BaseTools/Source/Python/AutoGen/StrGather.py 2011-11-17 08:32:46 UTC (rev 2413)
@@ -62,7 +62,7 @@
STRING = 'string'
TO = 'to'
STRING_TOKEN = re.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
-COMPATIBLE_STRING_TOKEN = re.compile('STRING_TOKEN *\(([A-Za-z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
+COMPATIBLE_STRING_TOKEN = re.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
EFI_HII_ARRAY_SIZE_LENGTH = 4
EFI_HII_PACKAGE_HEADER_LENGTH = 4
Modified: trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py 2011-11-17 07:28:13 UTC (rev 2412)
+++ trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py 2011-11-17 08:32:46 UTC (rev 2413)
@@ -260,7 +260,7 @@
Name = Item.split()[1]
# Check the string name is the upper character
- if not self.IsCompatibleMode and Name != '':
+ if Name != '':
MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
if MatchString == None or MatchString.end(0) != len(Name):
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid lower case character.' %(Name, self.File))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2011-11-17 07:28:20
|
Revision: 2412
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2412&view=rev
Author: xfzyr
Date: 2011-11-17 07:28:13 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Update UPT to resolve No module named Common.BuildVersion in UPT Tool.
Reviewed-by:hchen30
Signed-off-by:yzeng15
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Makefile
trunk/BaseTools/Source/Python/UPT/Makefile
trunk/BaseTools/Source/Python/UPT/UPT.py
Added Paths:
-----------
trunk/BaseTools/Source/Python/UPT/BuildVersion.py
Modified: trunk/BaseTools/Source/Python/Makefile
===================================================================
--- trunk/BaseTools/Source/Python/Makefile 2011-11-17 06:53:01 UTC (rev 2411)
+++ trunk/BaseTools/Source/Python/Makefile 2011-11-17 07:28:13 UTC (rev 2412)
@@ -61,6 +61,7 @@
$(BASE_TOOLS_PATH)\Source\Python\Autogen\UniClassObject.py \
$(BASE_TOOLS_PATH)\Source\Python\Autogen\__init__.py
+UPT_BUILDVERSION_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\UPT\BuildVersion.py
all: SetPythonPath $(APPLICATIONS)
@@ -100,7 +101,7 @@
$(BIN_DIR)\BPDG.exe: $(BASE_TOOLS_PATH)\Source\Python\BPDG\BPDG.py $(COMMON_PYTHON)
@pushd . & @cd BPDG & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) BPDG.py & @popd
-$(BIN_DIR)\UPT.exe: $(BASE_TOOLS_PATH)\Source\Python\UPT\UPT.py $(BASE_TOOLS_PATH)\Source\Python\UPT\UPT.py $(COMMON_PYTHON)
+$(BIN_DIR)\UPT.exe: $(BASE_TOOLS_PATH)\Source\Python\UPT\UPT.py $(UPT_BUILDVERSION_PYTHON)
@pushd . & @cd UPT & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) UPT.py & @popd
clean:
Added: trunk/BaseTools/Source/Python/UPT/BuildVersion.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/BuildVersion.py (rev 0)
+++ trunk/BaseTools/Source/Python/UPT/BuildVersion.py 2011-11-17 07:28:13 UTC (rev 2412)
@@ -0,0 +1,3 @@
+#This file is for build version number auto generation
+#
+gBUILD_VERSION = ""
Modified: trunk/BaseTools/Source/Python/UPT/Makefile
===================================================================
--- trunk/BaseTools/Source/Python/UPT/Makefile 2011-11-17 06:53:01 UTC (rev 2411)
+++ trunk/BaseTools/Source/Python/UPT/Makefile 2011-11-17 07:28:13 UTC (rev 2412)
@@ -24,14 +24,14 @@
APPLICATIONS=$(BIN_DIR)\UPT.exe
-COMMON_PYTHON=$(SOURCES_PATH)\UPT.py
+UPT_BUILDVERSION_PYTHON=$(SOURCES_PATH)\BuildVersion.py
all: SetPythonPath $(APPLICATIONS)
SetPythonPath:
set PYTHONPATH= $(SOURCES_PATH)
-$(BIN_DIR)\UPT.exe: $(SOURCES_PATH)\UPT.py $(COMMON_PYTHON)
+$(BIN_DIR)\UPT.exe: $(SOURCES_PATH)\UPT.py $(UPT_BUILDVERSION_PYTHON)
@pushd . & @cd build & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) UPT.py & @popd
@pushd . & @copy .\Dll\sqlite3.dll .\Bin\Sqlite3.dll & @popd
clean:
Modified: trunk/BaseTools/Source/Python/UPT/UPT.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/UPT.py 2011-11-17 06:53:01 UTC (rev 2411)
+++ trunk/BaseTools/Source/Python/UPT/UPT.py 2011-11-17 07:28:13 UTC (rev 2412)
@@ -43,7 +43,7 @@
from Library.Misc import CheckEnvVariable
from Library import GlobalData
from Core.IpiDb import IpiDatabase
-from Common.BuildVersion import gBUILD_VERSION
+from BuildVersion import gBUILD_VERSION
##
# Version and Copyright
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-11-17 06:53:07
|
Revision: 2411
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2411&view=rev
Author: gikidy
Date: 2011-11-17 06:53:01 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Fix an issue of during GenFds phase call DSC parser cannot find ECP_SOURCE definition for !include file and will cause build break.
Signed-off-by: gikidy
Reviewed-by: yingke
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-17 03:10:08 UTC (rev 2410)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-17 06:53:01 UTC (rev 2411)
@@ -1253,7 +1253,14 @@
# Allow using system environment variables in path after !include
#
__IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
- __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
+ if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():
+ __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
+ #
+ # During GenFds phase call DSC parser, will go into this branch.
+ #
+ elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():
+ __IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE']
+
__IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE']
__IncludeMacros['EDK_SOURCE'] = GlobalData.gGlobalDefines['EDK_SOURCE']
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-11-17 03:10:15
|
Revision: 2410
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2410&view=rev
Author: yingke
Date: 2011-11-17 03:10:08 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Fix an incremental build bug.
Signed-off-by: yingke
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenMake.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenMake.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenMake.py 2011-11-16 06:26:09 UTC (rev 2409)
+++ trunk/BaseTools/Source/Python/AutoGen/GenMake.py 2011-11-17 03:10:08 UTC (rev 2410)
@@ -31,6 +31,8 @@
## Regular expression for matching macro used in header file inclusion
gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
+gIsFileMap = {}
+
## pattern for include style in Edk.x code
gProtocolDefinition = "Protocol/%(HeaderKey)s/%(HeaderKey)s.h"
gGuidDefinition = "Guid/%(HeaderKey)s/%(HeaderKey)s.h"
@@ -421,6 +423,7 @@
self.FileListMacros = {}
self.ListFileMacros = {}
+ self.FileCache = {}
self.FileDependency = []
self.LibraryBuildCommandList = []
self.LibraryFileList = []
@@ -722,24 +725,26 @@
EdkLogger.debug(EdkLogger.DEBUG_1, "Try to get dependency files for %s" % File)
FileStack = [File] + ForceList
DependencySet = set()
- MacroUsedByIncludedFile = False
if self._AutoGenObject.Arch not in gDependencyDatabase:
gDependencyDatabase[self._AutoGenObject.Arch] = {}
DepDb = gDependencyDatabase[self._AutoGenObject.Arch]
- # add path of given source file into search path list.
- if File.Dir not in SearchPathList:
- SearchPathList.append(File.Dir)
while len(FileStack) > 0:
F = FileStack.pop()
+ FullPathDependList = []
+ if F in self.FileCache:
+ for CacheFile in self.FileCache[F]:
+ FullPathDependList.append(CacheFile)
+ if CacheFile not in DependencySet:
+ FileStack.append(CacheFile)
+ DependencySet.update(FullPathDependList)
+ continue
+
CurrentFileDependencyList = []
if F in DepDb:
CurrentFileDependencyList = DepDb[F]
- for Dep in CurrentFileDependencyList:
- if Dep not in FileStack and Dep not in DependencySet:
- FileStack.append(Dep)
else:
try:
Fd = open(F.Path, 'r')
@@ -755,7 +760,6 @@
FileContent = unicode(FileContent, "utf-16")
IncludedFileList = gIncludePattern.findall(FileContent)
- CurrentFilePath = F.Dir
for Inc in IncludedFileList:
Inc = Inc.strip()
# if there's macro used to reference header file, expand it
@@ -766,41 +770,44 @@
if HeaderType in gIncludeMacroConversion:
Inc = gIncludeMacroConversion[HeaderType] % {"HeaderKey" : HeaderKey}
else:
- # not known macro used in #include
- MacroUsedByIncludedFile = True
- continue
+ # not known macro used in #include, always build the file by
+ # returning a empty dependency
+ self.FileCache[File] = []
+ return []
Inc = os.path.normpath(Inc)
- for SearchPath in [CurrentFilePath] + SearchPathList:
- FilePath = os.path.join(SearchPath, Inc)
- if not os.path.isfile(FilePath) or FilePath in CurrentFileDependencyList:
+ CurrentFileDependencyList.append(Inc)
+ DepDb[F] = CurrentFileDependencyList
+
+ CurrentFilePath = F.Dir
+ PathList = [CurrentFilePath] + SearchPathList
+ for Inc in CurrentFileDependencyList:
+ for SearchPath in PathList:
+ FilePath = os.path.join(SearchPath, Inc)
+ if FilePath in gIsFileMap:
+ if not gIsFileMap[FilePath]:
continue
- FilePath = PathClass(FilePath)
- CurrentFileDependencyList.append(FilePath)
- if FilePath not in FileStack and FilePath not in DependencySet:
- FileStack.append(FilePath)
- break
+ # If isfile is called too many times, the performance is slow down.
+ elif not os.path.isfile(FilePath):
+ gIsFileMap[FilePath] = False
+ continue
else:
- EdkLogger.debug(EdkLogger.DEBUG_9, "%s included by %s was not found "\
- "in any given path:\n\t%s" % (Inc, F, "\n\t".join(SearchPathList)))
+ gIsFileMap[FilePath] = True
+ FilePath = PathClass(FilePath)
+ FullPathDependList.append(FilePath)
+ if FilePath not in DependencySet:
+ FileStack.append(FilePath)
+ break
+ else:
+ EdkLogger.debug(EdkLogger.DEBUG_9, "%s included by %s was not found "\
+ "in any given path:\n\t%s" % (Inc, F, "\n\t".join(SearchPathList)))
- if not MacroUsedByIncludedFile:
- if F == File:
- CurrentFileDependencyList += ForceList
- #
- # Don't keep the file in cache if it uses macro in included file.
- # So it will be scanned again if another file includes this file.
- #
- DepDb[F] = CurrentFileDependencyList
- DependencySet.update(CurrentFileDependencyList)
+ self.FileCache[F] = FullPathDependList
+ DependencySet.update(FullPathDependList)
- #
- # If there's macro used in included file, always build the file by
- # returning a empty dependency
- #
- if MacroUsedByIncludedFile:
- DependencyList = []
- else:
- DependencyList = list(DependencySet) # remove duplicate ones
+ DependencySet.update(ForceList)
+ if File in DependencySet:
+ DependencySet.remove(File)
+ DependencyList = list(DependencySet) # remove duplicate ones
return DependencyList
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-11-16 06:26:15
|
Revision: 2409
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2409&view=rev
Author: ydong10
Date: 2011-11-16 06:26:09 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
According to PI 1.2c Vol 3, EFI_FVB2_ALIGNMNET_512K should be EFI_FVB2_ALIGNMENT_512K.
Signed-off-by: lzeng14
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
trunk/BaseTools/Source/C/VolInfo/VolInfo.c
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-11-16 06:26:09 UTC (rev 2409)
@@ -84,7 +84,7 @@
EFI_FVB2_ALIGNMENT_64K_STRING,
EFI_FVB2_ALIGNMENT_128K_STRING,
EFI_FVB2_ALIGNMENT_256K_STRING,
- EFI_FVB2_ALIGNMNET_512K_STRING,
+ EFI_FVB2_ALIGNMENT_512K_STRING,
EFI_FVB2_ALIGNMENT_1M_STRING,
EFI_FVB2_ALIGNMENT_2M_STRING,
EFI_FVB2_ALIGNMENT_4M_STRING,
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.h 2011-11-16 06:26:09 UTC (rev 2409)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
@@ -130,7 +130,7 @@
#define EFI_FVB2_ALIGNMENT_64K_STRING "EFI_FVB2_ALIGNMENT_64K"
#define EFI_FVB2_ALIGNMENT_128K_STRING "EFI_FVB2_ALIGNMENT_128K"
#define EFI_FVB2_ALIGNMENT_256K_STRING "EFI_FVB2_ALIGNMENT_256K"
-#define EFI_FVB2_ALIGNMNET_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
+#define EFI_FVB2_ALIGNMENT_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
#define EFI_FVB2_ALIGNMENT_1M_STRING "EFI_FVB2_ALIGNMENT_1M"
#define EFI_FVB2_ALIGNMENT_2M_STRING "EFI_FVB2_ALIGNMENT_2M"
#define EFI_FVB2_ALIGNMENT_4M_STRING "EFI_FVB2_ALIGNMENT_4M"
Modified: trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h 2011-11-16 06:26:09 UTC (rev 2409)
@@ -1,7 +1,7 @@
/** @file
The firmware volume related definitions in PI.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 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
@@ -73,7 +73,7 @@
#define EFI_FVB2_ALIGNMENT_64K 0x00100000
#define EFI_FVB2_ALIGNMENT_128K 0x00110000
#define EFI_FVB2_ALIGNMENT_256K 0x00120000
-#define EFI_FVB2_ALIGNMNET_512K 0x00130000
+#define EFI_FVB2_ALIGNMENT_512K 0x00130000
#define EFI_FVB2_ALIGNMENT_1M 0x00140000
#define EFI_FVB2_ALIGNMENT_2M 0x00150000
#define EFI_FVB2_ALIGNMENT_4M 0x00160000
Modified: trunk/BaseTools/Source/C/VolInfo/VolInfo.c
===================================================================
--- trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2011-11-16 06:00:32 UTC (rev 2408)
+++ trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2011-11-16 06:26:09 UTC (rev 2409)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 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
@@ -845,8 +845,8 @@
printf (" EFI_FVB2_ALIGNMENT_256K\n");
}
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMNET_512K) {
- printf (" EFI_FVB2_ALIGNMNET_512K\n");
+ if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {
+ printf (" EFI_FVB2_ALIGNMENT_512K\n");
}
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-11-16 06:00:38
|
Revision: 2408
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2408&view=rev
Author: ydong10
Date: 2011-11-16 06:00:32 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
Enable flag field for date/time opcode.
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-11-16 05:24:51 UTC (rev 2407)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-11-16 06:00:32 UTC (rev 2408)
@@ -1989,6 +1989,7 @@
Prompt "=" "STRING_TOKEN" "\(" DP:Number "\)" ","
Help "=" "STRING_TOKEN" "\(" DH:Number "\)" ","
minMaxDateStepDefault[Val.date, 2]
+ { G:FLAGS "=" vfrDateFlags[DObj, G->getLine()] "," }
<<
mCVfrQuestionDB.RegisterOldDateQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);
DObj.SetQuestionId (QId);
@@ -2449,6 +2450,7 @@
Prompt "=" "STRING_TOKEN" "\(" SP:Number "\)" ","
Help "=" "STRING_TOKEN" "\(" SH:Number "\)" ","
minMaxTimeStepDefault[Val.time, 2]
+ { G:FLAGS "=" vfrTimeFlags[TObj, G->getLine()] "," }
<<
mCVfrQuestionDB.RegisterOldTimeQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);
TObj.SetQuestionId (QId);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2011-11-16 05:25:04
|
Revision: 2407
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2407&view=rev
Author: xfzyr
Date: 2011-11-16 05:24:51 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
Update ECC to catch multiple instances while Library Class name is same.
Reviewed-by: hchen30
Signed-off-by: yzeng15
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Ecc/Check.py
trunk/BaseTools/Source/Python/Ecc/EccToolError.py
Modified: trunk/BaseTools/Source/Python/Ecc/Check.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Check.py 2011-11-15 08:27:59 UTC (rev 2406)
+++ trunk/BaseTools/Source/Python/Ecc/Check.py 2011-11-16 05:24:51 UTC (rev 2407)
@@ -580,6 +580,7 @@
pass
# Check whether the unnecessary inclusion of library classes in the Inf file
+ # Check whether the unnecessary duplication of library classe names in the DSC file
def MetaDataFileCheckLibraryNoUse(self):
if EccGlobalData.gConfig.MetaDataFileCheckLibraryNoUse == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
EdkLogger.quiet("Checking for library instance not used ...")
@@ -588,7 +589,20 @@
for Record in RecordSet:
if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE, Record[1]):
EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE, OtherMsg="The Library Class [%s] is not used in any platform" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])
-
+ SqlCommand = """
+ select A.ID, A.Value1, A.BelongsToFile, A.StartLine, B.StartLine from Dsc as A left join Dsc as B
+ where A.Model = %s and B.Model = %s and A.Value3 = B.Value3 and A.Arch = B.Arch and A.ID <> B.ID
+ and A.Value1 = B.Value1 and A.StartLine <> B.StartLine and B.BelongsToFile = A.BelongsToFile""" \
+ % (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)
+ RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)
+ for Record in RecordSet:
+ if Record[3] and Record[4] and Record[3] != Record[4]:
+ SqlCommand = """select FullPath from File where ID = %s""" % (Record[2])
+ FilePathList = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
+ for FilePath in FilePathList:
+ if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, Record[1]):
+ EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, OtherMsg="The Library Class [%s] is duplicated in '%s' line %s and line %s." % (Record[1], FilePath, Record[3], Record[4]), BelongsToTable='Dsc', BelongsToItem=Record[0])
+
# Check whether an Inf file is specified in the FDF file, but not in the Dsc file, then the Inf file must be for a Binary module only
def MetaDataFileCheckBinaryInfInFdf(self):
if EccGlobalData.gConfig.MetaDataFileCheckBinaryInfInFdf == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
Modified: trunk/BaseTools/Source/Python/Ecc/EccToolError.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/EccToolError.py 2011-11-15 08:27:59 UTC (rev 2406)
+++ trunk/BaseTools/Source/Python/Ecc/EccToolError.py 2011-11-16 05:24:51 UTC (rev 2407)
@@ -94,6 +94,7 @@
ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE = 10014
ERROR_META_DATA_FILE_CHECK_PCD_TYPE = 10015
ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION = 10016
+ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE = 10017
ERROR_SPELLING_CHECK_ALL = 11000
@@ -171,6 +172,7 @@
ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT : "A library instance must be defined for all dependent library classes",
ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_ORDER : "The library Instances specified by the LibraryClasses sections should be listed in order of dependencies",
ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE : "There should be no unnecessary inclusion of library classes in the INF file",
+ ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE : "Duplicate Library Class Name found",
ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF : "An INF file is specified in the FDF file, but not in the DSC file, therefore the INF file must be for a Binary module only",
ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE : "Duplicate PCDs found",
ERROR_META_DATA_FILE_CHECK_PCD_FLASH : "PCD settings in the FDF file should only be related to flash",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-15 08:28:05
|
Revision: 2406
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2406&view=rev
Author: jsu1
Date: 2011-11-15 08:27:59 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
remove CPP conditional clause from StrDefs.h file as these files do not include function declarations
Reviewed-by: lgao4
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-15 07:21:21 UTC (rev 2405)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-15 08:27:59 UTC (rev 2406)
@@ -310,11 +310,14 @@
#ifndef _${File}_${Guid}
#define _${File}_${Guid}
+""")
+
+gAutoGenHCppPrologueString = """
#ifdef __cplusplus
extern "C" {
#endif
-""")
+"""
gAutoGenHEpilogueString = """
@@ -1970,6 +1973,7 @@
AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'}))
# header file Prologue
AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Guid':Info.Guid.replace('-','_')}))
+ AutoGenH.Append(gAutoGenHCppPrologueString)
if Info.AutoGenVersion >= 0x00010005:
# header files includes
AutoGenH.Append("#include <%s>\n" % gBasicHeaderFile)
@@ -2042,7 +2046,6 @@
StringH.Append(gAutoGenHeaderString.Replace({'FileName':FileName}))
StringH.Append(gAutoGenHPrologueString.Replace({'File':'STRDEFS', 'Guid':Info.Guid.replace('-','_')}))
CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, UniGenBinBuffer)
- StringH.Append("\n#ifdef __cplusplus\n}\n#endif\n")
StringH.Append("\n#endif\n")
AutoGenH.Append('#include "%s"\n' % FileName)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-11-15 07:21:27
|
Revision: 2405
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2405&view=rev
Author: gikidy
Date: 2011-11-15 07:21:21 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
Fix an issue while the !include file contain whole section content(with section name and entry), DSC parser cannot parse DSC file properly.
Signed-off-by: gikidy
Reviewed-by: yingke
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-15 07:06:19 UTC (rev 2404)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-11-15 07:21:21 UTC (rev 2405)
@@ -1302,7 +1302,10 @@
Records = IncludedFileTable.GetAll()
if Records:
self._Content[self._ContentIndex:self._ContentIndex] = Records
-
+ self._Content.pop(self._ContentIndex-1)
+ self._ValueList = None
+ self._ContentIndex -= 1
+
def __ProcessSkuId(self):
self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True)
for Value in self._ValueList]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|