From 25598f8bdbd63dd96194fd3f43dd53dd814cd1c0 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Thu, 12 Apr 2018 07:08:08 +0800 Subject: BaseTools: merge towards minimum PCD MAX 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 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Common/VpdInfoFile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/Common/VpdInfoFile.py') 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 = \ # ::= ["," ]* # 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, -- cgit v1.2.3