summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/DataType.py
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-28 06:32:48 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-04 13:07:34 +0800
commitd0a0c52c221e5dcf82f24d4346c1cf52109d6dfb (patch)
tree093b255c1d0235ab8cbbea57be4ccbd0a37fecff /BaseTools/Source/Python/Common/DataType.py
parent31ff1c443e25d6bff758bdcd9a248a907cff651b (diff)
downloadedk2-d0a0c52c221e5dcf82f24d4346c1cf52109d6dfb.tar.gz
edk2-d0a0c52c221e5dcf82f24d4346c1cf52109d6dfb.tar.bz2
edk2-d0a0c52c221e5dcf82f24d4346c1cf52109d6dfb.zip
BaseTools: standardize GUID and pack size
currently GUID packing and pack size determination is spread throughout the code. This introduces a shared function and dict and routes all code paths through them. 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/DataType.py')
-rw-r--r--BaseTools/Source/Python/Common/DataType.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/Python/Common/DataType.py
index 56f5bfedd6..44e636f5ff 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -544,3 +544,14 @@ SECTIONS_HAVE_ITEM_AFTER_ARCH_SET = {TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.uppe
PCDS_DYNAMICEX_HII.upper(),
TAB_BUILD_OPTIONS.upper(),
TAB_INCLUDES.upper()}
+
+#
+# pack codes as used in PcdDb and elsewhere
+#
+PACK_PATTERN_GUID = '=LHHBBBBBBBB'
+PACK_CODE_BY_SIZE = {8:'=Q',
+ 4:'=L',
+ 2:'=H',
+ 1:'=B',
+ 0:'=B',
+ 16:""}