]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: DataType - cleanup list constants
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index 73ab60d25312067aeeb7e6a996d60546ce1aab59..86caeacb48745efdf146b12a4d4aa2706622a184 100644 (file)
@@ -507,8 +507,8 @@ class WorkspaceAutoGen(AutoGen):
                         if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) == SinglePcd:\r
                             for item in GlobalData.MixedPcd[SinglePcd]:\r
                                 Pcd_Type = item[0].split('_')[-1]\r
-                                if (Pcd_Type == BuildData.Pcds[key].Type) or (Pcd_Type == TAB_PCDS_DYNAMIC_EX and BuildData.Pcds[key].Type in GenC.gDynamicExPcd) or \\r
-                                   (Pcd_Type == TAB_PCDS_DYNAMIC and BuildData.Pcds[key].Type in GenC.gDynamicPcd):\r
+                                if (Pcd_Type == BuildData.Pcds[key].Type) or (Pcd_Type == TAB_PCDS_DYNAMIC_EX and BuildData.Pcds[key].Type in PCD_DYNAMIC_EX_TYPE_SET) or \\r
+                                   (Pcd_Type == TAB_PCDS_DYNAMIC and BuildData.Pcds[key].Type in PCD_DYNAMIC_TYPE_SET):\r
                                     Value = BuildData.Pcds[key]\r
                                     Value.TokenCName = BuildData.Pcds[key].TokenCName + '_' + Pcd_Type\r
                                     if len(key) == 2:\r
@@ -1362,8 +1362,8 @@ class PlatformAutoGen(AutoGen):
                 if (self.Platform.Pcds[key].TokenCName, self.Platform.Pcds[key].TokenSpaceGuidCName) == SinglePcd:\r
                     for item in GlobalData.MixedPcd[SinglePcd]:\r
                         Pcd_Type = item[0].split('_')[-1]\r
-                        if (Pcd_Type == self.Platform.Pcds[key].Type) or (Pcd_Type == TAB_PCDS_DYNAMIC_EX and self.Platform.Pcds[key].Type in GenC.gDynamicExPcd) or \\r
-                           (Pcd_Type == TAB_PCDS_DYNAMIC and self.Platform.Pcds[key].Type in GenC.gDynamicPcd):\r
+                        if (Pcd_Type == self.Platform.Pcds[key].Type) or (Pcd_Type == TAB_PCDS_DYNAMIC_EX and self.Platform.Pcds[key].Type in PCD_DYNAMIC_EX_TYPE_SET) or \\r
+                           (Pcd_Type == TAB_PCDS_DYNAMIC and self.Platform.Pcds[key].Type in PCD_DYNAMIC_TYPE_SET):\r
                             Value = self.Platform.Pcds[key]\r
                             Value.TokenCName = self.Platform.Pcds[key].TokenCName + '_' + Pcd_Type\r
                             if len(key) == 2:\r
@@ -1403,7 +1403,7 @@ class PlatformAutoGen(AutoGen):
                 # Check the PCD from DSC or not \r
                 PcdFromModule.IsFromDsc = (PcdFromModule.TokenCName, PcdFromModule.TokenSpaceGuidCName) in self.Platform.Pcds\r
 \r
-                if PcdFromModule.Type in GenC.gDynamicPcd or PcdFromModule.Type in GenC.gDynamicExPcd:\r
+                if PcdFromModule.Type in PCD_DYNAMIC_TYPE_SET or PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                     if F.Path not in FdfModuleList:\r
                         # If one of the Source built modules listed in the DSC is not listed \r
                         # in FDF modules, and the INF lists a PCD can only use the PcdsDynamic \r
@@ -1413,7 +1413,7 @@ class PlatformAutoGen(AutoGen):
                         # be included in a flash image in order to be functional. These Dynamic \r
                         # PCD will not be added into the Database unless it is used by other \r
                         # modules that are included in the FDF file.\r
-                        if PcdFromModule.Type in GenC.gDynamicPcd and \\r
+                        if PcdFromModule.Type in PCD_DYNAMIC_TYPE_SET and \\r
                             PcdFromModule.IsFromBinaryInf == False:\r
                             # Print warning message to let the developer make a determine.\r
                             continue\r
@@ -1422,7 +1422,7 @@ class PlatformAutoGen(AutoGen):
                         # access method (it is only listed in the DEC file that declares the \r
                         # PCD as PcdsDynamicEx), then DO NOT break the build; DO NOT add the \r
                         # PCD to the Platform's PCD Database.\r
-                        if PcdFromModule.Type in GenC.gDynamicExPcd:\r
+                        if PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                             continue\r
                     #\r
                     # If a dynamic PCD used by a PEM module/PEI module & DXE module,\r
@@ -1464,7 +1464,7 @@ class PlatformAutoGen(AutoGen):
                     PcdFromModule.IsFromBinaryInf = True\r
                     PcdFromModule.IsFromDsc = False\r
                     # Only allow the DynamicEx and Patchable PCD in AsBuild INF\r
-                    if PcdFromModule.Type not in GenC.gDynamicExPcd and PcdFromModule.Type not in TAB_PCDS_PATCHABLE_IN_MODULE:\r
+                    if PcdFromModule.Type not in PCD_DYNAMIC_EX_TYPE_SET and PcdFromModule.Type not in TAB_PCDS_PATCHABLE_IN_MODULE:\r
                         EdkLogger.error("build", AUTOGEN_ERROR, "PCD setting error",\r
                                         File=self.MetaFile,\r
                                         ExtraData="\n\tExisted %s PCD %s in:\n\t\t%s\n"\r
@@ -1474,11 +1474,11 @@ class PlatformAutoGen(AutoGen):
                         NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))\r
                     if M.ModuleType in SUP_MODULE_SET_PEI:\r
                         PcdFromModule.Phase = "PEI"\r
-                    if PcdFromModule not in self._DynaPcdList_ and PcdFromModule.Type in GenC.gDynamicExPcd:\r
+                    if PcdFromModule not in self._DynaPcdList_ and PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                         self._DynaPcdList_.append(PcdFromModule)\r
                     elif PcdFromModule not in self._NonDynaPcdList_ and PcdFromModule.Type in TAB_PCDS_PATCHABLE_IN_MODULE:\r
                         self._NonDynaPcdList_.append(PcdFromModule)\r
-                    if PcdFromModule in self._DynaPcdList_ and PcdFromModule.Phase == 'PEI' and PcdFromModule.Type in GenC.gDynamicExPcd:\r
+                    if PcdFromModule in self._DynaPcdList_ and PcdFromModule.Phase == 'PEI' and PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                         # Overwrite the phase of any the same PCD existing, if Phase is PEI.\r
                         # It is to solve the case that a dynamic PCD used by a PEM module/PEI \r
                         # module & DXE module at a same time.\r
@@ -2065,28 +2065,28 @@ class PlatformAutoGen(AutoGen):
             #\r
             for Pcd in self.DynamicPcdList:\r
                 if Pcd.Phase == "PEI":\r
-                    if Pcd.Type in [TAB_PCDS_DYNAMIC, "DynamicDefault", "DynamicVpd", "DynamicHii"]:\r
+                    if Pcd.Type in PCD_DYNAMIC_TYPE_SET:\r
                         EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
                         self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
                         TokenNumber += 1\r
 \r
             for Pcd in self.DynamicPcdList:\r
                 if Pcd.Phase == "PEI":\r
-                    if Pcd.Type in [TAB_PCDS_DYNAMIC_EX, "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:\r
+                    if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                         EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
                         self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
                         TokenNumber += 1\r
 \r
             for Pcd in self.DynamicPcdList:\r
                 if Pcd.Phase == "DXE":\r
-                    if Pcd.Type in [TAB_PCDS_DYNAMIC, "DynamicDefault", "DynamicVpd", "DynamicHii"]:\r
+                    if Pcd.Type in PCD_DYNAMIC_TYPE_SET:\r
                         EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
                         self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
                         TokenNumber += 1\r
 \r
             for Pcd in self.DynamicPcdList:\r
                 if Pcd.Phase == "DXE":\r
-                    if Pcd.Type in [TAB_PCDS_DYNAMIC_EX, "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:\r
+                    if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                         EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
                         self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
                         TokenNumber += 1\r
@@ -2382,7 +2382,7 @@ class PlatformAutoGen(AutoGen):
                 ToPcd.MaxDatumSize = str(len(Value) - 1)\r
 \r
         # apply default SKU for dynamic PCDS if specified one is not available\r
-        if (ToPcd.Type in PCD_DYNAMIC_TYPE_LIST or ToPcd.Type in PCD_DYNAMIC_EX_TYPE_LIST) \\r
+        if (ToPcd.Type in PCD_DYNAMIC_TYPE_SET or ToPcd.Type in PCD_DYNAMIC_EX_TYPE_SET) \\r
             and ToPcd.SkuInfoList in [None, {}, '']:\r
             if self.Platform.SkuName in self.Platform.SkuIds:\r
                 SkuName = self.Platform.SkuName\r
@@ -3931,7 +3931,7 @@ class ModuleAutoGen(AutoGen):
             if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
                 PatchablePcds += [Pcd]\r
                 PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, TAB_PCDS_PATCHABLE_IN_MODULE))\r
-            elif Pcd.Type in GenC.gDynamicExPcd:\r
+            elif Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
                 if Pcd not in Pcds:\r
                     Pcds += [Pcd]\r
                     PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, TAB_PCDS_DYNAMIC_EX))\r