public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools: Should always define PCD TOKEN value as Zero for static PCD
@ 2020-12-16  1:03 fengyunhua
  2020-12-16  1:26 ` Bob Feng
  0 siblings, 1 reply; 5+ messages in thread
From: fengyunhua @ 2020-12-16  1:03 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3120
FixedAtBuild, PatchableInModule and FeatureFlag PCD don't use PCD TOKEN.
Their PCD TOKEN value can always be zero. If so, AutoGen.h will not be
changed when PCD is added or removed.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
---
 BaseTools/Source/Python/AutoGen/GenC.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index a2053d5485..ac561ba82e 100755
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -913,6 +913,8 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
                                 ExtraData="[%s]" % str(Info))
         else:
             TokenNumber = PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName]
+        if Pcd.Type not in PCD_DYNAMIC_TYPE_SET:
+            TokenNumber = 0
         AutoGenH.Append('\n#define %s  %dU\n' % (PcdTokenName, TokenNumber))
 
     EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " + TokenCName + "." + Pcd.TokenSpaceGuidCName)
-- 
2.27.0.windows.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-17  0:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-16  1:03 [PATCH] BaseTools: Should always define PCD TOKEN value as Zero for static PCD fengyunhua
2020-12-16  1:26 ` Bob Feng
2020-12-16  2:09   ` 回复: " gaoliming
2020-12-16  6:16     ` [edk2-devel] " Bob Feng
2020-12-17  0:49       ` 回复: " gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox