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/Common/VpdInfoFile.py | |
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/Common/VpdInfoFile.py')
-rw-r--r-- | BaseTools/Source/Python/Common/VpdInfoFile.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py index 5559a88b97..b2ad5235bb 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -23,6 +23,7 @@ import subprocess import Common.GlobalData as GlobalData
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.Misc import SaveFileOnChange
+from Common.DataType import *
FILE_COMMENT_TEMPLATE = \
"""
@@ -67,9 +68,7 @@ FILE_COMMENT_TEMPLATE = \ # <NList> ::= <HexNumber> ["," <HexNumber>]*
#
class VpdInfoFile:
-
- ## The mapping dictionary from datum type to size string.
- _MAX_SIZE_TYPE = {"BOOLEAN":"1", "UINT8":"1", "UINT16":"2", "UINT32":"4", "UINT64":"8"}
+
_rVpdPcdLine = None
## Constructor
def __init__(self):
@@ -101,7 +100,7 @@ class VpdInfoFile: "Invalid max datum size for VPD PCD %s.%s" % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName))
elif Vpd.DatumType in ["BOOLEAN", "UINT8", "UINT16", "UINT32", "UINT64"]:
if Vpd.MaxDatumSize is None or Vpd.MaxDatumSize == "":
- Vpd.MaxDatumSize = VpdInfoFile._MAX_SIZE_TYPE[Vpd.DatumType]
+ Vpd.MaxDatumSize = MAX_SIZE_TYPE[Vpd.DatumType]
else:
if Vpd.MaxDatumSize <= 0:
EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,
|