## @file\r
# Routines for generating AutoGen.h and AutoGen.c\r
#\r
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, 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
\r
## PCD type string\r
gItemTypeStringDatabase = {\r
- TAB_PCDS_FEATURE_FLAG : 'FixedAtBuild',\r
- TAB_PCDS_FIXED_AT_BUILD : 'FixedAtBuild',\r
+ TAB_PCDS_FEATURE_FLAG : TAB_PCDS_FIXED_AT_BUILD,\r
+ TAB_PCDS_FIXED_AT_BUILD : TAB_PCDS_FIXED_AT_BUILD,\r
TAB_PCDS_PATCHABLE_IN_MODULE: 'BinaryPatch',\r
TAB_PCDS_DYNAMIC : '',\r
TAB_PCDS_DYNAMIC_DEFAULT : '',\r
TAB_PCDS_DYNAMIC_EX_HII : '',\r
}\r
\r
-## Dynamic PCD types\r
-gDynamicPcd = [TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII]\r
-\r
-## Dynamic-ex PCD types\r
-gDynamicExPcd = [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]\r
\r
## Datum size\r
-gDatumSizeStringDatabase = {'UINT8':'8','UINT16':'16','UINT32':'32','UINT64':'64','BOOLEAN':'BOOLEAN','VOID*':'8'}\r
-gDatumSizeStringDatabaseH = {'UINT8':'8','UINT16':'16','UINT32':'32','UINT64':'64','BOOLEAN':'BOOL','VOID*':'PTR'}\r
-gDatumSizeStringDatabaseLib = {'UINT8':'8','UINT16':'16','UINT32':'32','UINT64':'64','BOOLEAN':'Bool','VOID*':'Ptr'}\r
+gDatumSizeStringDatabase = {TAB_UINT8:'8',TAB_UINT16:'16',TAB_UINT32:'32',TAB_UINT64:'64','BOOLEAN':'BOOLEAN',TAB_VOID:'8'}\r
+gDatumSizeStringDatabaseH = {TAB_UINT8:'8',TAB_UINT16:'16',TAB_UINT32:'32',TAB_UINT64:'64','BOOLEAN':'BOOL',TAB_VOID:'PTR'}\r
+gDatumSizeStringDatabaseLib = {TAB_UINT8:'8',TAB_UINT16:'16',TAB_UINT32:'32',TAB_UINT64:'64','BOOLEAN':'Bool',TAB_VOID:'Ptr'}\r
\r
## AutoGen File Header Templates\r
gAutoGenHeaderString = TemplateString("""\\r
${END}\r
""")\r
\r
+## MM_CORE_STANDALONE Entry Point Templates\r
+gMmCoreStandaloneEntryPointPrototype = TemplateString("""\r
+${BEGIN}\r
+EFI_STATUS\r
+EFIAPI\r
+${Function} (\r
+ IN VOID *HobStart\r
+ );\r
+${END}\r
+""")\r
+\r
+gMmCoreStandaloneEntryPointString = TemplateString("""\r
+${BEGIN}\r
+const UINT32 _gMmRevision = ${PiSpecVersion};\r
+\r
+VOID\r
+EFIAPI\r
+ProcessModuleEntryPointList (\r
+ IN VOID *HobStart\r
+ )\r
+{\r
+ ${Function} (HobStart);\r
+}\r
+${END}\r
+""")\r
+\r
+## MM_STANDALONE Entry Point Templates\r
+gMmStandaloneEntryPointPrototype = TemplateString("""\r
+${BEGIN}\r
+EFI_STATUS\r
+EFIAPI\r
+${Function} (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SMM_SYSTEM_TABLE2 *MmSystemTable\r
+ );\r
+${END}\r
+""")\r
+\r
+gMmStandaloneEntryPointString = [\r
+TemplateString("""\r
+GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gMmRevision = ${PiSpecVersion};\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ProcessModuleEntryPointList (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SMM_SYSTEM_TABLE2 *MmSystemTable\r
+ )\r
+\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
+"""),\r
+TemplateString("""\r
+GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gMmRevision = ${PiSpecVersion};\r
+${BEGIN}\r
+EFI_STATUS\r
+EFIAPI\r
+ProcessModuleEntryPointList (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SMM_SYSTEM_TABLE2 *MmSystemTable\r
+ )\r
+\r
+{\r
+ return ${Function} (ImageHandle, MmSystemTable);\r
+}\r
+${END}\r
+"""),\r
+TemplateString("""\r
+GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gMmRevision = ${PiSpecVersion};\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ProcessModuleEntryPointList (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SMM_SYSTEM_TABLE2 *MmSystemTable\r
+ )\r
+\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_STATUS CombinedStatus;\r
+\r
+ CombinedStatus = EFI_LOAD_ERROR;\r
+${BEGIN}\r
+ Status = ${Function} (ImageHandle, MmSystemTable);\r
+ if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\r
+ CombinedStatus = Status;\r
+ }\r
+${END}\r
+ return CombinedStatus;\r
+}\r
+""")\r
+]\r
+\r
## DXE SMM Entry Point Templates\r
gDxeSmmEntryPointPrototype = TemplateString("""\r
${BEGIN}\r
]\r
\r
gLibraryStructorPrototype = {\r
-'BASE' : TemplateString("""${BEGIN}\r
+SUP_MODULE_BASE : TemplateString("""${BEGIN}\r
RETURN_STATUS\r
EFIAPI\r
${Function} (\r
IN EFI_SYSTEM_TABLE *SystemTable\r
);${END}\r
"""),\r
+\r
+'MM' : TemplateString("""${BEGIN}\r
+EFI_STATUS\r
+EFIAPI\r
+${Function} (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SMM_SYSTEM_TABLE2 *MmSystemTable\r
+ );${END}\r
+"""),\r
}\r
\r
gLibraryStructorCall = {\r
-'BASE' : TemplateString("""${BEGIN}\r
+SUP_MODULE_BASE : TemplateString("""${BEGIN}\r
Status = ${Function} ();\r
ASSERT_EFI_ERROR (Status);${END}\r
"""),\r
Status = ${Function} (ImageHandle, SystemTable);\r
ASSERT_EFI_ERROR (Status);${END}\r
"""),\r
+\r
+'MM' : TemplateString("""${BEGIN}\r
+ Status = ${Function} (ImageHandle, MmSystemTable);\r
+ ASSERT_EFI_ERROR (Status);${END}\r
+"""),\r
}\r
\r
## Library Constructor and Destructor Templates\r
gLibraryString = {\r
-'BASE' : TemplateString("""\r
+SUP_MODULE_BASE : TemplateString("""\r
${BEGIN}${FunctionPrototype}${END}\r
\r
VOID\r
${FunctionCall}${END}\r
}\r
"""),\r
+\r
+'MM' : TemplateString("""\r
+${BEGIN}${FunctionPrototype}${END}\r
+\r
+VOID\r
+EFIAPI\r
+ProcessLibrary${Type}List (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SMM_SYSTEM_TABLE2 *MmSystemTable\r
+ )\r
+{\r
+${BEGIN} EFI_STATUS Status;\r
+${FunctionCall}${END}\r
+}\r
+"""),\r
}\r
\r
gBasicHeaderFile = "Base.h"\r
\r
gModuleTypeHeaderFile = {\r
- "BASE" : [gBasicHeaderFile],\r
- "SEC" : ["PiPei.h", "Library/DebugLib.h"],\r
- "PEI_CORE" : ["PiPei.h", "Library/DebugLib.h", "Library/PeiCoreEntryPoint.h"],\r
- "PEIM" : ["PiPei.h", "Library/DebugLib.h", "Library/PeimEntryPoint.h"],\r
- "DXE_CORE" : ["PiDxe.h", "Library/DebugLib.h", "Library/DxeCoreEntryPoint.h"],\r
- "DXE_DRIVER" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
- "DXE_SMM_DRIVER" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
- "DXE_RUNTIME_DRIVER": ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
- "DXE_SAL_DRIVER" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
- "UEFI_DRIVER" : ["Uefi.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
- "UEFI_APPLICATION" : ["Uefi.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiApplicationEntryPoint.h"],\r
- "SMM_CORE" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],\r
- "USER_DEFINED" : [gBasicHeaderFile]\r
+ SUP_MODULE_BASE : [gBasicHeaderFile],\r
+ SUP_MODULE_SEC : ["PiPei.h", "Library/DebugLib.h"],\r
+ SUP_MODULE_PEI_CORE : ["PiPei.h", "Library/DebugLib.h", "Library/PeiCoreEntryPoint.h"],\r
+ SUP_MODULE_PEIM : ["PiPei.h", "Library/DebugLib.h", "Library/PeimEntryPoint.h"],\r
+ SUP_MODULE_DXE_CORE : ["PiDxe.h", "Library/DebugLib.h", "Library/DxeCoreEntryPoint.h"],\r
+ SUP_MODULE_DXE_DRIVER : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
+ SUP_MODULE_DXE_SMM_DRIVER : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
+ SUP_MODULE_DXE_RUNTIME_DRIVER: ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
+ SUP_MODULE_DXE_SAL_DRIVER : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
+ SUP_MODULE_UEFI_DRIVER : ["Uefi.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],\r
+ SUP_MODULE_UEFI_APPLICATION : ["Uefi.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiApplicationEntryPoint.h"],\r
+ SUP_MODULE_SMM_CORE : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],\r
+ SUP_MODULE_MM_STANDALONE : ["PiSmm.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/SmmDriverStandaloneEntryPoint.h"],\r
+ SUP_MODULE_MM_CORE_STANDALONE : ["PiSmm.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/SmmCoreStandaloneEntryPoint.h"],\r
+ SUP_MODULE_USER_DEFINED : [gBasicHeaderFile]\r
}\r
\r
## Autogen internal worker macro to define DynamicEx PCD name includes both the TokenSpaceGuidName \r
# Even it is the Library, the PCD is saved in the ModulePcdList\r
PcdList = Info.ModulePcdList\r
for Pcd in PcdList:\r
- if Pcd.Type in gDynamicExPcd:\r
+ if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
ExTokenCNameList.append(Pcd.TokenCName)\r
PcdExList.append(Pcd)\r
if len(ExTokenCNameList) == 0:\r
# AutoGen for each PCD listed in a [PcdEx] section of a Module/Lib INF file.\r
# Auto generate a macro for each TokenName that takes a Guid pointer as a parameter. \r
# Use the Guid pointer to see if it matches any of the token space GUIDs.\r
- TokenCNameList = []\r
+ TokenCNameList = set()\r
for TokenCName in ExTokenCNameList:\r
if TokenCName in TokenCNameList:\r
continue\r
% (Pcd.TokenSpaceGuidCName, Pcd.TokenSpaceGuidCName, RealTokenCName))\r
if Index == Count:\r
AutoGenH.Append('0 \\\n )\n')\r
- TokenCNameList.append(TokenCName)\r
+ TokenCNameList.add(TokenCName)\r
\r
- TokenCNameList = []\r
+ TokenCNameList = set()\r
for TokenCName in ExTokenCNameList:\r
if TokenCName in TokenCNameList:\r
continue\r
if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem]:\r
RealTokenCName = PcdItem[0]\r
break\r
- if Pcd.Type in gDynamicExPcd and Pcd.TokenCName == TokenCName:\r
+ if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET and Pcd.TokenCName == TokenCName:\r
Index = Index + 1\r
if Index == 1:\r
AutoGenH.Append('\n#define __PCD_%s_VAL_CMP(GuidPtr) (' % (RealTokenCName))\r
# COMPAREGUID() will only be used if the Guid passed in is local to the module.\r
AutoGenH.Append('#define _PCD_TOKEN_EX_%s(GuidPtr) __PCD_%s_ADDR_CMP(GuidPtr) ? __PCD_%s_ADDR_CMP(GuidPtr) : __PCD_%s_VAL_CMP(GuidPtr) \n'\r
% (RealTokenCName, RealTokenCName, RealTokenCName, RealTokenCName))\r
- TokenCNameList.append(TokenCName)\r
-\r
-def GetPcdSize(Pcd):\r
- if Pcd.DatumType == 'VOID*':\r
- Value = Pcd.DefaultValue\r
- if Value in [None, '']:\r
- return 1\r
- elif Value[0] == 'L':\r
- return (len(Value) - 2) * 2\r
- elif Value[0] == '{':\r
- return len(Value.split(','))\r
- else:\r
- return len(Value) - 1\r
- if Pcd.DatumType == 'UINT64':\r
- return 8\r
- if Pcd.DatumType == 'UINT32':\r
- return 4\r
- if Pcd.DatumType == 'UINT16':\r
- return 2\r
- if Pcd.DatumType == 'UINT8':\r
- return 1\r
- if Pcd.DatumType == 'BOOLEAN':\r
- return 1\r
-\r
+ TokenCNameList.add(TokenCName)\r
\r
## Create code for module PCDs\r
#\r
PcdTokenName = '_PCD_TOKEN_' + TokenCName\r
PatchPcdSizeTokenName = '_PCD_PATCHABLE_' + TokenCName +'_SIZE'\r
PatchPcdSizeVariableName = '_gPcd_BinaryPatch_Size_' + TokenCName\r
+ PatchPcdMaxSizeVariable = '_gPcd_BinaryPatch_MaxSize_' + TokenCName\r
FixPcdSizeTokenName = '_PCD_SIZE_' + TokenCName\r
+ FixedPcdSizeVariableName = '_gPcd_FixedAtBuild_Size_' + TokenCName\r
\r
- if GlobalData.BuildOptionPcd:\r
- for PcdItem in GlobalData.BuildOptionPcd:\r
- if (Pcd.TokenSpaceGuidCName, TokenCName) == (PcdItem[0], PcdItem[1]):\r
- Pcd.DefaultValue = PcdItem[2]\r
- break\r
+ if Pcd.PcdValueFromComm:\r
+ Pcd.DefaultValue = Pcd.PcdValueFromComm\r
\r
- if Pcd.Type in gDynamicExPcd:\r
+ if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
TokenNumber = int(Pcd.TokenValue, 0)\r
# Add TokenSpaceGuidValue value to PcdTokenName to discriminate the DynamicEx PCDs with \r
# different Guids but same TokenCName\r
# will not be added into the Database unless it is used by other modules that are \r
# included in the FDF file. \r
# In this case, just assign an invalid token number to make it pass build.\r
- if Pcd.Type in PCD_DYNAMIC_TYPE_LIST:\r
+ if Pcd.Type in PCD_DYNAMIC_TYPE_SET:\r
TokenNumber = 0\r
else:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
- if Pcd.DatumType not in gDatumSizeStringDatabase:\r
- EdkLogger.error("build", AUTOGEN_ERROR,\r
- "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
- ExtraData="[%s]" % str(Info))\r
\r
- DatumSize = gDatumSizeStringDatabase[Pcd.DatumType]\r
- DatumSizeLib = gDatumSizeStringDatabaseLib[Pcd.DatumType]\r
- GetModeName = '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + TokenCName\r
- SetModeName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + TokenCName\r
- SetModeStatusName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_S_' + TokenCName\r
+ DatumSize = gDatumSizeStringDatabase[Pcd.DatumType] if Pcd.DatumType in gDatumSizeStringDatabase else gDatumSizeStringDatabase[TAB_VOID]\r
+ DatumSizeLib = gDatumSizeStringDatabaseLib[Pcd.DatumType] if Pcd.DatumType in gDatumSizeStringDatabaseLib else gDatumSizeStringDatabaseLib[TAB_VOID]\r
+ GetModeName = '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName\r
+ SetModeName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName\r
+ SetModeStatusName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_S_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_S_' + TokenCName\r
GetModeSizeName = '_PCD_GET_MODE_SIZE' + '_' + TokenCName\r
\r
- PcdExCNameList = []\r
- if Pcd.Type in gDynamicExPcd:\r
+ if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
if Info.IsLibrary:\r
PcdList = Info.LibraryPcdList\r
else:\r
PcdList = Info.ModulePcdList\r
+ PcdExCNameTest = 0\r
for PcdModule in PcdList:\r
- if PcdModule.Type in gDynamicExPcd:\r
- PcdExCNameList.append(PcdModule.TokenCName)\r
+ if PcdModule.Type in PCD_DYNAMIC_EX_TYPE_SET and Pcd.TokenCName == PcdModule.TokenCName:\r
+ PcdExCNameTest += 1\r
+ # get out early once we found > 1...\r
+ if PcdExCNameTest > 1:\r
+ break\r
# Be compatible with the current code which using PcdToken and PcdGet/Set for DynamicEx Pcd.\r
# If only PcdToken and PcdGet/Set used in all Pcds with different CName, it should succeed to build.\r
# If PcdToken and PcdGet/Set used in the Pcds with different Guids but same CName, it should failed to build.\r
- if PcdExCNameList.count(Pcd.TokenCName) > 1:\r
+ if PcdExCNameTest > 1:\r
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')\r
AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTokenName))\r
AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
else:\r
AutoGenH.Append('#define %s %s\n' % (PcdTokenName, PcdExTokenName))\r
AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('#define %s LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
else:\r
AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
- elif Pcd.Type in gDynamicPcd:\r
- PcdList = []\r
- PcdCNameList = []\r
- PcdList.extend(Info.LibraryPcdList)\r
- PcdList.extend(Info.ModulePcdList)\r
- for PcdModule in PcdList:\r
- if PcdModule.Type in gDynamicPcd:\r
- PcdCNameList.append(PcdModule.TokenCName)\r
- if PcdCNameList.count(Pcd.TokenCName) > 1:\r
+ elif Pcd.Type in PCD_DYNAMIC_TYPE_SET:\r
+ PcdCNameTest = 0\r
+ for PcdModule in Info.LibraryPcdList + Info.ModulePcdList:\r
+ if PcdModule.Type in PCD_DYNAMIC_TYPE_SET and Pcd.TokenCName == PcdModule.TokenCName:\r
+ PcdCNameTest += 1\r
+ # get out early once we found > 1...\r
+ if PcdCNameTest > 1:\r
+ break\r
+ if PcdCNameTest > 1:\r
EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic Pcds [%s] are different Guids but same CName. They need to be changed to DynamicEx type to avoid the confliction.\n" % (TokenCName), ExtraData="[%s]" % str(Info.MetaFile.Path))\r
else:\r
AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName, DatumSizeLib, PcdTokenName))\r
AutoGenH.Append('#define %s LibPcdGetSize(%s)\n' % (GetModeSizeName, PcdTokenName))\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSet%s(%s, (SizeOfBuffer), (Buffer))\n' %(SetModeName, DatumSizeLib, PcdTokenName))\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSet%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))\r
else:\r
elif BoolValue == 'FALSE' or BoolValue == '0':\r
Value = '0U'\r
\r
- if Pcd.DatumType in ['UINT64', 'UINT32', 'UINT16', 'UINT8']:\r
+ if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPES:\r
try:\r
- if Value.upper().startswith('0X'):\r
- ValueNumber = int (Value, 16)\r
- else:\r
- ValueNumber = int (Value)\r
+ if Value.upper().endswith('L'):\r
+ Value = Value[:-1]\r
+ ValueNumber = int (Value, 0)\r
except:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"PCD value is not valid dec or hex number for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
- if Pcd.DatumType == 'UINT64':\r
+ if Pcd.DatumType == TAB_UINT64:\r
if ValueNumber < 0:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
if not Value.endswith('ULL'):\r
Value += 'ULL'\r
- elif Pcd.DatumType == 'UINT32':\r
+ elif Pcd.DatumType == TAB_UINT32:\r
if ValueNumber < 0:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
if not Value.endswith('U'):\r
Value += 'U'\r
- elif Pcd.DatumType == 'UINT16':\r
+ elif Pcd.DatumType == TAB_UINT16:\r
if ValueNumber < 0:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
if not Value.endswith('U'):\r
Value += 'U' \r
- elif Pcd.DatumType == 'UINT8':\r
+ elif Pcd.DatumType == TAB_UINT8:\r
if ValueNumber < 0:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
if not Value.endswith('U'):\r
Value += 'U'\r
- if Pcd.DatumType == 'VOID*':\r
- if Pcd.MaxDatumSize == None or Pcd.MaxDatumSize == '':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
+ if Pcd.MaxDatumSize is None or Pcd.MaxDatumSize == '':\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"Unknown [MaxDatumSize] of PCD [%s.%s]" % (Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
ArraySize = ArraySize / 2;\r
\r
if ArraySize < (len(Value) + 1):\r
- EdkLogger.error("build", AUTOGEN_ERROR,\r
+ if Pcd.MaxSizeUserSet:\r
+ EdkLogger.error("build", AUTOGEN_ERROR,\r
"The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
+ else:\r
+ ArraySize = Pcd.GetPcdSize()\r
+ if Unicode:\r
+ ArraySize = ArraySize / 2\r
Value = NewValue + '0 }'\r
Array = '[%d]' % ArraySize\r
#\r
# skip casting for fixed at build since it breaks ARM assembly.\r
# Long term we need PCD macros that work in assembly\r
#\r
- elif Pcd.Type != TAB_PCDS_FIXED_AT_BUILD:\r
+ elif Pcd.Type != TAB_PCDS_FIXED_AT_BUILD and Pcd.DatumType in TAB_PCD_NUMERIC_TYPES_VOID:\r
Value = "((%s)%s)" % (Pcd.DatumType, Value)\r
\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES_VOID:\r
+ # handle structure PCD\r
+ if Pcd.MaxDatumSize is None or Pcd.MaxDatumSize == '':\r
+ EdkLogger.error("build", AUTOGEN_ERROR,\r
+ "Unknown [MaxDatumSize] of PCD [%s.%s]" % (Pcd.TokenSpaceGuidCName, TokenCName),\r
+ ExtraData="[%s]" % str(Info))\r
+\r
+ ArraySize = int(Pcd.MaxDatumSize, 0)\r
+ Array = '[%d]' % ArraySize\r
+\r
if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
PcdValueName = '_PCD_PATCHABLE_VALUE_' + TokenCName\r
else:\r
PcdValueName = '_PCD_VALUE_' + TokenCName\r
\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
#\r
# For unicode, UINT16 array will be generated, so the alignment of unicode is guaranteed.\r
#\r
+ AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))\r
if Unicode:\r
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))\r
AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))\r
AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVariableName, Array))\r
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))\r
else:\r
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))\r
AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))\r
AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVariableName, Array))\r
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))\r
+ AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))\r
\r
- PcdDataSize = GetPcdSize(Pcd)\r
+ PcdDataSize = Pcd.GetPcdSize()\r
if Pcd.Type == TAB_PCDS_FIXED_AT_BUILD:\r
AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdDataSize))\r
AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,FixPcdSizeTokenName))\r
- \r
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED const UINTN %s = %s;\n' % (FixedPcdSizeVariableName,PcdDataSize))\r
if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pcd.MaxDatumSize))\r
AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,PatchPcdSizeVariableName))\r
AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName)\r
AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s = %s;\n' % (PatchPcdSizeVariableName,PcdDataSize))\r
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED const UINTN %s = %s;\n' % (PatchPcdMaxSizeVariable,Pcd.MaxDatumSize))\r
elif Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
AutoGenH.Append('#define %s %s\n' %(PcdValueName, Value))\r
AutoGenC.Append('volatile %s %s %s = %s;\n' %(Const, Pcd.DatumType, PcdVariableName, PcdValueName))\r
AutoGenH.Append('extern volatile %s %s %s%s;\n' % (Const, Pcd.DatumType, PcdVariableName, Array))\r
AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, PcdVariableName))\r
\r
- PcdDataSize = GetPcdSize(Pcd)\r
+ PcdDataSize = Pcd.GetPcdSize()\r
AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, PcdDataSize))\r
\r
AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,PatchPcdSizeVariableName))\r
AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName)\r
AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s = %s;\n' % (PatchPcdSizeVariableName,PcdDataSize))\r
else:\r
- PcdDataSize = GetPcdSize(Pcd)\r
+ PcdDataSize = Pcd.GetPcdSize()\r
AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdDataSize))\r
AutoGenH.Append('#define %s %s \n' % (GetModeSizeName,FixPcdSizeTokenName))\r
\r
AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, PcdVariableName))\r
\r
if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\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
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))\r
else:\r
FixPcdSizeTokenName = '_PCD_SIZE_' + TokenCName\r
PatchPcdSizeTokenName = '_PCD_PATCHABLE_' + TokenCName +'_SIZE'\r
PatchPcdSizeVariableName = '_gPcd_BinaryPatch_Size_' + TokenCName\r
+ PatchPcdMaxSizeVariable = '_gPcd_BinaryPatch_MaxSize_' + TokenCName\r
+ FixedPcdSizeVariableName = '_gPcd_FixedAtBuild_Size_' + TokenCName\r
\r
- if GlobalData.BuildOptionPcd:\r
- for PcdItem in GlobalData.BuildOptionPcd:\r
- if (Pcd.TokenSpaceGuidCName, TokenCName) == (PcdItem[0], PcdItem[1]):\r
- Pcd.DefaultValue = PcdItem[2]\r
- break\r
-\r
+ if Pcd.PcdValueFromComm:\r
+ Pcd.DefaultValue = Pcd.PcdValueFromComm\r
#\r
# Write PCDs\r
#\r
- if Pcd.Type in gDynamicExPcd:\r
+ if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:\r
TokenNumber = int(Pcd.TokenValue, 0)\r
else:\r
if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber:\r
# will not be added into the Database unless it is used by other modules that are \r
# included in the FDF file. \r
# In this case, just assign an invalid token number to make it pass build.\r
- if Pcd.Type in PCD_DYNAMIC_TYPE_LIST:\r
+ if Pcd.Type in PCD_DYNAMIC_TYPE_SET:\r
TokenNumber = 0\r
else:\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
EdkLogger.error("build", AUTOGEN_ERROR,\r
"Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, TokenCName),\r
ExtraData="[%s]" % str(Info))\r
- if Pcd.DatumType not in gDatumSizeStringDatabase:\r
- EdkLogger.error("build", AUTOGEN_ERROR,\r
- "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),\r
- ExtraData="[%s]" % str(Info))\r
\r
DatumType = Pcd.DatumType\r
- DatumSize = gDatumSizeStringDatabaseH[DatumType]\r
- DatumSizeLib= gDatumSizeStringDatabaseLib[DatumType]\r
- GetModeName = '_PCD_GET_MODE_' + DatumSize + '_' + TokenCName\r
- SetModeName = '_PCD_SET_MODE_' + DatumSize + '_' + TokenCName\r
- SetModeStatusName = '_PCD_SET_MODE_' + DatumSize + '_S_' + TokenCName\r
+ DatumSize = gDatumSizeStringDatabase[Pcd.DatumType] if Pcd.DatumType in gDatumSizeStringDatabase else gDatumSizeStringDatabase[TAB_VOID]\r
+ DatumSizeLib = gDatumSizeStringDatabaseLib[Pcd.DatumType] if Pcd.DatumType in gDatumSizeStringDatabaseLib else gDatumSizeStringDatabaseLib[TAB_VOID]\r
+ GetModeName = '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName\r
+ SetModeName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName\r
+ SetModeStatusName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_S_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_S_' + TokenCName\r
GetModeSizeName = '_PCD_GET_MODE_SIZE' + '_' + TokenCName\r
\r
Type = ''\r
Array = ''\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
if Pcd.DefaultValue[0]== '{':\r
Type = '(VOID *)'\r
Array = '[]'\r
PcdItemType = Pcd.Type\r
- PcdExCNameList = []\r
- if PcdItemType in gDynamicExPcd:\r
+ if PcdItemType in PCD_DYNAMIC_EX_TYPE_SET:\r
PcdExTokenName = '_PCD_TOKEN_' + TokenSpaceGuidCName + '_' + TokenCName\r
AutoGenH.Append('\n#define %s %dU\n' % (PcdExTokenName, TokenNumber))\r
\r
PcdList = Info.LibraryPcdList\r
else:\r
PcdList = Info.ModulePcdList\r
+ PcdExCNameTest = 0\r
for PcdModule in PcdList:\r
- if PcdModule.Type in gDynamicExPcd:\r
- PcdExCNameList.append(PcdModule.TokenCName)\r
+ if PcdModule.Type in PCD_DYNAMIC_EX_TYPE_SET and Pcd.TokenCName == PcdModule.TokenCName:\r
+ PcdExCNameTest += 1\r
+ # get out early once we found > 1...\r
+ if PcdExCNameTest > 1:\r
+ break\r
# Be compatible with the current code which using PcdGet/Set for DynamicEx Pcd.\r
# If only PcdGet/Set used in all Pcds with different CName, it should succeed to build.\r
# If PcdGet/Set used in the Pcds with different Guids but same CName, it should failed to build.\r
- if PcdExCNameList.count(Pcd.TokenCName) > 1:\r
+ if PcdExCNameTest > 1:\r
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')\r
AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTokenName))\r
AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
else:\r
AutoGenH.Append('#define %s %s\n' % (PcdTokenName, PcdExTokenName))\r
AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('#define %s LibPcdGetExSize(&%s, %s)\n' % (GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))\r
- if Pcd.DatumType == 'VOID*':\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
else:\r
AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))\r
else:\r
AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' % (TokenCName, TokenNumber))\r
- if PcdItemType in gDynamicPcd:\r
+ if PcdItemType in PCD_DYNAMIC_TYPE_SET:\r
PcdList = []\r
PcdCNameList = []\r
PcdList.extend(Info.LibraryPcdList)\r
PcdList.extend(Info.ModulePcdList)\r
for PcdModule in PcdList:\r
- if PcdModule.Type in gDynamicPcd:\r
+ if PcdModule.Type in PCD_DYNAMIC_TYPE_SET:\r
PcdCNameList.append(PcdModule.TokenCName)\r
if PcdCNameList.count(Pcd.TokenCName) > 1:\r
EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic Pcds [%s] are different Guids but same CName.They need to be changed to DynamicEx type to avoid the confliction.\n" % (TokenCName), ExtraData="[%s]" % str(Info.MetaFile.Path))\r
else:\r
AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName, DatumSizeLib, PcdTokenName))\r
AutoGenH.Append('#define %s LibPcdGetSize(%s)\n' % (GetModeSizeName, PcdTokenName))\r
- if DatumType == 'VOID*':\r
+ if DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSet%s(%s, (SizeOfBuffer), (Buffer))\n' %(SetModeName, DatumSizeLib, PcdTokenName))\r
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSet%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))\r
else:\r
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 == '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
+ if DatumType not in TAB_PCD_NUMERIC_TYPES:\r
+ if DatumType == TAB_VOID and Array == '[]':\r
+ DatumType = [TAB_UINT8, TAB_UINT16][Pcd.DefaultValue[0] == 'L']\r
+ else:\r
+ DatumType = TAB_UINT8\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
- PcdDataSize = GetPcdSize(Pcd)\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, TokenCName, TokenCName, TokenCName))\r
- 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))\r
- AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pcd.MaxDatumSize))\r
+ PcdDataSize = Pcd.GetPcdSize()\r
+ 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('extern const UINTN %s; \n' % PatchPcdMaxSizeVariable)\r
else:\r
AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName))\r
AutoGenH.Append('#define %s(Value) ((%s = (Value)), RETURN_SUCCESS)\n' % (SetModeStatusName, PcdVariableName))\r
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD or PcdItemType == TAB_PCDS_FEATURE_FLAG:\r
key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))\r
PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] + '_' + TokenCName\r
- if DatumType == 'VOID*' and Array == '[]':\r
- DatumType = ['UINT8', 'UINT16'][Pcd.DefaultValue[0] == 'L']\r
+ if DatumType == TAB_VOID and Array == '[]':\r
+ DatumType = [TAB_UINT8, TAB_UINT16][Pcd.DefaultValue[0] == 'L']\r
+ if DatumType not in TAB_PCD_NUMERIC_TYPES_VOID:\r
+ DatumType = TAB_UINT8\r
AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(DatumType, TokenCName, Array))\r
AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeName, Type, TokenCName))\r
AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)\r
\r
+ ConstFixedPcd = False\r
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and (key in Info.ConstPcd or (Info.IsLibrary and not Info._ReferenceModules)):\r
- if DatumType == 'VOID*':\r
+ ConstFixedPcd = True\r
+ if key in Info.ConstPcd:\r
+ Pcd.DefaultValue = Info.ConstPcd[key]\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName))\r
else:\r
AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName, Pcd.DefaultValue))\r
- \r
+ PcdDataSize = Pcd.GetPcdSize()\r
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD:\r
- PcdDataSize = GetPcdSize(Pcd)\r
- AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdDataSize))\r
- AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,FixPcdSizeTokenName))\r
+ if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:\r
+ if ConstFixedPcd:\r
+ AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdDataSize))\r
+ AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,FixPcdSizeTokenName))\r
+ else:\r
+ AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,FixedPcdSizeVariableName))\r
+ AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName,FixedPcdSizeVariableName))\r
+ AutoGenH.Append('extern const UINTN %s; \n' % FixedPcdSizeVariableName)\r
+ else:\r
+ AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdDataSize))\r
+ AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,FixPcdSizeTokenName))\r
\r
## Create code for library constructor\r
#\r
if len(Lib.ConstructorList) <= 0:\r
continue\r
Dict = {'Function':Lib.ConstructorList}\r
- if Lib.ModuleType in ['BASE', 'SEC']:\r
- ConstructorPrototypeString.Append(gLibraryStructorPrototype['BASE'].Replace(Dict))\r
- ConstructorCallingString.Append(gLibraryStructorCall['BASE'].Replace(Dict))\r
- elif Lib.ModuleType in ['PEI_CORE','PEIM']:\r
+ if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:\r
+ ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))\r
+ ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))\r
+ elif Lib.ModuleType in SUP_MODULE_SET_PEI:\r
ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))\r
ConstructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))\r
- elif Lib.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',\r
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:\r
+ elif Lib.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER,\r
+ SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]:\r
ConstructorPrototypeString.Append(gLibraryStructorPrototype['DXE'].Replace(Dict))\r
ConstructorCallingString.Append(gLibraryStructorCall['DXE'].Replace(Dict))\r
+ elif Lib.ModuleType in [SUP_MODULE_MM_STANDALONE,SUP_MODULE_MM_CORE_STANDALONE]:\r
+ ConstructorPrototypeString.Append(gLibraryStructorPrototype['MM'].Replace(Dict))\r
+ ConstructorCallingString.Append(gLibraryStructorCall['MM'].Replace(Dict))\r
\r
if str(ConstructorPrototypeString) == '':\r
ConstructorPrototypeList = []\r
if Info.IsLibrary:\r
AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)\r
else:\r
- if Info.ModuleType in ['BASE', 'SEC']:\r
- AutoGenC.Append(gLibraryString['BASE'].Replace(Dict))\r
- elif Info.ModuleType in ['PEI_CORE','PEIM']:\r
+ if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:\r
+ AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict))\r
+ elif Info.ModuleType in SUP_MODULE_SET_PEI:\r
AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))\r
- elif Info.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',\r
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:\r
+ elif Info.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER,\r
+ SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]:\r
AutoGenC.Append(gLibraryString['DXE'].Replace(Dict))\r
+ elif Info.ModuleType in [SUP_MODULE_MM_STANDALONE,SUP_MODULE_MM_CORE_STANDALONE]:\r
+ AutoGenC.Append(gLibraryString['MM'].Replace(Dict))\r
\r
## Create code for library destructor\r
#\r
if len(Lib.DestructorList) <= 0:\r
continue\r
Dict = {'Function':Lib.DestructorList}\r
- if Lib.ModuleType in ['BASE', 'SEC']:\r
- DestructorPrototypeString.Append(gLibraryStructorPrototype['BASE'].Replace(Dict))\r
- DestructorCallingString.Append(gLibraryStructorCall['BASE'].Replace(Dict))\r
- elif Lib.ModuleType in ['PEI_CORE','PEIM']:\r
+ if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:\r
+ DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))\r
+ DestructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))\r
+ elif Lib.ModuleType in SUP_MODULE_SET_PEI:\r
DestructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))\r
DestructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))\r
- elif Lib.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',\r
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_CORE']:\r
+ elif Lib.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER,\r
+ SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER,SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_SMM_CORE]:\r
DestructorPrototypeString.Append(gLibraryStructorPrototype['DXE'].Replace(Dict))\r
DestructorCallingString.Append(gLibraryStructorCall['DXE'].Replace(Dict))\r
+ elif Lib.ModuleType in [SUP_MODULE_MM_STANDALONE,SUP_MODULE_MM_CORE_STANDALONE]:\r
+ DestructorPrototypeString.Append(gLibraryStructorPrototype['MM'].Replace(Dict))\r
+ DestructorCallingString.Append(gLibraryStructorCall['MM'].Replace(Dict))\r
\r
if str(DestructorPrototypeString) == '':\r
DestructorPrototypeList = []\r
if Info.IsLibrary:\r
AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)\r
else:\r
- if Info.ModuleType in ['BASE', 'SEC']:\r
- AutoGenC.Append(gLibraryString['BASE'].Replace(Dict))\r
- elif Info.ModuleType in ['PEI_CORE','PEIM']:\r
+ if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:\r
+ AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict))\r
+ elif Info.ModuleType in SUP_MODULE_SET_PEI:\r
AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))\r
- elif Info.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',\r
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:\r
+ elif Info.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER,\r
+ SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]:\r
AutoGenC.Append(gLibraryString['DXE'].Replace(Dict))\r
+ elif Info.ModuleType in [SUP_MODULE_MM_STANDALONE,SUP_MODULE_MM_CORE_STANDALONE]:\r
+ AutoGenC.Append(gLibraryString['MM'].Replace(Dict))\r
\r
\r
## Create code for ModuleEntryPoint\r
# @param AutoGenH The TemplateString object for header file\r
#\r
def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):\r
- if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:\r
+ if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_SEC]:\r
return\r
#\r
# Module Entry Points\r
'UefiSpecVersion': UefiSpecVersion + 'U'\r
}\r
\r
- if Info.ModuleType in ['PEI_CORE', 'DXE_CORE', 'SMM_CORE']:\r
- if Info.SourceFileList <> None and Info.SourceFileList <> []:\r
+ if Info.ModuleType in [SUP_MODULE_PEI_CORE, SUP_MODULE_DXE_CORE, SUP_MODULE_SMM_CORE, SUP_MODULE_MM_CORE_STANDALONE]:\r
+ if Info.SourceFileList:\r
if NumEntryPoints != 1:\r
EdkLogger.error(\r
"build",\r
File=str(Info),\r
ExtraData= ", ".join(Info.Module.ModuleEntryPointList)\r
)\r
- if Info.ModuleType == 'PEI_CORE':\r
+ if Info.ModuleType == SUP_MODULE_PEI_CORE:\r
AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))\r
AutoGenH.Append(gPeiCoreEntryPointPrototype.Replace(Dict))\r
- elif Info.ModuleType == 'DXE_CORE':\r
+ elif Info.ModuleType == SUP_MODULE_DXE_CORE:\r
AutoGenC.Append(gDxeCoreEntryPointString.Replace(Dict))\r
AutoGenH.Append(gDxeCoreEntryPointPrototype.Replace(Dict))\r
- elif Info.ModuleType == 'SMM_CORE':\r
+ elif Info.ModuleType == SUP_MODULE_SMM_CORE:\r
AutoGenC.Append(gSmmCoreEntryPointString.Replace(Dict))\r
AutoGenH.Append(gSmmCoreEntryPointPrototype.Replace(Dict))\r
- elif Info.ModuleType == 'PEIM':\r
+ elif Info.ModuleType == SUP_MODULE_MM_CORE_STANDALONE:\r
+ AutoGenC.Append(gMmCoreStandaloneEntryPointString.Replace(Dict))\r
+ AutoGenH.Append(gMmCoreStandaloneEntryPointPrototype.Replace(Dict))\r
+ elif Info.ModuleType == SUP_MODULE_PEIM:\r
if NumEntryPoints < 2:\r
AutoGenC.Append(gPeimEntryPointString[NumEntryPoints].Replace(Dict))\r
else:\r
AutoGenC.Append(gPeimEntryPointString[2].Replace(Dict))\r
AutoGenH.Append(gPeimEntryPointPrototype.Replace(Dict))\r
- elif Info.ModuleType in ['DXE_RUNTIME_DRIVER','DXE_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:\r
+ elif Info.ModuleType in [SUP_MODULE_DXE_RUNTIME_DRIVER,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER]:\r
if NumEntryPoints < 2:\r
AutoGenC.Append(gUefiDriverEntryPointString[NumEntryPoints].Replace(Dict))\r
else:\r
AutoGenC.Append(gUefiDriverEntryPointString[2].Replace(Dict))\r
AutoGenH.Append(gUefiDriverEntryPointPrototype.Replace(Dict))\r
- elif Info.ModuleType == 'DXE_SMM_DRIVER':\r
+ elif Info.ModuleType == SUP_MODULE_DXE_SMM_DRIVER:\r
if NumEntryPoints == 0:\r
AutoGenC.Append(gDxeSmmEntryPointString[0].Replace(Dict))\r
else:\r
AutoGenC.Append(gDxeSmmEntryPointString[1].Replace(Dict))\r
- AutoGenH.Append(gDxeSmmEntryPointPrototype.Replace(Dict)) \r
- elif Info.ModuleType == 'UEFI_APPLICATION':\r
+ AutoGenH.Append(gDxeSmmEntryPointPrototype.Replace(Dict))\r
+ elif Info.ModuleType == SUP_MODULE_MM_STANDALONE:\r
+ if NumEntryPoints < 2:\r
+ AutoGenC.Append(gMmStandaloneEntryPointString[NumEntryPoints].Replace(Dict))\r
+ else:\r
+ AutoGenC.Append(gMmStandaloneEntryPointString[2].Replace(Dict))\r
+ AutoGenH.Append(gMmStandaloneEntryPointPrototype.Replace(Dict))\r
+ elif Info.ModuleType == SUP_MODULE_UEFI_APPLICATION:\r
if NumEntryPoints < 2:\r
AutoGenC.Append(gUefiApplicationEntryPointString[NumEntryPoints].Replace(Dict))\r
else:\r
# @param AutoGenH The TemplateString object for header file\r
#\r
def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):\r
- if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:\r
+ if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_SEC]:\r
return\r
#\r
# Unload Image Handlers\r
# @param AutoGenH The TemplateString object for header file\r
#\r
def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):\r
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:\r
- GuidType = "GUID"\r
+ if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_BASE]:\r
+ GuidType = TAB_GUID\r
else:\r
GuidType = "EFI_GUID"\r
\r
# @param AutoGenH The TemplateString object for header file\r
#\r
def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):\r
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:\r
- GuidType = "GUID"\r
+ if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_BASE]:\r
+ GuidType = TAB_GUID\r
else:\r
GuidType = "EFI_GUID"\r
\r
# @param AutoGenH The TemplateString object for header file\r
#\r
def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):\r
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:\r
- GuidType = "GUID"\r
+ if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_BASE]:\r
+ GuidType = TAB_GUID\r
else:\r
GuidType = "EFI_GUID"\r
\r
# Collect Token Space GUIDs used by DynamicEc PCDs\r
TokenSpaceList = []\r
for Pcd in Info.ModulePcdList:\r
- if Pcd.Type in gDynamicExPcd and Pcd.TokenSpaceGuidCName not in TokenSpaceList:\r
+ if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET and Pcd.TokenSpaceGuidCName not in TokenSpaceList:\r
TokenSpaceList += [Pcd.TokenSpaceGuidCName]\r
\r
+ SkuMgr = Info.Workspace.Platform.SkuIdMgr\r
+ AutoGenH.Append("\n// Definition of SkuId Array\n")\r
+ AutoGenH.Append("extern UINT64 _gPcd_SkuId_Array[];\n")\r
# Add extern declarations to AutoGen.h if one or more Token Space GUIDs were found\r
- if TokenSpaceList <> []: \r
+ if TokenSpaceList:\r
AutoGenH.Append("\n// Definition of PCD Token Space GUIDs used in this module\n\n")\r
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:\r
- GuidType = "GUID"\r
+ if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_BASE]:\r
+ GuidType = TAB_GUID\r
else:\r
GuidType = "EFI_GUID" \r
for Item in TokenSpaceList:\r
CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd)\r
DynExPcdTokenNumberMapping (Info, AutoGenH)\r
else:\r
+ AutoGenC.Append("\n// Definition of SkuId Array\n")\r
+ AutoGenC.Append("GLOBAL_REMOVE_IF_UNREFERENCED UINT64 _gPcd_SkuId_Array[] = %s;\n" % SkuMgr.DumpSkuIdArrary())\r
if Info.ModulePcdList:\r
AutoGenH.Append("\n// Definition of PCDs used in this module\n")\r
AutoGenC.Append("\n// Definition of PCDs used in this module\n")\r