diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-11-24 02:28:06 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-11-24 02:28:06 +0000 |
commit | 17e7fa8fb1ee16d96a5323146ce6c68cb1d27dc2 (patch) | |
tree | 8f9c1a1dd38b613094a93ce1a8f0f4d380c47d37 /MdeModulePkg/Universal/PCD | |
parent | a32c6dcf3e661923f2a51bfad88a8750a2d6b282 (diff) | |
download | edk2-platforms-17e7fa8fb1ee16d96a5323146ce6c68cb1d27dc2.tar.xz |
Clean up code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9471 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/PCD')
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 33 | ||||
-rw-r--r-- | MdeModulePkg/Universal/PCD/Pei/Pcd.c | 48 |
2 files changed, 35 insertions, 46 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c index c8dab145af..83cbcdc3b2 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c @@ -28,10 +28,10 @@ EFI_GUID *TmpTokenSpaceBuffer[PEI_EXMAPPING_TABLE_SIZE + DXE_EXMAPPING_TABLE_SIZ ///
EFI_LOCK mPcdDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE(TPL_NOTIFY);
-//
-// PCD_PROTOCOL the native implementation provided by MdePkg which support dynamic
-// type and dynamicEx type PCD.
-//
+///
+/// PCD_PROTOCOL the EDKII native implementation which support dynamic
+/// type and dynamicEx type PCDs.
+///
PCD_PROTOCOL mPcdInstance = {
DxePcdSetSku,
@@ -71,10 +71,10 @@ PCD_PROTOCOL mPcdInstance = { DxePcdGetNextTokenSpace
};
-//
-// EFI_PCD_PROTOCOL is defined in PI 1.2 Vol 3 which only support dynamicEx type
-// PCD.
-//
+///
+/// EFI_PCD_PROTOCOL is defined in PI 1.2 Vol 3 which only support dynamicEx type
+/// PCD.
+///
EFI_PCD_PROTOCOL mEfiPcdInstance = {
DxePcdSetSku,
DxePcdGet8Ex,
@@ -96,8 +96,7 @@ EFI_PCD_PROTOCOL mEfiPcdInstance = { DxePcdGetNextTokenSpace
};
-
-
+EFI_HANDLE mPcdHandle = NULL;
/**
Main entry for PCD DXE driver.
@@ -118,7 +117,6 @@ PcdDxeInit ( )
{
EFI_STATUS Status;
- EFI_HANDLE mNewHandle;
//
// Make sure the Pcd Protocol is not already installed in the system
@@ -128,23 +126,20 @@ PcdDxeInit ( BuildPcdDxeDataBase ();
- mNewHandle = NULL;
-
//
// Install PCD_PROTOCOL to handle dynamic type PCD
// Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
//
Status = gBS->InstallMultipleProtocolInterfaces (
- &mNewHandle,
- &gPcdProtocolGuid,
- &mPcdInstance,
- &gEfiPcdProtocolGuid,
- &mEfiPcdInstance
+ &mPcdHandle,
+ &gPcdProtocolGuid, &mPcdInstance,
+ &gEfiPcdProtocolGuid, &mEfiPcdInstance,
+ NULL
);
ASSERT_EFI_ERROR (Status);
- return EFI_SUCCESS;
+ return Status;
}
diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c b/MdeModulePkg/Universal/PCD/Pei/Pcd.c index 783dd2d7a7..b2d5aaf2d3 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c @@ -14,10 +14,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Service.h"
-//
-// Instance of PCD_PPI protocol is native implementation by MdePkg.
-// This protocol instance support dynamic and dynamicEx type PCDs.
-//
+///
+/// Instance of PCD_PPI protocol is EDKII native implementation.
+/// This protocol instance support dynamic and dynamicEx type PCDs.
+///
PCD_PPI mPcdPpiInstance = {
PeiPcdSetSku,
@@ -57,10 +57,10 @@ PCD_PPI mPcdPpiInstance = { PeiPcdGetNextTokenSpace
};
-//
-// Instance of EFI_PEI_PCD_PPI which is defined in PI 1.2 Vol 3.
-// This PPI instance only support dyanmicEx type PCD.
-//
+///
+/// Instance of EFI_PEI_PCD_PPI which is defined in PI 1.2 Vol 3.
+/// This PPI instance only support dyanmicEx type PCD.
+///
EFI_PEI_PCD_PPI mEfiPcdPpiInstance = {
PeiPcdSetSku,
@@ -83,16 +83,17 @@ EFI_PEI_PCD_PPI mEfiPcdPpiInstance = { PeiPcdGetNextTokenSpace
};
-EFI_PEI_PPI_DESCRIPTOR mPpiPCD = {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gPcdPpiGuid,
- &mPcdPpiInstance
-};
-
-EFI_PEI_PPI_DESCRIPTOR mEfiPpiPCD = {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiPeiPcdPpiGuid,
- &mEfiPcdPpiInstance
+EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
+ {
+ EFI_PEI_PPI_DESCRIPTOR_PPI,
+ &gPcdPpiGuid,
+ &mPcdPpiInstance
+ },
+ {
+ (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+ &gEfiPeiPcdPpiGuid,
+ &mEfiPcdPpiInstance
+ }
};
/**
@@ -118,16 +119,9 @@ PcdPeimInit ( BuildPcdDatabase ();
//
- // Install PCD_PPI which produce support for dynamic and dynamicEx PCD
- //
- Status = PeiServicesInstallPpi (&mPpiPCD);
- ASSERT_EFI_ERROR (Status);
-
- //
- // Install EFI_PCD_PPI which produce support for dynamicEx PCD which is defined
- // in PI 1.2 Vol 3 specification.
+ // Install PCD_PPI and EFI_PEI_PCD_PPI.
//
- Status = PeiServicesInstallPpi (&mEfiPpiPCD);
+ Status = PeiServicesInstallPpi (&mPpiList[0]);
ASSERT_EFI_ERROR (Status);
return Status;
|