public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bob Feng" <bob.c.feng@intel.com>
To: "Gao, Liming" <liming.gao@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Shi, Steven" <steven.shi@intel.com>
Subject: Re: [edk2-devel] [Patch 1/1] BaseTools: Remove PCD_TOKEN define for FixedAtBuild PCD
Date: Wed, 18 Dec 2019 02:16:49 +0000	[thread overview]
Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16158416B@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E567451@SHSMSX104.ccr.corp.intel.com>

Yes. If Pcd type is not DynamicXXX, there is no PCD_TOKEN define generated.

-----Original Message-----
From: Gao, Liming 
Sent: Wednesday, December 18, 2019 10:15 AM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Cc: Shi, Steven <steven.shi@intel.com>
Subject: RE: [edk2-devel] [Patch 1/1] BaseTools: Remove PCD_TOKEN define for FixedAtBuild PCD

Bob:
  PatchInModule and FeaturePcd don't use Token. Does this patch remove the token generation for them?

Thanks
Liming
>-----Original Message-----
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
>Bob Feng
>Sent: Wednesday, December 18, 2019 10:09 AM
>To: devel@edk2.groups.io
>Cc: Gao, Liming <liming.gao@intel.com>; Shi, Steven 
><steven.shi@intel.com>
>Subject: [edk2-devel] [Patch 1/1] BaseTools: Remove PCD_TOKEN define 
>for FixedAtBuild PCD
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2426
>
>Build tool generate PCD_TOKEN_xxx Macro for FixedAtBuild Pcd in 
>Autogen.c and Autogen.h but there is no code use that Macro, so this 
>patch is going to remove this Macro from autogen files.
>
>This change can improve incremental build function.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Cc: Steven Shi <steven.shi@intel.com>
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>---
> BaseTools/Source/Python/AutoGen/GenC.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
>b/BaseTools/Source/Python/AutoGen/GenC.py
>index 5e0d11e165a3..3ec1a950fadc 100755
>--- a/BaseTools/Source/Python/AutoGen/GenC.py
>+++ b/BaseTools/Source/Python/AutoGen/GenC.py
>@@ -911,11 +911,12 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, 
>Pcd):
>                 EdkLogger.error("build", AUTOGEN_ERROR,
>                                 "No generated token number for 
>%s.%s\n" % (Pcd.TokenSpaceGuidCName, TokenCName),
>                                 ExtraData="[%s]" % str(Info))
>         else:
>             TokenNumber = PcdTokenNumber[Pcd.TokenCName, 
>Pcd.TokenSpaceGuidCName]
>-        AutoGenH.Append('\n#define %s  %dU\n' % (PcdTokenName,
>TokenNumber))
>+        if Pcd.Type in PCD_DYNAMIC_TYPE_SET:
>+            AutoGenH.Append('\n#define %s  %dU\n' % (PcdTokenName,
>TokenNumber))
>
>     EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " + 
> TokenCName
>+ "." + Pcd.TokenSpaceGuidCName)
>     if Pcd.Type not in gItemTypeStringDatabase:
>         EdkLogger.error("build", AUTOGEN_ERROR,
>                         "Unknown PCD type [%s] of PCD %s.%s" % 
>(Pcd.Type, Pcd.TokenSpaceGuidCName, TokenCName), @@ -1236,11 +1237,12 
>@@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
>                 AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) 
>LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % 
>(SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName,
>PcdTokenName))
>             else:
>                 AutoGenH.Append('#define %s(Value)  LibPcdSetEx%s(&%s, 
>%s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName,
>PcdTokenName))
>                 AutoGenH.Append('#define %s(Value)
>LibPcdSetEx%sS(&%s, %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, 
>Pcd.TokenSpaceGuidCName, PcdTokenName))
>     else:
>-        AutoGenH.Append('#define _PCD_TOKEN_%s  %dU\n' % (TokenCName,
>TokenNumber))
>+        if Pcd.Type in PCD_DYNAMIC_TYPE_SET:
>+            AutoGenH.Append('#define _PCD_TOKEN_%s  %dU\n' %
>(TokenCName, TokenNumber))
>     if PcdItemType in PCD_DYNAMIC_TYPE_SET:
>         PcdList = []
>         PcdCNameList = []
>         PcdList.extend(Info.LibraryPcdList)
>         PcdList.extend(Info.ModulePcdList)
>--
>2.20.1.windows.1
>
>
>


      reply	other threads:[~2019-12-18  2:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  2:08 [Patch 1/1] BaseTools: Remove PCD_TOKEN define for FixedAtBuild PCD Bob Feng
2019-12-18  2:15 ` [edk2-devel] " Liming Gao
2019-12-18  2:16   ` Bob Feng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08650203BA1BD64D8AD9B6D5D74A85D16158416B@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox