Sync BaseTools Trunk (version r2524) to EDKII main trunk.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liu Yingke <yingke.d.liu@intel.com>
Reviewed-by: Yurui Zeng <yurui.zeng@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13353 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2012-05-23 08:27:14 +00:00
parent 74dee93181
commit 25918452ed
38 changed files with 63 additions and 39 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4506,12 +4506,12 @@ RELEASE_XCODE32_IA32_CC_FLAGS = -arch i386 -Oz -combine -mms-bitfields -fshor
# X64 definitions - still a work in progress. This tool chain does not produce # X64 definitions - still a work in progress. This tool chain does not produce
# the correct ABI, it is just used to compile the code.... # the correct ABI, it is just used to compile the code....
################## ##################
*_XCODE32_X64_CC_PATH = gcc-4.2 *_XCODE32_X64_CC_PATH = gcc
*_XCODE32_X64_SLINK_PATH = libtool *_XCODE32_X64_SLINK_PATH = libtool
*_XCODE32_X64_DLINK_PATH = ld *_XCODE32_X64_DLINK_PATH = ld
*_XCODE32_X64_ASM_PATH = as *_XCODE32_X64_ASM_PATH = as
*_XCODE32_X64_PP_PATH = gcc-4.2 *_XCODE32_X64_PP_PATH = gcc
*_XCODE32_X64_VFRPP_PATH = gcc-4.2 *_XCODE32_X64_VFRPP_PATH = gcc
*_XCODE32_X64_ASL_PATH = iasl *_XCODE32_X64_ASL_PATH = iasl
*_XCODE32_X64_ASLCC_PATH = gcc *_XCODE32_X64_ASLCC_PATH = gcc
*_XCODE32_X64_ASLPP_PATH = gcc *_XCODE32_X64_ASLPP_PATH = gcc

View File

@ -785,7 +785,7 @@ Returns:
Offset = 0; Offset = 0;
FileBuffer = NULL; FileBuffer = NULL;
if (CompareGuid (VendorGuid, &mEfiCrc32SectionGuid) == 0) { if (CompareGuid (VendorGuid, &mZeroGuid) == 0) {
Offset = sizeof (CRC32_SECTION_HEADER); Offset = sizeof (CRC32_SECTION_HEADER);
} else { } else {
Offset = sizeof (EFI_GUID_DEFINED_SECTION); Offset = sizeof (EFI_GUID_DEFINED_SECTION);
@ -837,7 +837,7 @@ Returns:
// //
// Now data is in FileBuffer + Offset // Now data is in FileBuffer + Offset
// //
if (CompareGuid (VendorGuid, &mEfiCrc32SectionGuid) == 0) { if (CompareGuid (VendorGuid, &mZeroGuid) == 0) {
// //
// Default Guid section is CRC32. // Default Guid section is CRC32.
// //
@ -1222,10 +1222,6 @@ Returns:
VerboseMsg ("Compress method is %s", mCompressionTypeName [SectCompSubType]); VerboseMsg ("Compress method is %s", mCompressionTypeName [SectCompSubType]);
} else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_GUID_DEFINED]) == 0) { } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_GUID_DEFINED]) == 0) {
SectType = EFI_SECTION_GUID_DEFINED; SectType = EFI_SECTION_GUID_DEFINED;
if (CompareGuid (&VendorGuid, &mZeroGuid) == 0) {
memcpy (&VendorGuid, &mEfiCrc32SectionGuid, sizeof (EFI_GUID));
}
if ((SectGuidAttribute & EFI_GUIDED_SECTION_NONE) != 0) { if ((SectGuidAttribute & EFI_GUIDED_SECTION_NONE) != 0) {
// //
@ -1349,7 +1345,7 @@ Returns:
break; break;
case EFI_SECTION_GUID_DEFINED: case EFI_SECTION_GUID_DEFINED:
if (InputFileAlign != NULL && (CompareGuid (&VendorGuid, &mEfiCrc32SectionGuid) != 0)) { if (InputFileAlign != NULL && (CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
// //
// Only process alignment for the default known CRC32 guided section. // Only process alignment for the default known CRC32 guided section.
// For the unknown guided section, the alignment is processed when the dummy all section (EFI_SECTION_ALL) is generated. // For the unknown guided section, the alignment is processed when the dummy all section (EFI_SECTION_ALL) is generated.

View File

@ -14,4 +14,4 @@
**/ **/
#define __BUILD_VERSION "Build 2518" #define __BUILD_VERSION "Build 2524"

View File

@ -292,12 +292,12 @@ class WorkspaceAutoGen(AutoGen):
for Arch in self.ArchList: for Arch in self.ArchList:
Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain] Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
DecPcds = set() DecPcds = {}
PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch) PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
Pkgs = PGen.PackageList Pkgs = PGen.PackageList
for Pkg in Pkgs: for Pkg in Pkgs:
for Pcd in Pkg.Pcds.keys(): for Pcd in Pkg.Pcds:
DecPcds.add((Pcd[0], Pcd[1])) DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
Platform.IsPlatformPcdDeclared(DecPcds) Platform.IsPlatformPcdDeclared(DecPcds)
Platform.SkuName = self.SkuId Platform.SkuName = self.SkuId

View File

@ -226,7 +226,7 @@ class PcdEntry:
for Index in xrange(len(ValueList)): for Index in xrange(len(ValueList)):
Value = None Value = None
if ValueList[Index].startswith('0x'): if ValueList[Index].lower().startswith('0x'):
# translate hex value # translate hex value
try: try:
Value = int(ValueList[Index], 16) Value = int(ValueList[Index], 16)

View File

@ -13,4 +13,4 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
gBUILD_VERSION = "Build 2518" gBUILD_VERSION = "Build 2524"

View File

@ -256,9 +256,12 @@ class ValueExpression(object):
if self.__IsNumberToken(): if self.__IsNumberToken():
return self._Expr return self._Expr
Token = self._GetToken() try:
if type(Token) == type('') and Token.startswith('{') and Token.endswith('}') and self._Idx >= self._Len: Token = self._GetToken()
return self._Expr if type(Token) == type('') and Token.startswith('{') and Token.endswith('}') and self._Idx >= self._Len:
return self._Expr
except BadExpression:
pass
self._Idx = 0 self._Idx = 0
self._Token = '' self._Token = ''

View File

@ -249,6 +249,7 @@ class GuidSectionClassObject (SectionClassObject) :
self.SectionType = None self.SectionType = None
self.ProcessRequired = False self.ProcessRequired = False
self.AuthStatusValid = False self.AuthStatusValid = False
self.ExtraHeaderSize = -1
self.FvAddr = [] self.FvAddr = []
self.FvParentAddr = None self.FvParentAddr = None
self.IncludeFvSection = False self.IncludeFvSection = False

View File

@ -2867,6 +2867,7 @@ class FdfParser:
GuidSectionObj.SectionType = "GUIDED" GuidSectionObj.SectionType = "GUIDED"
GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"] GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]
GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"] GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"]
GuidSectionObj.ExtraHeaderSize = AttribDict["EXTRA_HEADER_SIZE"]
# Recursive sections... # Recursive sections...
while True: while True:
IsLeafSection = self.__GetLeafSection(GuidSectionObj) IsLeafSection = self.__GetLeafSection(GuidSectionObj)
@ -2894,23 +2895,26 @@ class FdfParser:
AttribDict = {} AttribDict = {}
AttribDict["PROCESSING_REQUIRED"] = "NONE" AttribDict["PROCESSING_REQUIRED"] = "NONE"
AttribDict["AUTH_STATUS_VALID"] = "NONE" AttribDict["AUTH_STATUS_VALID"] = "NONE"
if self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID"): AttribDict["EXTRA_HEADER_SIZE"] = -1
while self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID") \
or self.__IsKeyword("EXTRA_HEADER_SIZE"):
AttribKey = self.__Token AttribKey = self.__Token
if not self.__IsToken("="): if not self.__IsToken("="):
raise Warning("expected '='", self.FileName, self.CurrentLineNumber) raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"): if not self.__GetNextToken():
raise Warning("expected TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNumber) raise Warning("expected TRUE(1)/FALSE(0)/Number", self.FileName, self.CurrentLineNumber)
AttribDict[AttribKey] = self.__Token elif AttribKey == "EXTRA_HEADER_SIZE":
Base = 10
if self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID"): if self.__Token[0:2].upper() == "0X":
AttribKey = self.__Token Base = 16
try:
if not self.__IsToken("="): AttribDict[AttribKey] = int(self.__Token, Base)
raise Warning("expected '='") continue
except ValueError:
if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"): raise Warning("expected Number", self.FileName, self.CurrentLineNumber)
elif self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
raise Warning("expected TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNumber) raise Warning("expected TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNumber)
AttribDict[AttribKey] = self.__Token AttribDict[AttribKey] = self.__Token
@ -3712,6 +3716,7 @@ class FdfParser:
GuidSectionObj.SectionType = "GUIDED" GuidSectionObj.SectionType = "GUIDED"
GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"] GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]
GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"] GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"]
GuidSectionObj.ExtraHeaderSize = AttribDict["EXTRA_HEADER_SIZE"]
# Efi sections... # Efi sections...
while True: while True:

View File

@ -193,7 +193,10 @@ class GuidSection(GuidSectionClassObject) :
Attribute = [] Attribute = []
HeaderLength = None HeaderLength = None
if self.ProcessRequired == "NONE": if self.ExtraHeaderSize != -1:
HeaderLength = str(self.ExtraHeaderSize)
if self.ProcessRequired == "NONE" and HeaderLength == None:
if TempFileSize > InputFileSize and TempFileSize % 4 == 0: if TempFileSize > InputFileSize and TempFileSize % 4 == 0:
FileHandleIn.seek(0) FileHandleIn.seek(0)
BufferIn = FileHandleIn.read() BufferIn = FileHandleIn.read()
@ -218,7 +221,7 @@ class GuidSection(GuidSectionClassObject) :
if self.ProcessRequired in ("TRUE", "1"): if self.ProcessRequired in ("TRUE", "1"):
if 'PROCESSING_REQUIRED' not in Attribute: if 'PROCESSING_REQUIRED' not in Attribute:
Attribute.append('PROCESSING_REQUIRED') Attribute.append('PROCESSING_REQUIRED')
HeaderLength = None
if self.AuthStatusValid in ("TRUE", "1"): if self.AuthStatusValid in ("TRUE", "1"):
Attribute.append('AUTH_STATUS_VALID') Attribute.append('AUTH_STATUS_VALID')
GenFdsGlobalVariable.GenerateSection(OutputFile, [TempFile], Section.Section.SectionType['GUIDED'], GenFdsGlobalVariable.GenerateSection(OutputFile, [TempFile], Section.Section.SectionType['GUIDED'],

View File

@ -17,4 +17,4 @@
Build version information Build version information
''' '''
gBUILD_VERSION = "Build 2518" gBUILD_VERSION = "Build 2524"

View File

@ -852,6 +852,21 @@ class DscBuildData(PlatformBuildClassObject):
EdkLogger.error('build', PARSER_ERROR, EdkLogger.error('build', PARSER_ERROR,
"Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName), "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),
File=self.MetaFile, Line=Dummy4) File=self.MetaFile, Line=Dummy4)
PcdValue = ''
if PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
if DecPcds[PcdCName, TokenSpaceGuid].DatumType == "VOID*":
PcdValue = AnalyzeVpdPcdData(Setting)[2]
else:
PcdValue = AnalyzeVpdPcdData(Setting)[1]
elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):
PcdValue = AnalyzeHiiPcdData(Setting)[3]
else:
PcdValue = AnalyzePcdData(Setting)[0]
if PcdValue:
Valid, ErrStr = CheckPcdDatum(DecPcds[PcdCName, TokenSpaceGuid].DatumType, PcdValue)
if not Valid:
EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=Dummy4,
ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
_Macros = property(_GetMacros) _Macros = property(_GetMacros)
Arch = property(_GetArch, _SetArch) Arch = property(_GetArch, _SetArch)

View File

@ -39,6 +39,7 @@ from Common.DataType import TAB_SLASH
from Common.DataType import TAB_SPACE_SPLIT from Common.DataType import TAB_SPACE_SPLIT
from Common.DataType import TAB_BRG_PCD from Common.DataType import TAB_BRG_PCD
from Common.DataType import TAB_BRG_LIBRARY from Common.DataType import TAB_BRG_LIBRARY
from Common.DataType import TAB_BACK_SLASH
## Pattern to extract contents in EDK DXS files ## Pattern to extract contents in EDK DXS files
gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL) gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)
@ -191,11 +192,11 @@ def FileLinesSplit(Content=None, MaxLength=None):
while len(Line.rstrip()) > MaxLength: while len(Line.rstrip()) > MaxLength:
LineSpaceIndex = Line.rfind(TAB_SPACE_SPLIT, 0, MaxLength) LineSpaceIndex = Line.rfind(TAB_SPACE_SPLIT, 0, MaxLength)
LineSlashIndex = Line.rfind(TAB_SLASH, 0, MaxLength) LineSlashIndex = Line.rfind(TAB_SLASH, 0, MaxLength)
LineBreakIndex = MaxLength LineBackSlashIndex = Line.rfind(TAB_BACK_SLASH, 0, MaxLength)
if LineSpaceIndex > LineSlashIndex: if max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex) > 0:
LineBreakIndex = LineSpaceIndex LineBreakIndex = max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex)
elif LineSlashIndex > LineSpaceIndex: else:
LineBreakIndex = LineSlashIndex LineBreakIndex = MaxLength
NewContentList.append(Line[:LineBreakIndex]) NewContentList.append(Line[:LineBreakIndex])
Line = Line[LineBreakIndex:] Line = Line[LineBreakIndex:]
if Line: if Line: