]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Pcd.h
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[mirror_edk2.git] / MdePkg / Include / Protocol / Pcd.h
index 9a6880c4499211bd67dfca98b00326d7a4600779..9765206d0b9d206bf040124cc765e59ef529d5f1 100644 (file)
@@ -15,8 +15,6 @@
 #ifndef __PCD_H__\r
 #define __PCD_H__\r
 \r
-#include <PiDxe.h>\r
-\r
 extern EFI_GUID gPcdProtocolGuid;\r
 \r
 #define PCD_PROTOCOL_GUID \\r
@@ -76,9 +74,9 @@ UINT8
 \r
 \r
 /**\r
-  Retrieves an 16-bit value for a given PCD token.\r
+  Retrieves a 16-bit value for a given PCD token.\r
 \r
-  Retrieves the current 16-bits value for a PCD token number.  \r
+  Retrieves the current 16-bit value for a PCD token number.  \r
   If the TokenNumber is invalid, the results are unpredictable.\r
   \r
   @param[in]  TokenNumber The PCD token number. \r
@@ -95,9 +93,9 @@ UINT16
 \r
 \r
 /**\r
-  Retrieves an 32-bit value for a given PCD token.\r
+  Retrieves a 32-bit value for a given PCD token.\r
 \r
-  Retrieves the current 32-bits value for a PCD token number.  \r
+  Retrieves the current 32-bit value for a PCD token number.  \r
   If the TokenNumber is invalid, the results are unpredictable.\r
   \r
   @param[in]  TokenNumber The PCD token number. \r
@@ -114,9 +112,9 @@ UINT32
 \r
 \r
 /**\r
-  Retrieves an 64-bit value for a given PCD token.\r
+  Retrieves a 64-bit value for a given PCD token.\r
 \r
-  Retrieves the current 64-bits value for a PCD token number.  \r
+  Retrieves the current 64-bit value for a PCD token number.  \r
   If the TokenNumber is invalid, the results are unpredictable.\r
   \r
   @param[in]  TokenNumber The PCD token number. \r
@@ -217,7 +215,7 @@ UINT8
 \r
 \r
 /**\r
-  Retrieves an 16-bit value for a given PCD token.\r
+  Retrieves a 16-bit value for a given PCD token.\r
 \r
   Retrieves the 16-bit value of a particular PCD token.  \r
   If the TokenNumber is invalid or the token space\r
@@ -240,7 +238,7 @@ UINT16
 \r
 \r
 /**\r
-  Retrieves an 32-bit value for a given PCD token.\r
+  Retrieves a 32-bit value for a given PCD token.\r
 \r
   Retrieves the 32-bit value of a particular PCD token.  \r
   If the TokenNumber is invalid or the token space\r
@@ -296,7 +294,7 @@ UINT64
   @param[in]  Guid        The token space for the token number.\r
   @param[in]  TokenNumber The PCD token number. \r
 \r
-  @return The pointer to the buffer to be retrived.\r
+  @return The pointer to the buffer to be retrieved.\r
   \r
 **/\r
 typedef\r
@@ -309,7 +307,7 @@ VOID *
 \r
 \r
 /**\r
-  Retrieves an Boolean value for a given PCD token.\r
+  Retrieves a Boolean value for a given PCD token.\r
 \r
   Retrieves the Boolean value of a particular PCD token.  \r
   If the TokenNumber is invalid or the token space\r
@@ -379,7 +377,7 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Sets an 16-bit value for a given PCD token.\r
+  Sets a 16-bit value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -405,7 +403,7 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Sets an 32-bit value for a given PCD token.\r
+  Sets a 32-bit value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -431,7 +429,7 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Sets an 64-bit value for a given PCD token.\r
+  Sets a 64-bit value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -488,7 +486,7 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Sets an Boolean value for a given PCD token.\r
+  Sets a Boolean value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -570,7 +568,7 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Sets an 32-bit value for a given PCD token.\r
+  Sets a 32-bit value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -598,7 +596,7 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Sets an 64-bit value for a given PCD token.\r
+  Sets a 64-bit value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -650,16 +648,16 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *PCD_PROTOCOL_SET_EX_POINTER)(\r
-  IN      CONST EFI_GUID    *Guid,\r
-  IN      UINTN             TokenNumber,\r
-  IN OUT  UINTN             *SizeOfBuffer,\r
-  IN      VOID              *Buffer\r
+  IN CONST EFI_GUID          *Guid,\r
+  IN       UINTN             TokenNumber,\r
+  IN OUT   UINTN             *SizeOfBuffer,\r
+  IN       VOID              *Buffer\r
   );\r
 \r
 \r
 \r
 /**\r
-  Sets an Boolean value for a given PCD token.\r
+  Sets a Boolean value for a given PCD token.\r
 \r
   When the PCD service sets a value, it will check to ensure that the \r
   size of the value being set is compatible with the Token's existing definition.  \r
@@ -692,8 +690,8 @@ EFI_STATUS
   This notification function serves two purposes. \r
   Firstly, it notifies the module which did the registration that the value \r
   of this PCD token has been set. Secondly, it provides a mechanism for the \r
-  module which did the registration to intercept the set operation and override \r
-  the value been set if necessary. After the invocation of the callback function, \r
+  module that did the registration to intercept the set operation and override \r
+  the value that has been set, if necessary. After the invocation of the callback function, \r
   TokenData will be used by PCD service DXE driver to modify the internal data in \r
   PCD database.\r
 \r
@@ -708,10 +706,10 @@ EFI_STATUS
 typedef\r
 VOID\r
 (EFIAPI *PCD_PROTOCOL_CALLBACK)(\r
-  IN      CONST EFI_GUID   *CallBackGuid, OPTIONAL\r
-  IN      UINTN            CallBackToken,\r
-  IN  OUT VOID             *TokenData,\r
-  IN      UINTN            TokenDataSize\r
+  IN CONST EFI_GUID         *CallBackGuid, OPTIONAL\r
+  IN       UINTN            CallBackToken,\r
+  IN OUT   VOID             *TokenData,\r
+  IN       UINTN            TokenDataSize\r
   );\r
 \r
 \r
@@ -761,17 +759,26 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Retrieves the next valid PCD token for a given namespace.\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 extract the value.\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
-                          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
                         is already the last valid token number in the PCD database. \r
@@ -791,14 +798,14 @@ EFI_STATUS
 /**\r
   Retrieves the next valid PCD token namespace for a given namespace.\r
 \r
-  @param[in, out]  Guid An indirect pointer to EFI_GUID.  On input it designates \r
+  @param[in, out]  Guid An indirect pointer to EFI_GUID. On input it designates \r
                         a known token namespace from which the search will start. On output, \r
                         it designates the next valid token namespace on the platform. If the input \r
                         token namespace does not exist on the platform, an error is returned and \r
                         the value of *Guid is undefined. If *Guid is NULL, then the GUID of the \r
                         first token space of the current platform is assigned to *Guid the function \r
-                        return EFI_SUCCESS. If  *Guid is NULL  and there is no namespace exist in \r
-                        the platform other than the default (NULL) tokennamespace, *Guid is unchanged \r
+                        return EFI_SUCCESS. If *Guid is NULL  and there is no namespace exist in \r
+                        the platform other than the default (NULL) token namespace, *Guid is unchanged \r
                         and the function return EFI_SUCCESS. If this input token namespace is the last \r
                         namespace on the platform, *Guid will be assigned to NULL and the function return \r
                         EFI_SUCCESS. \r
@@ -815,107 +822,9 @@ EFI_STATUS
   IN  OUT    CONST EFI_GUID      **Guid\r
   );\r
 \r
-//\r
-// Interface structure for the PCD Protocol\r
-//\r
-/**\r
-  @par Protocol Description:\r
-  This service abstracts the ability to set/get Platform Configuration Database (PCD).\r
-\r
-  @param SetSku\r
-  Sets the SKU value for subsequent calls to set or get PCD token values.\r
-  \r
-  @param Get8\r
-  Retrieves an 8-bit value for a given PCD token.\r
-\r
-  @param Get16\r
-  Retrieves an 16-bit value for a given PCD token.\r
-\r
-  @param Get32\r
-  Retrieves an 32-bit value for a given PCD token.\r
-\r
-  @param Get64\r
-  Retrieves an 64-bit value for a given PCD token.\r
-\r
-  @param GetPtr\r
-  Retrieves a pointer to a value for a given PCD token.\r
-\r
-  @param GetBool\r
-  Retrieves an Boolean value for a given PCD token.\r
-\r
-  @param GetSize\r
-  Retrieves the size of the value for a given PCD token.\r
-\r
-  @param Get8Ex\r
-  Retrieves an 8-bit value for a given PCD token and token space.\r
-\r
-  @param Get16Ex\r
-  Retrieves an 16-bit value for a given PCD token and token space.\r
-\r
-  @param Get32Ex\r
-  Retrieves an 32-bit value for a given PCD token and token space.\r
-\r
-  @param Get64Ex\r
-  Retrieves an 64-bit value for a given PCD token and token space.\r
-\r
-  @param GetPtrEx\r
-  Retrieves a pointer to a value for a given PCD token and token space.\r
-\r
-  @param GetBoolEx\r
-  Retrieves an Boolean value for a given PCD token and token space.\r
-\r
-  @param GetSizeEx\r
-  Retrieves the size of the value for a given PCD token and token space.\r
-\r
-  @param Set8\r
-  Sets an 8-bit value for a given PCD token.\r
-\r
-  @param Set16\r
-  Sets an 16-bit value for a given PCD token.\r
-\r
-  @param Set32\r
-  Sets an 32-bit value for a given PCD token.\r
-\r
-  @param Set64\r
-  Sets an 64-bit value for a given PCD token.\r
-\r
-  @param SetPtr\r
-  Sets the buffer of a specified size for a given PCD token.\r
-\r
-  @param SetBool\r
-  Sets an Boolean value for a given PCD token.\r
-\r
-  @param Set8Ex\r
-  Sets an 8-bit value for a given PCD token and token space.\r
-\r
-  @param Set16Ex\r
-  Sets an 16-bit value for a given PCD token and token space.\r
-\r
-  @param Set32Ex\r
-  Sets an 32-bit value for a given PCD token and token space.\r
-\r
-  @param Set64Ex\r
-  Sets an 64-bit value for a given PCD token and token space.\r
-\r
-  @param SetPtrEx\r
-  Sets the buffer of a specified size for a given PCD token and token space.\r
-\r
-  @param SetBoolEx\r
-  Sets an Boolean value for a given PCD token and token space.\r
-  \r
-  @param CallbackOnSet\r
-  Specifies a function to be called anytime the value of a designated token is changed.\r
-  \r
-  @param CancelCallback\r
-  Cancels a previously set callback function for a particular PCD token number.\r
-  \r
-  @param GetNextToken\r
-  Retrieves the next valid PCD token for a given namespace.\r
-  \r
-  @param GetNextTokenSpace\r
-  Retrieves the next valid PCD token namespace for a given namespace.\r
\r
-**/\r
+///\r
+/// This service abstracts the ability to set/get Platform Configuration Database (PCD).\r
+///\r
 typedef struct {\r
   PCD_PROTOCOL_SET_SKU              SetSku;\r
 \r