/** @file\r
PCD DXE driver manage all PCD entry initialized in PEI phase and DXE phase, and\r
- produce the implementation of PCD protocol.\r
+ produce the implementation of native PCD protocol and EFI_PCD_PROTOCOL defined in\r
+ PI 1.2 Vol3.\r
\r
Copyright (c) 2006 - 2009, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
///\r
EFI_LOCK mPcdDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE(TPL_NOTIFY);\r
\r
+//\r
+// PCD_PROTOCOL the native implementation provided by MdePkg which support dynamic \r
+// type and dynamicEx type PCD.\r
+//\r
PCD_PROTOCOL mPcdInstance = {\r
DxePcdSetSku,\r
\r
DxePcdGetNextTokenSpace\r
};\r
\r
+//\r
+// EFI_PCD_PROTOCOL is defined in PI 1.2 Vol 3 which only support dynamicEx type\r
+// PCD.\r
+//\r
EFI_PCD_PROTOCOL mEfiPcdInstance = {\r
DxePcdSetSku,\r
DxePcdGet8Ex,\r
DxePcdGetNextTokenSpace\r
};\r
\r
-//\r
-// Static global to reduce the code size\r
-//\r
-EFI_HANDLE mNewHandle = NULL;\r
+\r
+\r
\r
/**\r
Main entry for PCD DXE driver.\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status;\r
-\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE mNewHandle;\r
+ \r
//\r
// Make sure the Pcd Protocol is not already installed in the system\r
//\r
\r
BuildPcdDxeDataBase ();\r
\r
- Status = gBS->InstallProtocolInterface (\r
- &mNewHandle,\r
- &gPcdProtocolGuid,\r
- EFI_NATIVE_INTERFACE,\r
- &mPcdInstance\r
- );\r
-\r
+ mNewHandle = NULL;\r
\r
//\r
- // Also install gEfiPcdProtocolGuid which is only support dynamic-ex type \r
- // PCD.\r
+ // Install PCD_PROTOCOL to handle dynamic type PCD\r
+ // Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD\r
//\r
- mNewHandle = NULL;\r
- Status = gBS->InstallProtocolInterface (\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
&mNewHandle,\r
+ &gPcdProtocolGuid,\r
+ &mPcdInstance,\r
&gEfiPcdProtocolGuid,\r
- EFI_NATIVE_INTERFACE,\r
&mEfiPcdInstance\r
);\r
- \r
+ \r
ASSERT_EFI_ERROR (Status);\r
\r
return EFI_SUCCESS;\r
\r
#include "Service.h"\r
\r
+//\r
+// Instance of PCD_PPI protocol is native implementation by MdePkg.\r
+// This protocol instance support dynamic and dynamicEx type PCDs.\r
+//\r
PCD_PPI mPcdPpiInstance = {\r
PeiPcdSetSku,\r
\r
PeiPcdGetNextTokenSpace\r
};\r
\r
+//\r
+// Instance of EFI_PEI_PCD_PPI which is defined in PI 1.2 Vol 3.\r
+// This PPI instance only support dyanmicEx type PCD.\r
+//\r
EFI_PEI_PCD_PPI mEfiPcdPpiInstance = {\r
PeiPcdSetSku,\r
\r
/**\r
Main entry for PCD PEIM driver.\r
\r
- This routine initialize the PCD database for PEI phase and install PCD_PPI.\r
+ This routine initialize the PCD database for PEI phase and install PCD_PPI/EFI_PEI_PCD_PPI.\r
\r
@param FileHandle Handle of the file being invoked.\r
@param PeiServices Describes the list of possible PEI Services.\r
IN CONST EFI_PEI_SERVICES **PeiServices\r
)\r
{\r
+ EFI_STATUS Status;\r
+ \r
BuildPcdDatabase ();\r
\r
- return PeiServicesInstallPpi (&mPpiPCD);\r
+ //\r
+ // Install PCD_PPI which produce support for dynamic and dynamicEx PCD\r
+ //\r
+ Status = PeiServicesInstallPpi (&mPpiPCD);\r
+ ASSERT_EFI_ERROR (Status);\r
+ \r
+ //\r
+ // Install EFI_PCD_PPI which produce support for dynamicEx PCD which is defined\r
+ // in PI 1.2 Vol 3 specification.\r
+ //\r
+ Status = PeiServicesInstallPpi (&mEfiPpiPCD);\r
+ ASSERT_EFI_ERROR (Status);\r
+ \r
+ return Status;\r
}\r
\r
/**\r