]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Dxe/Pcd.c
Change back the TPL of PCD from TPL_CALLBACK to TPL_NOTIFY because the following...
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Dxe / Pcd.c
index 0bb44ff81c1f82d2e156c7cfbdcf1562ec37f46a..363a949ea599951315b56ba81421cfccc3a2bc81 100644 (file)
@@ -1,8 +1,9 @@
 /** @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
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -27,6 +28,10 @@ EFI_GUID *TmpTokenSpaceBuffer[PEI_EXMAPPING_TABLE_SIZE + DXE_EXMAPPING_TABLE_SIZ
 ///\r
 EFI_LOCK mPcdDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE(TPL_NOTIFY);\r
 \r
+///\r
+/// PCD_PROTOCOL the EDKII native implementation which support dynamic \r
+/// type and dynamicEx type PCDs.\r
+///\r
 PCD_PROTOCOL mPcdInstance = {\r
   DxePcdSetSku,\r
 \r
@@ -66,6 +71,10 @@ PCD_PROTOCOL mPcdInstance = {
   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
@@ -87,10 +96,7 @@ EFI_PCD_PROTOCOL mEfiPcdInstance = {
   DxePcdGetNextTokenSpace\r
 };\r
 \r
-//\r
-// Static global to reduce the code size\r
-//\r
-EFI_HANDLE mNewHandle = NULL;\r
+EFI_HANDLE mPcdHandle = NULL;\r
 \r
 /**\r
   Main entry for PCD DXE driver.\r
@@ -110,8 +116,8 @@ PcdDxeInit (
   IN EFI_SYSTEM_TABLE     *SystemTable\r
   )\r
 {\r
-  EFI_STATUS          Status;\r
-\r
+  EFI_STATUS Status;\r
+  \r
   //\r
   // Make sure the Pcd Protocol is not already installed in the system\r
   //\r
@@ -120,29 +126,20 @@ PcdDxeInit (
 \r
   BuildPcdDxeDataBase ();\r
 \r
-  Status = gBS->InstallProtocolInterface (\r
-                  &mNewHandle,\r
-                  &gPcdProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mPcdInstance\r
-                  );\r
-\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
-                  &mNewHandle,\r
-                  &gEfiPcdProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mEfiPcdInstance\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &mPcdHandle,\r
+                  &gPcdProtocolGuid,     &mPcdInstance,\r
+                  &gEfiPcdProtocolGuid,  &mEfiPcdInstance,\r
+                  NULL\r
                   );\r
-                  \r
+                 \r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 \r
 }\r
 \r
@@ -971,7 +968,7 @@ DxeUnRegisterCallBackOnSet (
   @param[in]      Guid    The 128-bit unique value that designates the namespace from which to retrieve the next token. \r
                           This is an optional parameter that may be NULL.  If this parameter is NULL, then a request is \r
                           being made to retrieve tokens from the default token space.\r
-  @param[in,out]  TokenNumber \r
+  @param[in, out] TokenNumber \r
                           A pointer to the PCD token number to use to find the subsequent token number.  \r
 \r
   @retval EFI_SUCCESS   The PCD service retrieved the next valid token number. Or the input token number \r