Add in feature flag PcdPeiPcdDatabaseSetEnabled, PcdPeiPcdDatabaseGetSizeEnabled, PcdPeiPcdDatabaseCallbackOnSetEnabled, PcdPeiPcdDatabaseExEnabled to allow user to customize Pcd service PEIM. It is very curical to save size in PEI phase.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1408 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2006-08-30 09:11:34 +00:00
parent e3e8956d13
commit f89f5802f8
5 changed files with 321 additions and 118 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<PlatformSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PlatformHeader>
<PlatformName>EdkModuleAll</PlatformName>
@ -231,6 +231,38 @@
<MaxDatumSize>1</MaxDatumSize>
<Value>0xAF</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseCallbackOnSetEnabled</C_Name>
<Token>0x00010032</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseExEnabled</C_Name>
<Token>0x00010033</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseGetSizeEnabled</C_Name>
<Token>0x00010031</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseSetEnabled</C_Name>
<Token>0x00010030</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
</PcdBuildDefinition>
<ModuleSaBuildOptions>
<FvBinding>NULL</FvBinding>
@ -4847,6 +4879,38 @@
<MaxDatumSize>1</MaxDatumSize>
<Value>0xAF</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseCallbackOnSetEnabled</C_Name>
<Token>0x00010032</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseExEnabled</C_Name>
<Token>0x00010033</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseGetSizeEnabled</C_Name>
<Token>0x00010031</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseSetEnabled</C_Name>
<Token>0x00010030</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
</PcdBuildDefinition>
<ModuleSaBuildOptions>
<FvBinding>NULL</FvBinding>
@ -8835,6 +8899,38 @@
<MaxDatumSize>1</MaxDatumSize>
<Value>0xAF</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseCallbackOnSetEnabled</C_Name>
<Token>0x00010032</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseExEnabled</C_Name>
<Token>0x00010033</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseGetSizeEnabled</C_Name>
<Token>0x00010031</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseSetEnabled</C_Name>
<Token>0x00010030</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
</PcdBuildDefinition>
<ModuleSaBuildOptions>
<FvBinding>NULL</FvBinding>
@ -12827,6 +12923,38 @@
<MaxDatumSize>1</MaxDatumSize>
<Value>0xAF</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseCallbackOnSetEnabled</C_Name>
<Token>0x00010032</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseExEnabled</C_Name>
<Token>0x00010033</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseGetSizeEnabled</C_Name>
<Token>0x00010031</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
<PcdData ItemType="FEATURE_FLAG">
<C_Name>PcdPeiPcdDatabaseSetEnabled</C_Name>
<Token>0x00010030</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<MaxDatumSize>1</MaxDatumSize>
<Value>true</Value>
</PcdData>
</PcdBuildDefinition>
<ModuleSaBuildOptions>
<FvBinding>NULL</FvBinding>
@ -16785,7 +16913,7 @@
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="SLINK">"/NOLOGO"</Option>
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="DLINK">"/NOLOGO", "/Machine:AMD64", "/ALIGN:32", "/DLL", "/NODEFAULTLIB", "/OPT:REF", "/ENTRY:${ENTRYPOINT}", "/SUBSYSTEM:${SUBSYSTEM}"</Option>
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="ASM">"/nologo", "/W3", "/WX", "/c", "/DEFI32"</Option>
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="ASMLINK"></Option>
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="ASMLINK"/>
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="PP">"/nologo", "/P", "/TC", "/FI${DEST_DIR_DEBUG}/AutoGen.h"</Option>
<Option ToolChainFamily="MSFT" SupArchList="X64" ToolCode="ASL">"/nologo"</Option>
<!--MSFT tool chain options definition : IPF-->
@ -16793,7 +16921,7 @@
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="SLINK">"/NOLOGO"</Option>
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="DLINK">"/NOLOGO", "/NODEFAULTLIB", "/IGNORE:4086", "/MAP", "/OPT:REF", "/MACHINE:IA64", "/ENTRY:${ENTRYPOINT}", "/SUBSYSTEM:${SUBSYSTEM}"</Option>
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="ASM">"-N us", "-X explicit", "-M ilp64", "-N so", "-W4"</Option>
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="ASMLINK"></Option>
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="ASMLINK"/>
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="PP">"/nologo", "/P", "/TC"</Option>
<Option ToolChainFamily="MSFT" SupArchList="IPF" ToolCode="ASL">"/nologo"</Option>
<!--INTEL tool chain options definition : EBC-->
@ -16804,7 +16932,7 @@
<!--GCC tool chain options definition : IA32-->
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="CC">"-Os", "-fshort-wchar", "-fno-strict-aliasing", "-Wall", "-Werror", "-c", "-include ${DEST_DIR_DEBUG}/AutoGen.h"</Option>
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="ASM">"-c", "-imacros ${DEST_DIR_DEBUG}/AutoGen.h"</Option>
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="SLINK"></Option>
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="SLINK"/>
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="DLINK">"-nostdlib", "-O2", "--gc-sections", "--dll", "--export-all-symbols", "--entry _${ENTRYPOINT}"</Option>
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="ASMLINK"/>
<Option ToolChainFamily="GCC" SupArchList="IA32" ToolCode="PP">"-E", "-x assembler-with-cpp", "-include ${DEST_DIR_DEBUG}/AutoGen.h"</Option>

View File

@ -457,10 +457,8 @@
<Entry Name="GenericPlatformTokenSpace">
<C_Name>gEfiGenericPlatformTokenSpaceGuid</C_Name>
<GuidValue>18D15EA6-9E14-40a1-B39C-59C44DA9D891</GuidValue>
<HelpText>
This is the token space GUID for platform generic PCD definitions.
Now FlashLayout and Platform CPU belong to this space.
</HelpText>
<HelpText>This is the token space GUID for platform generic PCD definitions.
Now FlashLayout and Platform CPU belong to this space.</HelpText>
</Entry>
<Entry Name="EdkModulePkgTokenSpace">
<C_Name>gEfiEdkModulePkgTokenSpaceGuid</C_Name>
@ -1003,11 +1001,9 @@
<DatumType>VOID*</DatumType>
<ValidUsage>DYNAMIC</ValidUsage>
<DefaultValue>{}</DefaultValue>
<HelpText>
This PCD is a array of EFI_PHYSICAL_ADDERSS of each Firmware Volume on the
<HelpText>This PCD is a array of EFI_PHYSICAL_ADDERSS of each Firmware Volume on the
platform. FVB driver will make use of this PCD entry to install EFI_FIRMWARE_BLOCK_PROTOCOL
on every FV specified.
</HelpText>
on every FV specified.</HelpText>
</PcdEntry>
<PcdEntry>
<C_Name>PcdFlashFvBaseArrayElementNumber</C_Name>
@ -1016,11 +1012,45 @@
<DatumType>UINT8</DatumType>
<ValidUsage>DYNAMIC</ValidUsage>
<DefaultValue>3</DefaultValue>
<HelpText>
This PCD is a number element in the array defined by PcdFlashFvBaseArray in
<HelpText>This PCD is a number element in the array defined by PcdFlashFvBaseArray in
gEfiGenericPlatformTokenSpaceGuid. Normally, we have 3 firmware volumes:
FV_MAIN, FV_RECOVERY, NV_STORAGE.
</HelpText>
FV_MAIN, FV_RECOVERY, NV_STORAGE.</HelpText>
</PcdEntry>
<PcdEntry>
<C_Name>PcdPeiPcdDatabaseSetEnabled</C_Name>
<Token>0x00010030</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<ValidUsage>FEATURE_FLAG</ValidUsage>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the SET capability of PCD service PEIM. If a platform does not do PCD SET operation in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
<PcdEntry>
<C_Name>PcdPeiPcdDatabaseGetSizeEnabled</C_Name>
<Token>0x00010031</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<ValidUsage>FEATURE_FLAG</ValidUsage>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the GET size capability of PCD service PEIM. If a platform does not do PCD get size operation in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
<PcdEntry>
<C_Name>PcdPeiPcdDatabaseCallbackOnSetEnabled</C_Name>
<Token>0x00010032</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<ValidUsage>FEATURE_FLAG</ValidUsage>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the Callback On SET capability of PCD service PEIM. If a platform does not register any callback on set in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
<PcdEntry>
<C_Name>PcdPeiPcdDatabaseExEnabled</C_Name>
<Token>0x00010033</Token>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>BOOLEAN</DatumType>
<ValidUsage>FEATURE_FLAG</ValidUsage>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the PCD service PEIM to handle DynamicEX PCD. If a platform has no module to use DynamicEX in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
</PcdDeclarations>
</PackageSurfaceArea>

View File

@ -174,6 +174,10 @@ PeiPcdGetSize (
UINTN Size;
UINTN MaxSize;
if (!FeaturePcdGet(PcdPeiPcdDatabaseGetSizeEnabled)) {
return EFI_UNSUPPORTED;
}
PeiPcdDb = GetPcdDatabase ();
//
// TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
@ -281,6 +285,10 @@ PeiPcdGetSizeEx (
IN UINTN ExTokenNumber
)
{
if ((!FeaturePcdGet (PcdPeiPcdDatabaseGetSizeEnabled)) || !FeaturePcdGet (PcdPeiPcdDatabaseExEnabled)) {
return EFI_UNSUPPORTED;
}
return PeiPcdGetSize (GetExPcdTokenNumber (Guid, ExTokenNumber));
}
@ -446,6 +454,10 @@ PeiRegisterCallBackOnSet (
IN PCD_PPI_CALLBACK CallBackFunction
)
{
if (!FeaturePcdGet(PcdPeiPcdDatabaseCallbackOnSetEnabled)) {
return EFI_UNSUPPORTED;
}
ASSERT (CallBackFunction != NULL);
return PeiRegisterCallBackWorker (ExTokenNumber, Guid, CallBackFunction, TRUE);
@ -461,6 +473,10 @@ PcdUnRegisterCallBackOnSet (
IN PCD_PPI_CALLBACK CallBackFunction
)
{
if (!FeaturePcdGet(PcdPeiPcdDatabaseCallbackOnSetEnabled)) {
return EFI_UNSUPPORTED;
}
ASSERT (CallBackFunction != NULL);
return PeiRegisterCallBackWorker (ExTokenNumber, Guid, CallBackFunction, FALSE);

View File

@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
<?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MsaHeader>
<ModuleName>PcdPeim</ModuleName>
<ModuleType>PEIM</ModuleType>
@ -93,23 +85,47 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
</Extern>
</Externs>
<PcdCoded>
<PcdEntry PcdItemType="FIXED_AT_BUILD">
<PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">
<C_Name>PcdMaxPeiPcdCallBackNumberPerPcdEntry</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText>The maximum number of callback function, which will be triggered when
a PCD entry is been set, can be registered for a single PCD entry in PEI phase.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FIXED_AT_BUILD">
<PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">
<C_Name>PcdVpdBaseAddress</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText>The base address of the VPD (Vital Product Data) region. It is
normally a region reserved on flash.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG">
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdPeiPcdDatabaseTraverseEnabled</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText>This feature flag can be used to enable or disable the Pcd PEIM database
traverse capability. Disable it can reduce the size of final image generated.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdPeiPcdDatabaseCallbackOnSetEnabled</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the Callback On SET capability of PCD service PEIM. If a platform does not register any callback on set in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdPeiPcdDatabaseExEnabled</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the PCD service PEIM to handle DynamicEX PCD. If a platform has no module to use DynamicEX in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdPeiPcdDatabaseGetSizeEnabled</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the GET size capability of PCD service PEIM. If a platform does not do PCD get size operation in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdPeiPcdDatabaseSetEnabled</C_Name>
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag can be used to enable or disable the SET capability of PCD service PEIM. If a platform does not do PCD SET operation in PEI phase. This flag can be set to DISABLE to save size.</HelpText>
</PcdEntry>
</PcdCoded>
</ModuleSurfaceArea>

View File

@ -337,6 +337,10 @@ SetWorker (
VOID *InternalData;
UINTN MaxSize;
if (!FeaturePcdGet(PcdPeiPcdDatabaseSetEnabled)) {
return EFI_UNSUPPORTED;
}
//
// TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
// We have to decrement TokenNumber by 1 to make it usable
@ -462,6 +466,10 @@ ExSetWorker (
{
UINTN TokenNumber;
if (!FeaturePcdGet(PcdPeiPcdDatabaseSetEnabled)) {
return EFI_UNSUPPORTED;
}
TokenNumber = GetExPcdTokenNumber (Guid, ExTokenNumber);
InvokeCallbackOnSet (ExTokenNumber, Guid, TokenNumber, Data, *Size);
@ -480,6 +488,11 @@ ExGetWorker (
IN UINTN GetSize
)
{
if (!FeaturePcdGet (PcdPeiPcdDatabaseExEnabled)) {
ASSERT (FALSE);
return 0;
}
return GetWorker (GetExPcdTokenNumber (Guid, ExTokenNumber), GetSize);
}