]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools: merge towards minimum PCD MAX <something> methods
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FfsInfStatement.py
index 887619694df3ce00a6aeb6cca9625ec0af37d0e6..37624f3fa9d4e0b9b357b65627d89bbb99aabef7 100644 (file)
@@ -47,14 +47,12 @@ import Common.GlobalData as GlobalData
 from DepexSection import DepexSection\r
 from Common.Misc import SaveFileOnChange\r
 from Common.Expression import *\r
-from Common.DataType import TAB_COMMON\r
+from Common.DataType import *\r
 \r
 ## generate FFS from INF\r
 #\r
 #\r
 class FfsInfStatement(FfsInfStatementClassObject):\r
-    ## The mapping dictionary from datum type to its maximum number.\r
-    _MAX_SIZE_TYPE = {"BOOLEAN":0x01, "UINT8":0xFF, "UINT16":0xFFFF, "UINT32":0xFFFFFFFF, "UINT64":0xFFFFFFFFFFFFFFFF}\r
     ## The constructor\r
     #\r
     #   @param  self        The object pointer\r
@@ -333,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." \\r
                                     % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, int(MaxDatumSize) - int(Pcd.MaxDatumSize)))\r
             else:\r
-                if PcdValueInDscOrFdf > FfsInfStatement._MAX_SIZE_TYPE[Pcd.DatumType] \\r
-                    or PcdValueInImg > FfsInfStatement._MAX_SIZE_TYPE[Pcd.DatumType]:\r
+                if PcdValueInDscOrFdf > MAX_VAL_TYPE[Pcd.DatumType] \\r
+                    or PcdValueInImg > MAX_VAL_TYPE[Pcd.DatumType]:\r
                     EdkLogger.error("GenFds", GENFDS_ERROR, "The size of %s type PCD '%s.%s' doesn't match its data type." \\r
                                     % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName))\r
             self.PatchPcds.append((Pcd, DefaultValue))\r