]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug for Size incorrect of Void* Fixatbuild Pcd
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 14 Mar 2018 08:51:04 +0000 (16:51 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 10 Apr 2018 05:55:52 +0000 (13:55 +0800)
when driver link library and there have pcd override in DSC component
section, in the library autogen file, the pcd's size is incorrect, the
size value is from DSC [pcd] section, but not from the override pcd
value that in the [component] section.

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

index 5baabf2a0c74f293648ef46e216fbef5ea8e496b..5940e88682edf3486abe0feabb9ba64fe3cce897 100644 (file)
@@ -1278,7 +1278,7 @@ class PlatformAutoGen(AutoGen):
             FixedAtBuildPcds = {}  \r
             ShareFixedAtBuildPcdsSameValue = {} \r
             for Module in LibAuto._ReferenceModules:                \r
-                for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds:\r
+                for Pcd in Module.FixedAtBuildPcds:\r
                     key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))  \r
                     if key not in FixedAtBuildPcds:\r
                         ShareFixedAtBuildPcdsSameValue[key] = True\r
@@ -1295,7 +1295,7 @@ class PlatformAutoGen(AutoGen):
                     if DscPcd.Type != "FixedAtBuild":\r
                         continue\r
                 if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]:                    \r
-                    LibAuto.ConstPcd[key] = Pcd.DefaultValue\r
+                    LibAuto.ConstPcd[key] = FixedAtBuildPcds[key]\r
 \r
     def CollectVariables(self, DynamicPcdSet):\r
 \r
index 8c10e30a4df72d9ed104f2d2869385957693ae48..e94974bc80ef455a1fd86bc3bb78e467ba14f628 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Routines for generating AutoGen.h and AutoGen.c\r
 #\r
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -1353,6 +1353,8 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
         ConstFixedPcd = False\r
         if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and (key in Info.ConstPcd or (Info.IsLibrary and not Info._ReferenceModules)):\r
             ConstFixedPcd = True\r
+            if key in Info.ConstPcd:\r
+                Pcd.DefaultValue = Info.ConstPcd[key]\r
             if Pcd.DatumType not in _NumericDataTypesList:\r
                 AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName))\r
             else:\r