diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-28 06:32:41 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-04 13:03:09 +0800 |
commit | d3054be59ef0a4b007064c9d7844c1fbeed4443f (patch) | |
tree | f8539b710765c4c0542bd2abf218756e19606859 /BaseTools | |
parent | a2e721704bb5ee1ffd293711a02ac0c650d7cdd5 (diff) | |
download | edk2-d3054be59ef0a4b007064c9d7844c1fbeed4443f.zip edk2-d3054be59ef0a4b007064c9d7844c1fbeed4443f.tar.gz edk2-d3054be59ef0a4b007064c9d7844c1fbeed4443f.tar.bz2 |
BaseTools: Refactor to share GUID packing function
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')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenPcdDb.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py index 8053202..aee722d 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -21,6 +21,7 @@ from Common.VariableAttributes import VariableAttributes import copy
from struct import unpack
from Common.DataType import *
+from GenVar import PackGUID
DATABASE_VERSION = 7
@@ -287,21 +288,7 @@ class DbItemList: #
def PackGuid(GuidStructureValue):
GuidString = GuidStructureStringToGuidString(GuidStructureValue)
- Guid = GuidString.split('-')
- Buffer = pack('=LHHBBBBBBBB',
- int(Guid[0], 16),
- int(Guid[1], 16),
- int(Guid[2], 16),
- int(Guid[3][-4:-2], 16),
- int(Guid[3][-2:], 16),
- int(Guid[4][-12:-10], 16),
- int(Guid[4][-10:-8], 16),
- int(Guid[4][-8:-6], 16),
- int(Guid[4][-6:-4], 16),
- int(Guid[4][-4:-2], 16),
- int(Guid[4][-2:], 16)
- )
- return Buffer
+ return PackGUID(GuidString.split('-'))
if self.ItemSize == 8:
PackStr = "=Q"
|