MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PiPcd.h File Reference

Data Structures

struct  _EFI_PCD_PROTOCOL
 

Macros

#define EFI_PCD_PROTOCOL_GUID   { 0x13a3f0f6, 0x264a, 0x3ef0, { 0xf2, 0xe0, 0xde, 0xc5, 0x12, 0x34, 0x2f, 0x34 } }
 
#define EFI_PCD_INVALID_TOKEN_NUMBER   ((UINTN) 0)
 

Typedefs

typedef VOID(EFIAPIEFI_PCD_PROTOCOL_SET_SKU )(IN UINTN SkuId)
 
typedef UINT8(EFIAPIEFI_PCD_PROTOCOL_GET_8 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef UINT16(EFIAPIEFI_PCD_PROTOCOL_GET_16 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef UINT32(EFIAPIEFI_PCD_PROTOCOL_GET_32 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef UINT64(EFIAPIEFI_PCD_PROTOCOL_GET_64 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef VOID *(EFIAPIEFI_PCD_PROTOCOL_GET_POINTER )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef BOOLEAN(EFIAPIEFI_PCD_PROTOCOL_GET_BOOLEAN )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef UINTN(EFIAPIEFI_PCD_PROTOCOL_GET_SIZE )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_SET_8 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT8 Value)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_SET_16 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT16 Value)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_SET_32 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT32 Value)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_SET_64 )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT64 Value)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_SET_POINTER )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN OUT UINTN *SizeOfValue, IN VOID *Buffer)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_SET_BOOLEAN )(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN BOOLEAN Value)
 
typedef VOID(EFIAPIEFI_PCD_PROTOCOL_CALLBACK )(IN EFI_GUID *Guid, IN UINTN CallBackToken, IN OUT VOID *TokenData, IN UINTN TokenDataSize)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_CALLBACK_ON_SET )(IN CONST EFI_GUID *Guid, IN UINTN CallBackToken, IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_CANCEL_CALLBACK )(IN CONST EFI_GUID *Guid, IN UINTN CallBackToken, IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_GET_NEXT_TOKEN )(IN CONST EFI_GUID *Guid, IN UINTN *TokenNumber)
 
typedef EFI_STATUS(EFIAPIEFI_PCD_PROTOCOL_GET_NEXT_TOKEN_SPACE )(IN OUT CONST EFI_GUID **Guid)
 
typedef struct _EFI_PCD_PROTOCOL EFI_PCD_PROTOCOL
 

Variables

EFI_GUID gEfiPcdProtocolGuid
 

Detailed Description

Platform Configuration Database (PCD) Protocol defined in PI 1.2 Vol3

A platform database that contains a variety of current platform settings or directives that can be accessed by a driver or application. PI PCD protocol only provide the accessing interfaces for Dynamic-Ex type PCD.

Callers to this protocol must be at a TPL_APPLICATION task priority level. This is the base PCD service API that provides an abstraction for accessing configuration content in the platform. It a seamless mechanism for extracting information regardless of where the information is stored (such as in Read-only data, or an EFI Variable). This protocol allows access to data through size-granular APIs and provides a mechanism for a firmware component to monitor specific settings and be alerted when a setting is changed.

Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
PI Version 1.2 Vol 3.

Macro Definition Documentation

#define EFI_PCD_INVALID_TOKEN_NUMBER   ((UINTN) 0)
#define EFI_PCD_PROTOCOL_GUID   { 0x13a3f0f6, 0x264a, 0x3ef0, { 0xf2, 0xe0, 0xde, 0xc5, 0x12, 0x34, 0x2f, 0x34 } }

Typedef Documentation

typedef VOID(EFIAPI * EFI_PCD_PROTOCOL_CALLBACK)(IN EFI_GUID *Guid, IN UINTN CallBackToken, IN OUT VOID *TokenData, IN UINTN TokenDataSize)
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_CALLBACK_ON_SET)(IN CONST EFI_GUID *Guid, IN UINTN CallBackToken, IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction)

Specifies a function to be called anytime the value of a designated token is changed.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]CallBackTokenThe PCD token number to monitor.
[in]CallBackFunctionThe function prototype called when the value associated with the CallBackToken is set.
Return values
EFI_SUCCESSThe PCD service has successfully established a call event for the CallBackToken requested.
EFI_NOT_FOUNDThe PCD service could not find the referenced token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_CANCEL_CALLBACK)(IN CONST EFI_GUID *Guid, IN UINTN CallBackToken, IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction)

Cancels a callback function that was set through a previous call to the CallBackOnSet function.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]CallBackTokenThe PCD token number to monitor.
[in]CallBackFunctionThe function prototype called when the value associated with the CallBackToken is set.
Return values
EFI_SUCCESSThe PCD service has successfully established a call event for the CallBackToken requested.
EFI_NOT_FOUNDThe PCD service could not find the referenced token number.
typedef UINT16(EFIAPI * EFI_PCD_PROTOCOL_GET_16)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves the current word-sized value for a PCD token number. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
word-sized value for a given PCD token.
typedef UINT32(EFIAPI * EFI_PCD_PROTOCOL_GET_32)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves the current 32-bit sized value for a PCD token number. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
32-bit value for a given PCD token.
typedef UINT64(EFIAPI * EFI_PCD_PROTOCOL_GET_64)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves the 64-bit sized value for a PCD token number. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
64-bit value for a given PCD token.
typedef UINT8(EFIAPI * EFI_PCD_PROTOCOL_GET_8)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves an 8-bit value for a given PCD token. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
8-bit value for a given PCD token.
typedef BOOLEAN(EFIAPI * EFI_PCD_PROTOCOL_GET_BOOLEAN)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves the current BOOLEAN-sized value for a PCD token number. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
Boolean value for a given PCD token.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_GET_NEXT_TOKEN)(IN CONST EFI_GUID *Guid, IN UINTN *TokenNumber)

Gets the next valid token number in a given namespace. This is useful since the PCD infrastructure contains a sparse list of token numbers, and one cannot a priori know what token numbers are valid in the database.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to retrieve the next token.
[in]TokenNumberA pointer to the PCD token number to use to find the subsequent token number. To retrieve the "first" token, have the pointer reference a TokenNumber value of 0.
Return values
EFI_SUCCESSThe PCD service has retrieved the value requested
EFI_NOT_FOUNDThe PCD service could not find data from the requested token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_GET_NEXT_TOKEN_SPACE)(IN OUT CONST EFI_GUID **Guid)

Gets the next valid token namespace for a given namespace. This is useful to traverse the valid token namespaces on a platform.

Parameters
[in,out]GuidAn indirect pointer to EFI_GUID. On input it designates a known token namespace from which the search will start. On output, it designates the next valid token namespace on the platform. If *Guid is NULL, then the GUID of the first token space of the current platform is returned. If the search cannot locate the next valid token namespace, an error is returned and the value of *Guid is undefined.
Return values
EFI_SUCCESSThe PCD service retrieved the value requested.
EFI_NOT_FOUNDThe PCD service could not find the next valid token namespace.
typedef VOID*(EFIAPI * EFI_PCD_PROTOCOL_GET_POINTER)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves the current pointer to the value for a PCD token number. Do not make any assumptions about the alignment of the pointer that is returned by this function call. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
pointer to a value for a given PCD token.
typedef UINTN(EFIAPI * EFI_PCD_PROTOCOL_GET_SIZE)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)

Retrieves the current size of a particular PCD token. If the TokenNumber is invalid, the results are unpredictable.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
Returns
the size of the value for a given PCD token.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_SET_16)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT16 Value)

Sets an 16-bit value for a given PCD token.

When the PCD service sets a value, it will check to ensure that the size of the value being set is compatible with the Token's existing definition. If it is not, an error will be returned.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
[in]ValueThe value to set for the PCD token.
Return values
EFI_SUCCESSThe PCD service has set the value requested
EFI_INVALID_PARAMETERThe PCD service determined that the size of the data being set was incompatible with a call to this function. Use GetSizeEx() to retrieve the size of the target data.
EFI_NOT_FOUNDThe PCD service could not find the requested token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_SET_32)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT32 Value)

Sets an 32-bit value for a given PCD token.

When the PCD service sets a value, it will check to ensure that the size of the value being set is compatible with the Token's existing definition. If it is not, an error will be returned.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
[in]ValueThe value to set for the PCD token.
Return values
EFI_SUCCESSThe PCD service has set the value requested
EFI_INVALID_PARAMETERThe PCD service determined that the size of the data being set was incompatible with a call to this function. Use GetSizeEx() to retrieve the size of the target data.
EFI_NOT_FOUNDThe PCD service could not find the requested token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_SET_64)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT64 Value)

Sets an 64-bit value for a given PCD token.

When the PCD service sets a value, it will check to ensure that the size of the value being set is compatible with the Token's existing definition. If it is not, an error will be returned.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
[in]ValueThe value to set for the PCD token.
Return values
EFI_SUCCESSThe PCD service has set the value requested
EFI_INVALID_PARAMETERThe PCD service determined that the size of the data being set was incompatible with a call to this function. Use GetSizeEx() to retrieve the size of the target data.
EFI_NOT_FOUNDThe PCD service could not find the requested token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_SET_8)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT8 Value)

Sets an 8-bit value for a given PCD token.

When the PCD service sets a value, it will check to ensure that the size of the value being set is compatible with the Token's existing definition. If it is not, an error will be returned.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
[in]ValueThe value to set for the PCD token.
Return values
EFI_SUCCESSThe PCD service has set the value requested
EFI_INVALID_PARAMETERThe PCD service determined that the size of the data being set was incompatible with a call to this function. Use GetSizeEx() to retrieve the size of the target data.
EFI_NOT_FOUNDThe PCD service could not find the requested token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_SET_BOOLEAN)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN BOOLEAN Value)

Sets a Boolean value for a given PCD token.

When the PCD service sets a value, it will check to ensure that the size of the value being set is compatible with the Token's existing definition. If it is not, an error will be returned.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
[in]ValueThe value to set for the PCD token.
Return values
EFI_SUCCESSThe PCD service has set the value requested
EFI_INVALID_PARAMETERThe PCD service determined that the size of the data being set was incompatible with a call to this function. Use GetSizeEx() to retrieve the size of the target data.
EFI_NOT_FOUNDThe PCD service could not find the requested token number.
typedef EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_SET_POINTER)(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN OUT UINTN *SizeOfValue, IN VOID *Buffer)

Sets a value of a specified size for a given PCD token.

When the PCD service sets a value, it will check to ensure that the size of the value being set is compatible with the Token's existing definition. If it is not, an error will be returned.

Parameters
[in]GuidThe 128-bit unique value that designates the namespace from which to extract the value.
[in]TokenNumberThe PCD token number.
[in]SizeOfValueThe length of the value being set for the PCD token. If too large of a length is specified, upon return from this function the value of SizeOfValue will reflect the maximum size for the PCD token.
[in]BufferA pointer to the buffer containing the value to set for the PCD token.
Return values
EFI_SUCCESSThe PCD service has set the value requested
EFI_INVALID_PARAMETERThe PCD service determined that the size of the data being set was incompatible with a call to this function. Use GetSizeEx() to retrieve the size of the target data.
EFI_NOT_FOUNDThe PCD service could not find the requested token number.
typedef VOID(EFIAPI * EFI_PCD_PROTOCOL_SET_SKU)(IN UINTN SkuId)

SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. SetSku() is normally called only once by the system. For each item (token), the database can hold a single value that applies to all SKUs, or multiple values, where each value is associated with a specific SKU Id. Items with multiple, SKU-specific values are called SKU enabled. The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been set for that Id, the results are unpredictable.

Parameters
[in]SkuIdThe SKU value to set.

Variable Documentation

EFI_GUID gEfiPcdProtocolGuid