diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-28 06:32:39 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-04 13:03:08 +0800 |
commit | 8b88b1634fa91fc8c3faedae8fec85c52d5a9260 (patch) | |
tree | fa81aae34bc3eb43e42667356c9b1db0ebfe0474 /BaseTools/Source/Python | |
parent | 032a7c9fe26dfbab91ec83baa46d4a6b96878e88 (diff) | |
download | edk2-8b88b1634fa91fc8c3faedae8fec85c52d5a9260.tar.gz edk2-8b88b1634fa91fc8c3faedae8fec85c52d5a9260.tar.bz2 edk2-8b88b1634fa91fc8c3faedae8fec85c52d5a9260.zip |
BaseTools: AutoGen - move function to clean file namespace
the function is only used in one other function.
just move it there.
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')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenPcdDb.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py index 5ccdf1ccb7..8053202289 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -235,32 +235,6 @@ ${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit = { #endif
""")
-## PackGuid
-#
-# Pack the GUID value in C structure format into data array
-#
-# @param GuidStructureValue: The GUID value in C structure format
-#
-# @retval Buffer: a data array contains the Guid
-#
-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
-
## DbItemList
#
# The class holds the Pcd database items. ItemSize if not zero should match the item datum type in the C structure.
@@ -303,6 +277,32 @@ class DbItemList: return self.ListSize
def PackData(self):
+ ## PackGuid
+ #
+ # Pack the GUID value in C structure format into data array
+ #
+ # @param GuidStructureValue: The GUID value in C structure format
+ #
+ # @retval Buffer: a data array contains the Guid
+ #
+ 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
+
if self.ItemSize == 8:
PackStr = "=Q"
elif self.ItemSize == 4:
|