## @file\r
# Routines for generating AutoGen.h and AutoGen.c\r
#\r
-# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
Type = ''\r
Array = ''\r
if Pcd.DatumType == 'VOID*':\r
- Type = '(VOID *)'\r
+ if Pcd.DefaultValue[0]== '{':\r
+ Type = '(VOID *)'\r
Array = '[]'\r
PcdItemType = Pcd.Type\r
PcdExCNameList = []\r
AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, (Value))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))\r
if PcdItemType == TAB_PCDS_PATCHABLE_IN_MODULE:\r
PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + '_' + TokenCName\r
- AutoGenH.Append('extern volatile %s _gPcd_BinaryPatch_%s%s;\n' %(DatumType, TokenCName, Array) )\r
+ if DatumType == 'VOID*':\r
+ ArraySize = int(Pcd.MaxDatumSize, 0)\r
+ if Pcd.DefaultValue[0] == 'L':\r
+ ArraySize = ArraySize / 2\r
+ Array = '[%d]' % ArraySize\r
+ DatumType = ['UINT8', 'UINT16'][Pcd.DefaultValue[0] == 'L']\r
+ AutoGenH.Append('extern %s _gPcd_BinaryPatch_%s%s;\n' %(DatumType, TokenCName, Array))\r
+ else:\r
+ AutoGenH.Append('extern volatile %s %s%s;\n' % (DatumType, PcdVariableName, Array))\r
AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeName, Type, TokenCName))\r
if Pcd.DatumType == 'VOID*':\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))\r