diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-09-11 03:14:43 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-09-11 03:14:43 +0000 |
commit | fd171542e0aa89ac12a09d79608173f48019b14b (patch) | |
tree | b4e1320ab3bc1cb59355f9fcbc361f84ae0c4f0a /BaseTools/Source/Python/Common | |
parent | f22911b49e8be58d364f9e21f5af6bd3f0513cf7 (diff) | |
download | edk2-platforms-fd171542e0aa89ac12a09d79608173f48019b14b.tar.xz |
Sync basetools' source and binary files with r1707 of the basetools project.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rw-r--r-- | BaseTools/Source/Python/Common/DscClassObject.py | 9 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/FdfParserLite.py | 49 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/Misc.py | 12 |
3 files changed, 55 insertions, 15 deletions
diff --git a/BaseTools/Source/Python/Common/DscClassObject.py b/BaseTools/Source/Python/Common/DscClassObject.py index ddccf6507d..50b6cc5bce 100644 --- a/BaseTools/Source/Python/Common/DscClassObject.py +++ b/BaseTools/Source/Python/Common/DscClassObject.py @@ -385,10 +385,11 @@ class Dsc(DscObject): for IncludeFile in IncludeFiles:
if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_LIBRARIES, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- MergeArches(Libraries, NewItem, Arch)
+ if os.path.exists(Filename):
+ for NewItem in open(Filename, 'r').readlines():
+ if CleanString(NewItem) == '':
+ continue
+ MergeArches(Libraries, NewItem, Arch)
for Record in RecordSet:
if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
diff --git a/BaseTools/Source/Python/Common/FdfParserLite.py b/BaseTools/Source/Python/Common/FdfParserLite.py index 59006fa5c5..5099ed611c 100644 --- a/BaseTools/Source/Python/Common/FdfParserLite.py +++ b/BaseTools/Source/Python/Common/FdfParserLite.py @@ -1599,7 +1599,7 @@ class FdfParser(object): if not self.__GetNextWord():
return True
- if not self.__Token in ("SET", "FV", "FILE", "DATA"):
+ if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE"):
self.__UndoToken()
RegionObj.PcdOffset = self.__GetNextPcdName()
self.Profile.PcdDict[RegionObj.PcdOffset] = RegionObj.Offset + long(Fd.BaseAddress, 0)
@@ -1620,10 +1620,14 @@ class FdfParser(object): if not self.__GetNextWord():
return True
- if self.__Token == "FV":
+ elif self.__Token == "FV":
self.__UndoToken()
self.__GetRegionFvType( RegionObj)
+ elif self.__Token == "CAPSULE":
+ self.__UndoToken()
+ self.__GetRegionCapType( RegionObj)
+
elif self.__Token == "FILE":
self.__UndoToken()
self.__GetRegionFileType( RegionObj)
@@ -1664,7 +1668,38 @@ class FdfParser(object): raise Warning("expected FV name At Line ", self.FileName, self.CurrentLineNumber)
RegionObj.RegionDataList.append(self.__Token)
-
+
+ ## __GetRegionCapType() method
+ #
+ # Get region capsule data for region
+ #
+ # @param self The object pointer
+ # @param RegionObj for whom region data is got
+ #
+ def __GetRegionCapType(self, RegionObj):
+
+ if not self.__IsKeyword("CAPSULE"):
+ raise Warning("expected Keyword 'CAPSULE' at line", self.FileName, self.CurrentLineNumber)
+
+ if not self.__IsToken("="):
+ raise Warning("expected '=' at line", self.FileName, self.CurrentLineNumber)
+
+ if not self.__GetNextToken():
+ raise Warning("expected CAPSULE name at line", self.FileName, self.CurrentLineNumber)
+
+ RegionObj.RegionType = "CAPSULE"
+ RegionObj.RegionDataList.append(self.__Token)
+
+ while self.__IsKeyword("CAPSULE"):
+
+ if not self.__IsToken("="):
+ raise Warning("expected '=' at line", self.FileName, self.CurrentLineNumber)
+
+ if not self.__GetNextToken():
+ raise Warning("expected CAPSULE name at line", self.FileName, self.CurrentLineNumber)
+
+ RegionObj.RegionDataList.append(self.__Token)
+
## __GetRegionFileType() method
#
# Get region file data for region
@@ -2713,7 +2748,7 @@ class FdfParser(object): Arch = self.__SkippedChars.rstrip(".")
if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "COMMON"):
- raise Warning("Unknown Arch At line ", self.FileName, self.CurrentLineNumber)
+ raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
ModuleType = self.__GetModuleType()
@@ -2763,7 +2798,7 @@ class FdfParser(object): "DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \
"UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \
"SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \
- "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION"):
+ "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_DRIVER", "SMM_CORE"):
raise Warning("Unknown Module type At line ", self.FileName, self.CurrentLineNumber)
return self.__Token
@@ -2803,11 +2838,11 @@ class FdfParser(object): raise Warning("expected FILE At Line ", self.FileName, self.CurrentLineNumber)
if not self.__GetNextWord():
- raise Warning("expected FV type At Line ", self.FileName, self.CurrentLineNumber)
+ raise Warning("expected FFS type At Line ", self.FileName, self.CurrentLineNumber)
Type = self.__Token.strip().upper()
if Type not in ("RAW", "FREEFORM", "SEC", "PEI_CORE", "PEIM",\
- "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE"):
+ "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM_DXE_COMBO", "SMM", "SMM_CORE"):
raise Warning("Unknown FV type At line ", self.FileName, self.CurrentLineNumber)
if not self.__IsToken("="):
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index 14f6550f29..2c1041c55b 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -418,6 +418,14 @@ def RealPath(File, Dir='', OverrideDir=''): return NewFile def RealPath2(File, Dir='', OverrideDir=''): + if OverrideDir: + NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))] + if NewFile: + if OverrideDir[-1] == os.path.sep: + return NewFile[len(OverrideDir):], NewFile[0:len(OverrideDir)] + else: + return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)] + NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))] if NewFile: if Dir: @@ -428,10 +436,6 @@ def RealPath2(File, Dir='', OverrideDir=''): else: return NewFile, '' - if OverrideDir: - NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))] - if NewFile: - return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)] return None, None ## Check if gvien file exists or not |