X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FFfsInfStatement.py;h=37624f3fa9d4e0b9b357b65627d89bbb99aabef7;hp=8ae29b285d06d740e74f815c16264c7764e547bc;hb=25598f8bdbd63dd96194fd3f43dd53dd814cd1c0;hpb=80bfbd3e832019ec733d04931079e956466066ba diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 8ae29b285d..37624f3fa9 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -47,13 +47,12 @@ import Common.GlobalData as GlobalData from DepexSection import DepexSection from Common.Misc import SaveFileOnChange from Common.Expression import * +from Common.DataType import * ## generate FFS from INF # # class FfsInfStatement(FfsInfStatementClassObject): - ## The mapping dictionary from datum type to its maximum number. - _MAX_SIZE_TYPE = {"BOOLEAN":0x01, "UINT8":0xFF, "UINT16":0xFFFF, "UINT32":0xFFFFFFFF, "UINT64":0xFFFFFFFFFFFFFFFF} ## The constructor # # @param self The object pointer @@ -205,7 +204,7 @@ class FfsInfStatement(FfsInfStatementClassObject): self.ShadowFromInfFile = Inf.Shadow else: - Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] + Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] self.BaseName = Inf.BaseName self.ModuleGuid = Inf.Guid self.ModuleType = Inf.ModuleType @@ -332,8 +331,8 @@ class FfsInfStatement(FfsInfStatementClassObject): EdkLogger.error("GenFds", GENFDS_ERROR, "The size of VOID* type PCD '%s.%s' exceeds its maximum size %d bytes." \ % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, int(MaxDatumSize) - int(Pcd.MaxDatumSize))) else: - if PcdValueInDscOrFdf > FfsInfStatement._MAX_SIZE_TYPE[Pcd.DatumType] \ - or PcdValueInImg > FfsInfStatement._MAX_SIZE_TYPE[Pcd.DatumType]: + if PcdValueInDscOrFdf > MAX_VAL_TYPE[Pcd.DatumType] \ + or PcdValueInImg > MAX_VAL_TYPE[Pcd.DatumType]: EdkLogger.error("GenFds", GENFDS_ERROR, "The size of %s type PCD '%s.%s' doesn't match its data type." \ % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) self.PatchPcds.append((Pcd, DefaultValue)) @@ -570,7 +569,7 @@ class FfsInfStatement(FfsInfStatementClassObject): RuleName = 'RULE' + \ '.' + \ - 'COMMON' + \ + TAB_COMMON + \ '.' + \ self.ModuleType.upper() @@ -612,7 +611,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # the file name FILE_GUIDmodule.inf, then PlatformDataBase.Modules use FILE_GUIDmodule.inf as key, # but the path (self.MetaFile.Path) is the real path # - for key in PlatformDataBase.Modules.keys(): + for key in PlatformDataBase.Modules: if InfFileKey == str((PlatformDataBase.Modules[key]).MetaFile.Path): DscArchList.append (Arch) break