]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Keep the Pcd order in the Asbuilt Inf is same with Source
authorYonghong Zhu <yonghong.zhu@intel.com>
Tue, 26 Jul 2016 07:17:15 +0000 (15:17 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 2 Aug 2016 11:39:01 +0000 (19:39 +0800)
The original behavior is that in the Asbuilt inf Pcd's order is base on
the Pcd's offset. Now we change the order to keep it is same with the Pcd
order in the source inf file.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index 9c548be9f97f9a893fee00edd4d9743ba3af4e29..921b97916327a6988592243d24acb1e34315b21d 100644 (file)
@@ -3605,13 +3605,13 @@ class ModuleAutoGen(AutoGen):
         # Find all DynamicEx and PatchableInModule PCDs used by this module and dependent libraries\r
         # Also find all packages that the DynamicEx PCDs depend on\r
         Pcds = []\r
-        PatchablePcds = {}\r
+        PatchablePcds = []\r
         Packages = []\r
         PcdCheckList = []\r
         PcdTokenSpaceList = []\r
         for Pcd in self.ModulePcdList + self.LibraryPcdList:\r
             if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
-                PatchablePcds[Pcd.TokenCName] = Pcd\r
+                PatchablePcds += [Pcd]\r
                 PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, 'PatchableInModule'))\r
             elif Pcd.Type in GenC.gDynamicExPcd:\r
                 if Pcd not in Pcds:\r
@@ -3764,15 +3764,17 @@ class ModuleAutoGen(AutoGen):
                             os.path.join(self.OutputDir, self.Name + '.efi')\r
                         )\r
         if PatchList:\r
-            for PatchPcd in PatchList:\r
-                if PatchPcd[0] in PatchablePcds:\r
-                    key = PatchPcd[0]\r
-                elif PatchPcd[0] + '_PatchableInModule' in PatchablePcds:\r
-                    key = PatchPcd[0] + '_PatchableInModule'\r
+            for Pcd in PatchablePcds:\r
+                TokenCName = Pcd.TokenCName\r
+                for PcdItem in GlobalData.MixedPcd:\r
+                    if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem]:\r
+                        TokenCName = PcdItem[0]\r
+                        break\r
+                for PatchPcd in PatchList:\r
+                    if TokenCName == PatchPcd[0]:\r
+                        break\r
                 else:\r
                     continue\r
-                Pcd = PatchablePcds[key]\r
-                TokenCName = PatchPcd[0]\r
                 PcdValue = ''\r
                 if Pcd.DatumType != 'VOID*':\r
                     HexFormat = '0x%02x'\r