]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/PiPcd.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / PiPcd.h
index 19376f411dd14ff167c1164e06ef31470e52c1ef..33704a0ad8a7fb86b45ef6852dd5f5cf0b3449ff 100644 (file)
@@ -1,10 +1,10 @@
 /** @file\r
   Platform Configuration Database (PCD) Protocol defined in PI 1.2 Vol3\r
 \r
-  A platform database that contains a variety of current platform settings or \r
+  A platform database that contains a variety of current platform settings or\r
   directives that can be accessed by a driver or application.\r
   PI PCD protocol only provide the accessing interfaces for Dynamic-Ex type PCD.\r
-  \r
+\r
   Callers to this protocol must be at a TPL_APPLICATION task priority level.\r
   This is the base PCD service API that provides an abstraction for accessing configuration content in\r
   the platform. It a seamless mechanism for extracting information regardless of where the\r
   This protocol allows access to data through size-granular APIs and provides a mechanism for a\r
   firmware component to monitor specific settings and be alerted when a setting is changed.\r
 \r
-  Copyright (c) 2009, 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
-  http://opensource.org/licenses/bsd-license.php                                            \r
+  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  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
+  http://opensource.org/licenses/bsd-license.php\r
 \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-  @par Revision Reference: \r
+  @par Revision Reference:\r
   PI Version 1.2 Vol 3.\r
 **/\r
 \r
@@ -47,7 +47,7 @@ extern EFI_GUID gEfiPcdProtocolGuid;
   Id is set or the currently set SKU Id isn't valid for the specified token, the system uses the default\r
   SKU Id. If the system attempts to use the default SKU Id and no value has been set for that Id, the\r
   results are unpredictable.\r
-  \r
+\r
   @param[in]  SkuId   The SKU value to set.\r
 **/\r
 typedef\r
@@ -59,37 +59,37 @@ VOID
 /**\r
   Retrieves an 8-bit value for a given PCD token.\r
   If the TokenNumber is invalid, the results are unpredictable.\r
-  \r
+\r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    TokenNumber The PCD token number.\r
-  \r
+\r
   @return 8-bit value for a given PCD token.\r
 **/\r
 typedef\r
 UINT8\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_8)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_8)(\r
   IN CONST EFI_GUID   *Guid,\r
   IN       UINTN      TokenNumber\r
 );\r
 \r
 /**\r
-  Retrieves the current word-sized value for a PCD token number. \r
+  Retrieves the current word-sized value for a PCD token number.\r
   If the TokenNumber is invalid, the results are unpredictable.\r
-  \r
+\r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    TokenNumber The PCD token number.\r
-  \r
-  @return word-sized value for a given PCD token.  \r
+\r
+  @return word-sized value for a given PCD token.\r
 **/\r
 typedef\r
 UINT16\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_16)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_16)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber\r
 );\r
 \r
 /**\r
-  Retrieves the current 32-bit sized value for a PCD token number. \r
+  Retrieves the current 32-bit sized value for a PCD token number.\r
   If the TokenNumber is invalid, the results are unpredictable.\r
 \r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
@@ -99,24 +99,24 @@ UINT16
 **/\r
 typedef\r
 UINT32\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_32)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_32)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber\r
 );\r
 \r
 /**\r
-  Retrieves the 64-bit sized value for a PCD token number. \r
+  Retrieves the 64-bit sized value for a PCD token number.\r
   If the TokenNumber is invalid, the results are unpredictable.\r
-  \r
+\r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    TokenNumber The PCD token number.\r
 \r
   @return 64-bit value for a given PCD token.\r
-  \r
+\r
 **/\r
 typedef\r
 UINT64\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_64)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_64)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber\r
 );\r
@@ -125,7 +125,7 @@ UINT64
   Retrieves the current pointer to the value for a PCD token number. Do not make any assumptions\r
   about the alignment of the pointer that is returned by this function call. If the TokenNumber is\r
   invalid, the results are unpredictable.\r
-  \r
+\r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    TokenNumber The PCD token number.\r
 \r
@@ -133,7 +133,7 @@ UINT64
 **/\r
 typedef\r
 VOID *\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_POINTER)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_POINTER)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber\r
 );\r
@@ -141,15 +141,15 @@ VOID *
 /**\r
   Retrieves the current BOOLEAN-sized value for a PCD token number. If the TokenNumber is\r
   invalid, the results are unpredictable.\r
-  \r
+\r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    TokenNumber The PCD token number.\r
-  \r
+\r
   @return Boolean value for a given PCD token.\r
 **/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_BOOLEAN)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_BOOLEAN)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber\r
 );\r
@@ -157,29 +157,29 @@ BOOLEAN
 /**\r
   Retrieves the current size of a particular PCD token. If the TokenNumber is invalid, the results are\r
   unpredictable.\r
-  \r
+\r
   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    TokenNumber The PCD token number.\r
-  \r
+\r
   @return the size of the value for a given PCD token.\r
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *EFI_PCD_PROTOCOL_GET_EX_SIZE)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_GET_SIZE)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber\r
 );\r
 \r
 /**\r
   Sets an 8-bit value for a given PCD token.\r
-  \r
+\r
   When the PCD service sets a value, it will check to ensure that the size of the value being set is\r
   compatible with the Token's existing definition. If it is not, an error will be 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]    TokenNumber The PCD token number.\r
   @param[in]    Value       The value to set for the PCD token.\r
-  \r
+\r
   @retval   EFI_SUCCESS             The PCD service has set the value requested\r
   @retval   EFI_INVALID_PARAMETER   The PCD service determined that the size of the data being set was\r
                                     incompatible with a call to this function. Use GetSizeEx() to\r
@@ -188,7 +188,7 @@ UINTN
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PCD_PROTOCOL_SET_EX_8)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_SET_8)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber,\r
   IN        UINT8     Value\r
@@ -196,14 +196,14 @@ EFI_STATUS
 \r
 /**\r
   Sets an 16-bit value for a given PCD token.\r
-  \r
+\r
   When the PCD service sets a value, it will check to ensure that the size of the value being set is\r
   compatible with the Token's existing definition. If it is not, an error will be 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]    TokenNumber The PCD token number.\r
   @param[in]    Value       The value to set for the PCD token.\r
-  \r
+\r
   @retval   EFI_SUCCESS             The PCD service has set the value requested\r
   @retval   EFI_INVALID_PARAMETER   The PCD service determined that the size of the data being set was\r
                                     incompatible with a call to this function. Use GetSizeEx() to\r
@@ -212,7 +212,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PCD_PROTOCOL_SET_EX_16)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_SET_16)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber,\r
   IN        UINT16    Value\r
@@ -220,14 +220,14 @@ EFI_STATUS
 \r
 /**\r
   Sets an 32-bit value for a given PCD token.\r
-  \r
+\r
   When the PCD service sets a value, it will check to ensure that the size of the value being set is\r
   compatible with the Token's existing definition. If it is not, an error will be 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]    TokenNumber The PCD token number.\r
   @param[in]    Value       The value to set for the PCD token.\r
-  \r
+\r
   @retval   EFI_SUCCESS             The PCD service has set the value requested\r
   @retval   EFI_INVALID_PARAMETER   The PCD service determined that the size of the data being set was\r
                                     incompatible with a call to this function. Use GetSizeEx() to\r
@@ -236,7 +236,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PCD_PROTOCOL_SET_EX_32)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_SET_32)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber,\r
   IN        UINT32    Value\r
@@ -244,14 +244,14 @@ EFI_STATUS
 \r
 /**\r
   Sets an 64-bit value for a given PCD token.\r
-  \r
+\r
   When the PCD service sets a value, it will check to ensure that the size of the value being set is\r
   compatible with the Token's existing definition. If it is not, an error will be 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]    TokenNumber The PCD token number.\r
   @param[in]    Value       The value to set for the PCD token.\r
-  \r
+\r
   @retval   EFI_SUCCESS             The PCD service has set the value requested\r
   @retval   EFI_INVALID_PARAMETER   The PCD service determined that the size of the data being set was\r
                                     incompatible with a call to this function. Use GetSizeEx() to\r
@@ -260,7 +260,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PCD_PROTOCOL_SET_EX_64)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_SET_64)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber,\r
   IN        UINT64    Value\r
@@ -268,15 +268,17 @@ EFI_STATUS
 \r
 /**\r
   Sets a value of a specified size for a given PCD token.\r
-  \r
+\r
   When the PCD service sets a value, it will check to ensure that the size of the value being set is\r
   compatible with the Token's existing definition. If it is not, an error will be 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]    TokenNumber The PCD token number.\r
-  @param[in]    SizeOfValue The length of the value being set for the PCD token.\r
+  @param[in]    SizeOfValue The length of the value being set for the PCD token. If too large of a length is\r
+                            specified, upon return from this function the value of SizeOfValue will\r
+                            reflect the maximum size for the PCD token.\r
   @param[in]    Buffer      A pointer to the buffer containing the value to set for the PCD token.\r
-  \r
+\r
   @retval   EFI_SUCCESS             The PCD service has set the value requested\r
   @retval   EFI_INVALID_PARAMETER   The PCD service determined that the size of the data being set was\r
                                     incompatible with a call to this function. Use GetSizeEx() to\r
@@ -285,23 +287,23 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PCD_PROTOCOL_SET_EX_POINTER)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_SET_POINTER)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber,\r
-  IN        UINTN     *SizeOfValue,\r
+  IN OUT    UINTN     *SizeOfValue,\r
   IN        VOID      *Buffer\r
 );\r
 \r
 /**\r
   Sets a Boolean value for a given PCD token.\r
-  \r
+\r
   When the PCD service sets a value, it will check to ensure that the size of the value being set is\r
   compatible with the Token's existing definition. If it is not, an error will be 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]    TokenNumber The PCD token number.\r
   @param[in]    Value       The value to set for the PCD token.\r
-  \r
+\r
   @retval   EFI_SUCCESS             The PCD service has set the value requested\r
   @retval   EFI_INVALID_PARAMETER   The PCD service determined that the size of the data being set was\r
                                     incompatible with a call to this function. Use GetSizeEx() to\r
@@ -310,7 +312,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PCD_PROTOCOL_SET_EX_BOOLEAN)(\r
+(EFIAPI *EFI_PCD_PROTOCOL_SET_BOOLEAN)(\r
   IN CONST  EFI_GUID  *Guid,\r
   IN        UINTN     TokenNumber,\r
   IN        BOOLEAN   Value\r
@@ -319,19 +321,19 @@ EFI_STATUS
 typedef\r
 VOID\r
 (EFIAPI *EFI_PCD_PROTOCOL_CALLBACK)(\r
-  IN EFI_GUID *Guid           OPTIONAL,\r
-  IN UINTN    CallBackToken,\r
-  IN VOID     *TokenData,\r
-  IN UINTN    TokenDataSize\r
+  IN     EFI_GUID *Guid           OPTIONAL,\r
+  IN     UINTN    CallBackToken,\r
+  IN OUT VOID     *TokenData,\r
+  IN     UINTN    TokenDataSize\r
 );\r
 \r
 /**\r
   Specifies a function to be called anytime the value of a designated token is changed.\r
-  \r
+\r
   @param[in]    Guid              The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    CallBackToken     The PCD token number to monitor.\r
   @param[in]    CallBackFunction  The function prototype called when the value associated with the CallBackToken is set.\r
-  \r
+\r
   @retval EFI_SUCCESS     The PCD service has successfully established a call event for the CallBackToken requested.\r
   @retval EFI_NOT_FOUND   The PCD service could not find the referenced token number.\r
 **/\r
@@ -345,11 +347,11 @@ EFI_STATUS
 \r
 /**\r
   Cancels a callback function that was set through a previous call to the CallBackOnSet function.\r
-  \r
+\r
   @param[in]    Guid              The 128-bit unique value that designates the namespace from which to extract the value.\r
   @param[in]    CallBackToken     The PCD token number to monitor.\r
   @param[in]    CallBackFunction  The function prototype called when the value associated with the CallBackToken is set.\r
-  \r
+\r
   @retval EFI_SUCCESS     The PCD service has successfully established a call event for the CallBackToken requested.\r
   @retval EFI_NOT_FOUND   The PCD service could not find the referenced token number.\r
 **/\r
@@ -365,12 +367,12 @@ EFI_STATUS
   Gets the next valid token number in a given namespace. This is useful since the PCD infrastructure\r
   contains a sparse list of token numbers, and one cannot a priori know what token numbers are valid\r
   in the database.\r
-  \r
+\r
   @param[in]    Guid              The 128-bit unique value that designates the namespace from which to retrieve the next token.\r
   @param[in]    TokenNumber       A pointer to the PCD token number to use to find the subsequent token number. To\r
                                   retrieve the "first" token, have the pointer reference a TokenNumber value of 0.\r
   @retval EFI_SUCCESS           The PCD service has retrieved the value requested\r
-  @retval EFI_NOT_FOUND         The PCD service could not find data from the requested token number.                    \r
+  @retval EFI_NOT_FOUND         The PCD service could not find data from the requested token number.\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -382,13 +384,13 @@ EFI_STATUS
 /**\r
   Gets the next valid token namespace for a given namespace. This is useful to traverse the valid\r
   token namespaces on a platform.\r
-  \r
+\r
   @param[in, out]   Guid    An indirect pointer to EFI_GUID. On input it designates a known token namespace\r
                             from which the search will start. On output, it designates the next valid token\r
                             namespace on the platform. If *Guid is NULL, then the GUID of the first token\r
                             space of the current platform is returned. If the search cannot locate the next valid\r
                             token namespace, an error is returned and the value of *Guid is undefined.\r
-                    \r
+\r
   @retval   EFI_SUCCESS   The PCD service retrieved the value requested.\r
   @retval   EFI_NOT_FOUND The PCD service could not find the next valid token namespace.\r
 **/\r
@@ -400,19 +402,19 @@ EFI_STATUS
 \r
 typedef struct _EFI_PCD_PROTOCOL {\r
   EFI_PCD_PROTOCOL_SET_SKU              SetSku;\r
-  EFI_PCD_PROTOCOL_GET_EX_8             Get8Ex;\r
-  EFI_PCD_PROTOCOL_GET_EX_16            Get16Ex;\r
-  EFI_PCD_PROTOCOL_GET_EX_32            Get32Ex;\r
-  EFI_PCD_PROTOCOL_GET_EX_64            Get64Ex;\r
-  EFI_PCD_PROTOCOL_GET_EX_POINTER       GetPtrEx;\r
-  EFI_PCD_PROTOCOL_GET_EX_BOOLEAN       GetBoolEx;\r
-  EFI_PCD_PROTOCOL_GET_EX_SIZE          GetSizeEx;\r
-  EFI_PCD_PROTOCOL_SET_EX_8             Set8Ex;\r
-  EFI_PCD_PROTOCOL_SET_EX_16            Set16Ex;\r
-  EFI_PCD_PROTOCOL_SET_EX_32            Set32Ex;\r
-  EFI_PCD_PROTOCOL_SET_EX_64            Set64Ex;\r
-  EFI_PCD_PROTOCOL_SET_EX_POINTER       SetPtrEx;\r
-  EFI_PCD_PROTOCOL_SET_EX_BOOLEAN       SetBoolEx;\r
+  EFI_PCD_PROTOCOL_GET_8                Get8;\r
+  EFI_PCD_PROTOCOL_GET_16               Get16;\r
+  EFI_PCD_PROTOCOL_GET_32               Get32;\r
+  EFI_PCD_PROTOCOL_GET_64               Get64;\r
+  EFI_PCD_PROTOCOL_GET_POINTER          GetPtr;\r
+  EFI_PCD_PROTOCOL_GET_BOOLEAN          GetBool;\r
+  EFI_PCD_PROTOCOL_GET_SIZE             GetSize;\r
+  EFI_PCD_PROTOCOL_SET_8                Set8;\r
+  EFI_PCD_PROTOCOL_SET_16               Set16;\r
+  EFI_PCD_PROTOCOL_SET_32               Set32;\r
+  EFI_PCD_PROTOCOL_SET_64               Set64;\r
+  EFI_PCD_PROTOCOL_SET_POINTER          SetPtr;\r
+  EFI_PCD_PROTOCOL_SET_BOOLEAN          SetBool;\r
   EFI_PCD_PROTOCOL_CALLBACK_ON_SET      CallbackOnSet;\r
   EFI_PCD_PROTOCOL_CANCEL_CALLBACK      CancelCallback;\r
   EFI_PCD_PROTOCOL_GET_NEXT_TOKEN       GetNextToken;\r