BaseTools: Fix a bug for Size incorrect of Void* Fixatbuild Pcd

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>
This commit is contained in:
Yonghong Zhu 2018-03-14 16:51:04 +08:00
parent 1bfcf64f39
commit eca980c0c8
2 changed files with 5 additions and 3 deletions

View File

@ -1278,7 +1278,7 @@ class PlatformAutoGen(AutoGen):
FixedAtBuildPcds = {} FixedAtBuildPcds = {}
ShareFixedAtBuildPcdsSameValue = {} ShareFixedAtBuildPcdsSameValue = {}
for Module in LibAuto._ReferenceModules: for Module in LibAuto._ReferenceModules:
for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds: for Pcd in Module.FixedAtBuildPcds:
key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
if key not in FixedAtBuildPcds: if key not in FixedAtBuildPcds:
ShareFixedAtBuildPcdsSameValue[key] = True ShareFixedAtBuildPcdsSameValue[key] = True
@ -1295,7 +1295,7 @@ class PlatformAutoGen(AutoGen):
if DscPcd.Type != "FixedAtBuild": if DscPcd.Type != "FixedAtBuild":
continue continue
if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]: if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]:
LibAuto.ConstPcd[key] = Pcd.DefaultValue LibAuto.ConstPcd[key] = FixedAtBuildPcds[key]
def CollectVariables(self, DynamicPcdSet): def CollectVariables(self, DynamicPcdSet):

View File

@ -1,7 +1,7 @@
## @file ## @file
# Routines for generating AutoGen.h and AutoGen.c # Routines for generating AutoGen.h and AutoGen.c
# #
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
@ -1353,6 +1353,8 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
ConstFixedPcd = False ConstFixedPcd = False
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and (key in Info.ConstPcd or (Info.IsLibrary and not Info._ReferenceModules)): if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and (key in Info.ConstPcd or (Info.IsLibrary and not Info._ReferenceModules)):
ConstFixedPcd = True ConstFixedPcd = True
if key in Info.ConstPcd:
Pcd.DefaultValue = Info.ConstPcd[key]
if Pcd.DatumType not in _NumericDataTypesList: if Pcd.DatumType not in _NumericDataTypesList:
AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName)) AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName))
else: else: