From: klu2 Date: Thu, 24 Aug 2006 17:04:56 +0000 (+0000) Subject: Fix track EDKT106 & EDKT112: map LibPcdSetPtr function for PatchPcdSetPtr macro funct... X-Git-Tag: edk2-stable201903~24493 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=7085597507e62932b823a97a590dd05f2716f82e Fix track EDKT106 & EDKT112: map LibPcdSetPtr function for PatchPcdSetPtr macro function defined in PcdLib library class git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1381 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h index a0201049a5..038443b993 100644 --- a/MdePkg/Include/Library/PcdLib.h +++ b/MdePkg/Include/Library/PcdLib.h @@ -58,7 +58,12 @@ Module Name: PcdLib.h #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) #define PatchPcdSetPtr(TokenName, Size, Buffer) \ - CopyMem (_gPcd_BinaryPatch_##TokenName, (Buffer), (Size)) + LibPatchPcdSetPtr ( \ + _gPcd_BinaryPatch_##TokenName, \ + (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \ + (Size), \ + (Buffer) \ + ) // // Dynamic is via the protocol with only the TokenNumber as argument diff --git a/Tools/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java b/Tools/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java index e38bc91aed..03499e6ee1 100644 --- a/Tools/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java +++ b/Tools/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java @@ -368,9 +368,15 @@ public class UsageInstance { // Example autogen string for following generation: // "#define _PCD_SET_MODE_8_PcdSampleToken(SizeOfBuffer, Buffer) CopyMem (_gPcd_BinaryPatch_PcdSampleToken, (Buffer), (SizeOfBuffer))" // - hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(SizeOfBuffer, Buffer) CopyMem (_gPcd_BinaryPatch_%s, (Buffer), (SizeOfBuffer))\r\n", + hAutogenStr += String.format("#define _PCD_PATCHABLE_%s_SIZE %d\r\n", + parentToken.cName, + parentToken.datumSize); + hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(SizeOfBuffer, Buffer) "+ + "LibPatchPcdSetPtr (_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, "+ + "(SizeOfBuffer), (Buffer))\r\n", Token.GetAutogenDefinedatumTypeString(parentToken.datumType), parentToken.cName, + parentToken.cName, parentToken.cName); } else { // @@ -396,8 +402,9 @@ public class UsageInstance { // Example autogen string for following generation: // "GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_PcdSampleToken[] = _PCD_VALUE_PcdSampleToken;" // - cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_%s[] = _PCD_VALUE_%s;\r\n", + cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_%s[%d] = _PCD_VALUE_%s;\r\n", parentToken.cName, + parentToken.datumSize, parentToken.cName); } else { //