diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-12 07:08:08 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-18 22:15:36 +0800 |
commit | 25598f8bdbd63dd96194fd3f43dd53dd814cd1c0 (patch) | |
tree | b21acd2cafb9bbde506daa9d1a1d7ea6addcddaf /BaseTools/Source/Python/GenFds | |
parent | 9eb87141eca12b1f15afa4b769af04d1395891c6 (diff) | |
download | edk2-25598f8bdbd63dd96194fd3f43dd53dd814cd1c0.tar.gz edk2-25598f8bdbd63dd96194fd3f43dd53dd814cd1c0.tar.bz2 edk2-25598f8bdbd63dd96194fd3f43dd53dd814cd1c0.zip |
BaseTools: merge towards minimum PCD MAX <something> methods
we have 5 different max val or max byte for PCDs.
refactor and remove 2 methods.
we need 3, as one computes for VOID* PCDs.
Cc: Bob Feng <bob.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FfsInfStatement.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 887619694d..37624f3fa9 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -47,14 +47,12 @@ import Common.GlobalData as GlobalData from DepexSection import DepexSection
from Common.Misc import SaveFileOnChange
from Common.Expression import *
-from Common.DataType import TAB_COMMON
+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
@@ -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." \
% (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))
|