- //\r
- // PCD protocol need to be installed before the module access Dynamic type PCD.\r
- // But dynamic type PCD is not required in PI 1.2 specification.\r
- // \r
- gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **)&mPcd);\r
- \r
- //\r
- // PI Pcd protocol defined in PI 1.2 vol3 should be installed before the module \r
- // access DynamicEx type PCD.\r
- //\r
- Status = gBS->LocateProtocol (&gEfiPcdProtocolGuid, NULL, (VOID **) &mPiPcd);\r
- \r
- ASSERT_EFI_ERROR (Status);\r
- ASSERT (mPiPcd!= NULL);\r
-\r
- return Status;\r
+ if (mPcd == NULL) {\r
+ //\r
+ // PCD protocol need to be installed before the module access Dynamic type PCD.\r
+ // But dynamic type PCD is not required in PI 1.2 specification.\r
+ // \r
+ Status = gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **)&mPcd);\r
+ ASSERT_EFI_ERROR (Status);\r
+ ASSERT (mPcd != NULL);\r
+ }\r
+ return mPcd;\r