]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/GenC.py
BaseTools: Support Structure PCD value inherit between the different SKUs
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / GenC.py
index 2bc4fbdb6e4047524ea66c540c0f347bec20f273..6b95cd47c2c235a8c7b081861de2e6e972b9ad95 100644 (file)
@@ -1677,6 +1677,9 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH):
         if Pcd.Type in gDynamicExPcd and Pcd.TokenSpaceGuidCName not in TokenSpaceList:\r
             TokenSpaceList += [Pcd.TokenSpaceGuidCName]\r
             \r
+    SkuMgr = Info.Workspace.Platform.SkuIdMgr\r
+    AutoGenH.Append("\n// Definition of SkuId Array\n")\r
+    AutoGenH.Append("extern UINT64 _gPcd_SkuId_Array[];\n")\r
     # Add extern declarations to AutoGen.h if one or more Token Space GUIDs were found\r
     if TokenSpaceList <> []:            \r
         AutoGenH.Append("\n// Definition of PCD Token Space GUIDs used in this module\n\n")\r
@@ -1694,6 +1697,8 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH):
             CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd)\r
         DynExPcdTokenNumberMapping (Info, AutoGenH)\r
     else:\r
+        AutoGenC.Append("\n// Definition of SkuId Array\n")\r
+        AutoGenC.Append("GLOBAL_REMOVE_IF_UNREFERENCED UINT64 _gPcd_SkuId_Array[] = %s;\n" % SkuMgr.DumpSkuIdArrary())\r
         if Info.ModulePcdList:\r
             AutoGenH.Append("\n// Definition of PCDs used in this module\n")\r
             AutoGenC.Append("\n// Definition of PCDs used in this module\n")\r