* [Patch] BaseTools: Enhance BaseTools supports FeaturePcd usage in VFR file
@ 2018-06-19 1:11 Yonghong Zhu
2018-06-21 7:57 ` Gao, Liming
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-06-19 1:11 UTC (permalink / raw)
To: edk2-devel
Bugzilla 348 only fixed FixedAtBuild Pcd type, now this patch also add
support for FeaturePcd type.
Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=348
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Source/Python/AutoGen/GenC.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index ae3af08..5b24ae5 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -2093,19 +2093,20 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer,
if Guid in Info.Module.GetGuidsUsedByPcd():
continue
GuidMacros.append('#define %s %s' % (Guid, Info.Module.Guids[Guid]))
for Guid, Value in Info.Module.Protocols.items() + Info.Module.Ppis.items():
GuidMacros.append('#define %s %s' % (Guid, Value))
- # supports FixedAtBuild usage in VFR file
+ # supports FixedAtBuild and FeaturePcd usage in VFR file
if Info.VfrFileList and Info.ModulePcdList:
GuidMacros.append('#define %s %s' % ('FixedPcdGetBool(TokenName)', '_PCD_VALUE_##TokenName'))
GuidMacros.append('#define %s %s' % ('FixedPcdGet8(TokenName)', '_PCD_VALUE_##TokenName'))
GuidMacros.append('#define %s %s' % ('FixedPcdGet16(TokenName)', '_PCD_VALUE_##TokenName'))
GuidMacros.append('#define %s %s' % ('FixedPcdGet32(TokenName)', '_PCD_VALUE_##TokenName'))
GuidMacros.append('#define %s %s' % ('FixedPcdGet64(TokenName)', '_PCD_VALUE_##TokenName'))
+ GuidMacros.append('#define %s %s' % ('FeaturePcdGet(TokenName)', '_PCD_VALUE_##TokenName'))
for Pcd in Info.ModulePcdList:
- if Pcd.Type == TAB_PCDS_FIXED_AT_BUILD:
+ if Pcd.Type in [TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_FEATURE_FLAG]:
TokenCName = Pcd.TokenCName
Value = Pcd.DefaultValue
if Pcd.DatumType == 'BOOLEAN':
BoolValue = Value.upper()
if BoolValue == 'TRUE':
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Enhance BaseTools supports FeaturePcd usage in VFR file
2018-06-19 1:11 [Patch] BaseTools: Enhance BaseTools supports FeaturePcd usage in VFR file Yonghong Zhu
@ 2018-06-21 7:57 ` Gao, Liming
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-06-21 7:57 UTC (permalink / raw)
To: Zhu, Yonghong, edk2-devel@lists.01.org
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhu,
>Yonghong
>Sent: Tuesday, June 19, 2018 9:11 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Enhance BaseTools supports FeaturePcd
>usage in VFR file
>
>Bugzilla 348 only fixed FixedAtBuild Pcd type, now this patch also add
>support for FeaturePcd type.
>
>Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=348
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/GenC.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
>b/BaseTools/Source/Python/AutoGen/GenC.py
>index ae3af08..5b24ae5 100644
>--- a/BaseTools/Source/Python/AutoGen/GenC.py
>+++ b/BaseTools/Source/Python/AutoGen/GenC.py
>@@ -2093,19 +2093,20 @@ def CreateCode(Info, AutoGenC, AutoGenH,
>StringH, UniGenCFlag, UniGenBinBuffer,
> if Guid in Info.Module.GetGuidsUsedByPcd():
> continue
> GuidMacros.append('#define %s %s' % (Guid,
>Info.Module.Guids[Guid]))
> for Guid, Value in Info.Module.Protocols.items() +
>Info.Module.Ppis.items():
> GuidMacros.append('#define %s %s' % (Guid, Value))
>- # supports FixedAtBuild usage in VFR file
>+ # supports FixedAtBuild and FeaturePcd usage in VFR file
> if Info.VfrFileList and Info.ModulePcdList:
> GuidMacros.append('#define %s %s' %
>('FixedPcdGetBool(TokenName)', '_PCD_VALUE_##TokenName'))
> GuidMacros.append('#define %s %s' % ('FixedPcdGet8(TokenName)',
>'_PCD_VALUE_##TokenName'))
> GuidMacros.append('#define %s %s' % ('FixedPcdGet16(TokenName)',
>'_PCD_VALUE_##TokenName'))
> GuidMacros.append('#define %s %s' % ('FixedPcdGet32(TokenName)',
>'_PCD_VALUE_##TokenName'))
> GuidMacros.append('#define %s %s' % ('FixedPcdGet64(TokenName)',
>'_PCD_VALUE_##TokenName'))
>+ GuidMacros.append('#define %s %s' % ('FeaturePcdGet(TokenName)',
>'_PCD_VALUE_##TokenName'))
> for Pcd in Info.ModulePcdList:
>- if Pcd.Type == TAB_PCDS_FIXED_AT_BUILD:
>+ if Pcd.Type in [TAB_PCDS_FIXED_AT_BUILD,
>TAB_PCDS_FEATURE_FLAG]:
> TokenCName = Pcd.TokenCName
> Value = Pcd.DefaultValue
> if Pcd.DatumType == 'BOOLEAN':
> BoolValue = Value.upper()
> if BoolValue == 'TRUE':
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-21 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19 1:11 [Patch] BaseTools: Enhance BaseTools supports FeaturePcd usage in VFR file Yonghong Zhu
2018-06-21 7:57 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox