public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the Library
@ 2017-03-22  1:45 Yonghong Zhu
  2017-03-27  2:36 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2017-03-22  1:45 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

Update DynExPcdTokenNumberMapping logic, currently even it is Library,
its self's Pcd is saved into ModulePcdList.

Fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=434
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenC.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index c1d64cc..96b1459 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -672,14 +672,12 @@ gModuleTypeHeaderFile = {
 #
 #
 def DynExPcdTokenNumberMapping(Info, AutoGenH):
     ExTokenCNameList = []
     PcdExList        = []
-    if Info.IsLibrary:
-        PcdList = Info.LibraryPcdList
-    else:
-        PcdList = Info.ModulePcdList
+    # Even it is the Library, the PCD is saved in the ModulePcdList
+    PcdList = Info.ModulePcdList
     for Pcd in PcdList:
         if Pcd.Type in gDynamicExPcd:
             ExTokenCNameList.append(Pcd.TokenCName)
             PcdExList.append(Pcd)
     if len(ExTokenCNameList) == 0:
@@ -1153,11 +1151,11 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
         # If PcdGet/Set used in the Pcds with different Guids but same CName, it should failed to build.
         if PcdExCNameList.count(Pcd.TokenCName) > 1:
             AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds are different Guids but same CName.\n')
             AutoGenH.Append('// #define %s  %s\n' % (PcdTokenName, PcdExTokenName))
             AutoGenH.Append('// #define %s  LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
-            AutoGenH.Append('// #define %s  LibPcdGetExSize(&%s, %s \n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))
+            AutoGenH.Append('// #define %s  LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))
             if Pcd.DatumType == 'VOID*':
                 AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer)  LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
                 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))
-- 
2.6.1.windows.1



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

* Re: [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the Library
  2017-03-22  1:45 [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the Library Yonghong Zhu
@ 2017-03-27  2:36 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2017-03-27  2:36 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

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

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Wednesday, March 22, 2017 9:45 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the
>Library
>
>Update DynExPcdTokenNumberMapping logic, currently even it is Library,
>its self's Pcd is saved into ModulePcdList.
>
>Fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=434
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/GenC.py | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
>b/BaseTools/Source/Python/AutoGen/GenC.py
>index c1d64cc..96b1459 100644
>--- a/BaseTools/Source/Python/AutoGen/GenC.py
>+++ b/BaseTools/Source/Python/AutoGen/GenC.py
>@@ -672,14 +672,12 @@ gModuleTypeHeaderFile = {
> #
> #
> def DynExPcdTokenNumberMapping(Info, AutoGenH):
>     ExTokenCNameList = []
>     PcdExList        = []
>-    if Info.IsLibrary:
>-        PcdList = Info.LibraryPcdList
>-    else:
>-        PcdList = Info.ModulePcdList
>+    # Even it is the Library, the PCD is saved in the ModulePcdList
>+    PcdList = Info.ModulePcdList
>     for Pcd in PcdList:
>         if Pcd.Type in gDynamicExPcd:
>             ExTokenCNameList.append(Pcd.TokenCName)
>             PcdExList.append(Pcd)
>     if len(ExTokenCNameList) == 0:
>@@ -1153,11 +1151,11 @@ def CreateLibraryPcdCode(Info, AutoGenC,
>AutoGenH, Pcd):
>         # If PcdGet/Set used in the Pcds with different Guids but same CName, it
>should failed to build.
>         if PcdExCNameList.count(Pcd.TokenCName) > 1:
>             AutoGenH.Append('// Disabled the macros, as PcdToken and
>PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds
>are different Guids but same CName.\n')
>             AutoGenH.Append('// #define %s  %s\n' % (PcdTokenName,
>PcdExTokenName))
>             AutoGenH.Append('// #define %s  LibPcdGetEx%s(&%s, %s)\n' %
>(GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName,
>PcdTokenName))
>-            AutoGenH.Append('// #define %s  LibPcdGetExSize(&%s, %s \n' %
>(GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))
>+            AutoGenH.Append('// #define %s  LibPcdGetExSize(&%s, %s)\n' %
>(GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))
>             if Pcd.DatumType == 'VOID*':
>                 AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer)
>LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName,
>DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
>                 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))
>--
>2.6.1.windows.1



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

end of thread, other threads:[~2017-03-27  2:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22  1:45 [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the Library Yonghong Zhu
2017-03-27  2:36 ` Gao, Liming

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