]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/BPDG/GenVpd.py
BaseTools: create and use a standard shared variable for '*'
[mirror_edk2.git] / BaseTools / Source / Python / BPDG / GenVpd.py
index d7852d29eed09df7b016ab7fadc8aff991973146..e5da47f95e63b10737aa9287ebf65c1fc19175d6 100644 (file)
@@ -21,7 +21,7 @@ import array
 import re\r
 from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from struct import *\r
-from Common.DataType import MAX_SIZE_TYPE, MAX_VAL_TYPE\r
+from Common.DataType import MAX_SIZE_TYPE, MAX_VAL_TYPE, TAB_STAR\r
 import Common.EdkLogger as EdkLogger\r
 import Common.BuildToolError as BuildToolError\r
 \r
@@ -87,7 +87,7 @@ class PcdEntry:
     #  for both hexadecimal and decimal.\r
     #\r
     def _GenOffsetValue(self):\r
-        if self.PcdOffset != "*" :\r
+        if self.PcdOffset != TAB_STAR:\r
             try:\r
                 self.PcdBinOffset = int (self.PcdOffset)\r
             except:\r
@@ -423,7 +423,7 @@ class GenVPD :
                     Alignment = 1\r
 \r
                 PCD.Alignment = Alignment\r
-                if PCD.PcdOffset != '*':\r
+                if PCD.PcdOffset != TAB_STAR:\r
                     if PCD.PcdOccupySize % Alignment != 0:\r
                         if PCD.PcdUnpackValue.startswith("{"):\r
                             EdkLogger.warn("BPDG", "The offset value of PCD %s is not 8-byte aligned!" %(PCD.PcdCName), File=self.InputFileName)\r
@@ -469,7 +469,7 @@ class GenVPD :
     def FormatFileLine (self) :\r
 \r
         for eachPcd in self.FileLinesList :\r
-            if eachPcd.PcdOffset != '*' :\r
+            if eachPcd.PcdOffset != TAB_STAR :\r
                 # Use pcd's Offset value as key, and pcd's Value as value\r
                 self.PcdFixedOffsetSizeList.append(eachPcd)\r
             else :\r
@@ -484,7 +484,7 @@ class GenVPD :
     def FixVpdOffset (self):\r
         # At first, the offset should start at 0\r
         # Sort fixed offset list in order to find out where has free spaces for the pcd's offset\r
-        # value is "*" to insert into.\r
+        # value is TAB_STAR to insert into.\r
 \r
         self.PcdFixedOffsetSizeList.sort(key=lambda x: x.PcdBinOffset)\r
 \r
@@ -502,7 +502,7 @@ class GenVPD :
                         self.PcdUnknownOffsetList[index+i -1 ], self.PcdUnknownOffsetList[index+i] = self.PcdUnknownOffsetList[index+i], self.PcdUnknownOffsetList[index+i -1]\r
 \r
         #\r
-        # Process all Offset value are "*"\r
+        # Process all Offset value are TAB_STAR\r
         #\r
         if (len(self.PcdFixedOffsetSizeList) == 0) and (len(self.PcdUnknownOffsetList) != 0) :\r
             # The offset start from 0\r
@@ -571,7 +571,7 @@ class GenVPD :
                         eachUnfixedPcd      = self.PcdUnknownOffsetList[countOfUnfixedList]\r
                         needFixPcdSize      = eachUnfixedPcd.PcdOccupySize\r
                         # Not been fixed\r
-                        if eachUnfixedPcd.PcdOffset == '*' :\r
+                        if eachUnfixedPcd.PcdOffset == TAB_STAR :\r
                             if LastOffset % eachUnfixedPcd.Alignment != 0:\r
                                 LastOffset = (LastOffset / eachUnfixedPcd.Alignment + 1) * eachUnfixedPcd.Alignment\r
                             # The offset un-fixed pcd can write into this free space\r