public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhu, Yonghong" <yonghong.zhu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: Correct _PCD_PATCHABLE_TokenName_SIZE's value
Date: Mon, 23 Jul 2018 04:03:17 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2BF83B@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1532318501-5412-1-git-send-email-yonghong.zhu@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Monday, July 23, 2018 12:02 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Correct
>_PCD_PATCHABLE_TokenName_SIZE's value
>
>current if user use PatchPcdSetPtr in library, it will report the
>_PCD_PATCHABLE_TokenName_SIZE is not defined.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/GenC.py | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
>b/BaseTools/Source/Python/AutoGen/GenC.py
>index 3b39649..f741f1c 100644
>--- a/BaseTools/Source/Python/AutoGen/GenC.py
>+++ b/BaseTools/Source/Python/AutoGen/GenC.py
>@@ -1291,11 +1291,10 @@ def CreateLibraryPcdCode(Info, AutoGenC,
>AutoGenH, Pcd):
>                 AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)
>LibPcdSet%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName,
>DatumSizeLib, PcdTokenName))
>             else:
>                 AutoGenH.Append('#define %s(Value)  LibPcdSet%s(%s, (Value))\n' %
>(SetModeName, DatumSizeLib, PcdTokenName))
>                 AutoGenH.Append('#define %s(Value)  LibPcdSet%sS(%s,
>(Value))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))
>     if PcdItemType == TAB_PCDS_PATCHABLE_IN_MODULE:
>-        GetModeMaxSizeName = '_PCD_GET_MODE_MAXSIZE' + '_' +
>TokenCName
>         PcdVariableName = '_gPcd_' +
>gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + '_' +
>TokenCName
>         if DatumType not in TAB_PCD_NUMERIC_TYPES:
>             if DatumType == TAB_VOID and Array == '[]':
>                 DatumType = [TAB_UINT8, TAB_UINT16][Pcd.DefaultValue[0] == 'L']
>             else:
>@@ -1306,11 +1305,11 @@ def CreateLibraryPcdCode(Info, AutoGenC,
>AutoGenH, Pcd):
>
>AutoGenH.Append('#define %s  %s_gPcd_BinaryPatch_%s\n' %(GetModeNa
>me, Type, TokenCName))
>         PcdDataSize = Pcd.GetPcdSize()
>         if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:
>             AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)
>LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s,
>(SizeOfBuffer), (Buffer))\n' % (SetModeName, TokenCName,
>PatchPcdSizeVariableName, PatchPcdMaxSizeVariable))
>             AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)
>LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s,
>(SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, TokenCName,
>PatchPcdSizeVariableName, PatchPcdMaxSizeVariable))
>-            AutoGenH.Append('#define %s %s\n' % (GetModeMaxSizeName,
>PatchPcdMaxSizeVariable))
>+            AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName,
>PatchPcdMaxSizeVariable))
>             AutoGenH.Append('extern const UINTN %s; \n' %
>PatchPcdMaxSizeVariable)
>         else:
>             AutoGenH.Append('#define %s(Value)  (%s = (Value))\n' %
>(SetModeName, PcdVariableName))
>             AutoGenH.Append('#define %s(Value)  ((%s = (Value)),
>RETURN_SUCCESS)\n' % (SetModeStatusName, PcdVariableName))
>             AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName,
>PcdDataSize))
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2018-07-23  4:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23  4:01 [Patch] BaseTools: Correct _PCD_PATCHABLE_TokenName_SIZE's value Yonghong Zhu
2018-07-23  4:03 ` Gao, Liming [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=4A89E2EF3DFEDB4C8BFDE51014F606A14E2BF83B@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