]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Dxe/Service.h
1, Correct the PCD PEIM to produce gEfiPcdPpi and gPcdPpi at same time;
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Dxe / Service.h
index 67114be3bbb61a9aa81c6dfd037b526cb26fe090..583b0d657d5600363af49b73a917d482489b8725 100644 (file)
@@ -16,7 +16,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define _PCD_DXE_SERVICE_H_\r
 \r
 #include <PiDxe.h>\r
+#include <Guid/PcdDataBaseHobGuid.h>\r
 #include <Protocol/Pcd.h>\r
+#include <Protocol/PiPcd.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiLib.h>\r
@@ -679,18 +681,28 @@ DxeUnRegisterCallBackOnSet (
   );\r
 \r
 /**\r
-  Retrieves the next valid PCD token for a given namespace.\r
-\r
-  @param[in]      Guid          The 128-bit unique value that designates the namespace from which to extract the value.\r
-  @param[in, out]  TokenNumber   A pointer to the PCD token number to use to find the subsequent token number.  \r
-                                If the input token namespace or token number does not exist on the platform, \r
-                                an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token, \r
-                                have the pointer reference a TokenNumber value of 0. If the input token number is 0 and \r
-                                there is no valid token number for this token namespace,  *TokenNumber will be assigned to \r
-                                0 and the function return EFI_SUCCESS. If the token number is the last valid token number, \r
-                                *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.\r
-\r
-  @retval EFI_SUCCESS  The PCD service retrieved the next valid token number. Or the input token number \r
+  Retrieves the next valid token number in a given namespace.  \r
+  \r
+  This is useful since the PCD infrastructure contains a sparse list of token numbers, \r
+  and one cannot a priori know what token numbers are valid in the database. \r
+  \r
+  If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.  \r
+  If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.  \r
+  If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.  \r
+  If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.  \r
+  The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.  \r
+  If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.  \r
+  If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.  \r
+  If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.\r
+\r
+\r
+  @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
+                          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
                         is already the last valid token number in the PCD database. \r
                         In the later case, *TokenNumber is updated with the value of 0.\r
   @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.\r
@@ -1057,8 +1069,6 @@ SetPtrTypeSize (
   IN    OUT   UINTN             *CurrentSize\r
   );\r
 \r
-extern EFI_GUID gPcdDataBaseHobGuid;\r
-\r
 extern PCD_DATABASE * mPcdDatabase;\r
 \r
 extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit;\r
@@ -1066,3 +1076,4 @@ extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit;
 extern EFI_LOCK mPcdDatabaseLock;\r
 \r
 #endif\r
+\r