diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-30 09:11:34 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-30 09:11:34 +0000 |
commit | f89f5802f82b1b83f85a074fc0f76ec782e003b5 (patch) | |
tree | a3eb8cdc3ab4c7c7d86f68ae402954c6b858080c /EdkModulePkg/Universal/PCD | |
parent | e3e8956d1353d4623d5997cd7122fbbb2a817875 (diff) | |
download | edk2-platforms-f89f5802f82b1b83f85a074fc0f76ec782e003b5.tar.xz |
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
Diffstat (limited to 'EdkModulePkg/Universal/PCD')
-rw-r--r-- | EdkModulePkg/Universal/PCD/Pei/Pcd.c | 16 | ||||
-rw-r--r-- | EdkModulePkg/Universal/PCD/Pei/Pcd.msa | 60 | ||||
-rw-r--r-- | EdkModulePkg/Universal/PCD/Pei/Service.c | 13 |
3 files changed, 67 insertions, 22 deletions
diff --git a/EdkModulePkg/Universal/PCD/Pei/Pcd.c b/EdkModulePkg/Universal/PCD/Pei/Pcd.c index 40013cf8b5..33972d3c7f 100644 --- a/EdkModulePkg/Universal/PCD/Pei/Pcd.c +++ b/EdkModulePkg/Universal/PCD/Pei/Pcd.c @@ -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);
diff --git a/EdkModulePkg/Universal/PCD/Pei/Pcd.msa b/EdkModulePkg/Universal/PCD/Pei/Pcd.msa index 9510738246..0ae491a85a 100644 --- a/EdkModulePkg/Universal/PCD/Pei/Pcd.msa +++ b/EdkModulePkg/Universal/PCD/Pei/Pcd.msa @@ -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>
@@ -16,11 +8,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <Abstract>Component description file for Pcd Database PEIM module</Abstract>
<Description>This DXE driver implement and produce the PCD PPI.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
- <License>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,
+ <License>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.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
@@ -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
+ <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
+ <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
+ <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>
+</ModuleSurfaceArea>
\ No newline at end of file diff --git a/EdkModulePkg/Universal/PCD/Pei/Service.c b/EdkModulePkg/Universal/PCD/Pei/Service.c index 255267c9ab..521c88b7fc 100644 --- a/EdkModulePkg/Universal/PCD/Pei/Service.c +++ b/EdkModulePkg/Universal/PCD/Pei/Service.c @@ -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);
}
|