BaseTools: Correct _PCD_PATCHABLE_TokenName_SIZE's value
authorYonghong Zhu <yonghong.zhu@intel.com>
Mon, 23 Jul 2018 03:58:22 +0000 (11:58 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 24 Jul 2018 08:27:49 +0000 (16:27 +0800)
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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/GenC.py

index aaa88f8..8a62cd2 100644 (file)
@@ -1293,7 +1293,6 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
                 AutoGenH.Append('#define %s(Value)  LibPcdSet%s(%s, (Value))\n' % (SetModeName, DatumSizeLib, PcdTokenName))\r
                 AutoGenH.Append('#define %s(Value)  LibPcdSet%sS(%s, (Value))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))\r
     if PcdItemType == TAB_PCDS_PATCHABLE_IN_MODULE:\r
-        GetModeMaxSizeName = '_PCD_GET_MODE_MAXSIZE' + '_' + TokenCName\r
         PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + '_' + TokenCName\r
         if DatumType not in TAB_PCD_NUMERIC_TYPES:\r
             if DatumType == TAB_VOID and Array == '[]':\r
@@ -1308,7 +1307,7 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
         if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
             AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, TokenCName, PatchPcdSizeVariableName, PatchPcdMaxSizeVariable))\r
             AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, TokenCName, PatchPcdSizeVariableName, PatchPcdMaxSizeVariable))\r
-            AutoGenH.Append('#define %s %s\n' % (GetModeMaxSizeName, PatchPcdMaxSizeVariable))\r
+            AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, PatchPcdMaxSizeVariable))\r
             AutoGenH.Append('extern const UINTN %s; \n' % PatchPcdMaxSizeVariable)\r
         else:\r
             AutoGenH.Append('#define %s(Value)  (%s = (Value))\n' % (SetModeName, PcdVariableName))\r