diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-05-10 16:35:30 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:40 +0800 |
commit | 276f109d62bf8d46754b85e52f312d5f5afa03cc (patch) | |
tree | c168af32ab6d6d8b748646d31d0d0af8419dac08 /BaseTools/Source/Python | |
parent | f9308d8e0fc9340398888341530262a43130c79c (diff) | |
download | edk2-platforms-276f109d62bf8d46754b85e52f312d5f5afa03cc.tar.xz |
BaseTools: Correct VOID* PatchPcd Size in Library Autogen
This patch correct the VOID* PatchPcd Size info generated in the
Library's autogen file. Update it to use the MaxDatumSize.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenC.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index 0fb6b9fc4e..542edb3ce2 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1203,15 +1203,16 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd): else:
AutoGenH.Append('extern volatile %s %s%s;\n' % (DatumType, PcdVariableName, Array))
AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeName, Type, TokenCName))
+ PcdDataSize = GetPcdSize(Pcd)
if Pcd.DatumType == 'VOID*':
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeName, TokenCName, TokenCName, TokenCName))
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, TokenCName, TokenCName, TokenCName))
+ AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pcd.MaxDatumSize))
else:
AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName))
AutoGenH.Append('#define %s(Value) ((%s = (Value)), RETURN_SUCCESS)\n' % (SetModeStatusName, PcdVariableName))
-
- PcdDataSize = GetPcdSize(Pcd)
- AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, PcdDataSize))
+ AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, PcdDataSize))
+
AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,PatchPcdSizeVariableName))
AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName)
|