2 Platform Configuration Database (PCD) Protocol defined in PI 1.2 Vol3
4 A platform database that contains a variety of current platform settings or
5 directives that can be accessed by a driver or application.
6 PI PCD protocol only provide the accessing interfaces for Dynamic-Ex type PCD.
8 Callers to this protocol must be at a TPL_APPLICATION task priority level.
9 This is the base PCD service API that provides an abstraction for accessing configuration content in
10 the platform. It a seamless mechanism for extracting information regardless of where the
11 information is stored (such as in Read-only data, or an EFI Variable).
12 This protocol allows access to data through size-granular APIs and provides a mechanism for a
13 firmware component to monitor specific settings and be alerted when a setting is changed.
15 Copyright (c) 2009, Intel Corporation
16 All rights reserved. This program and the accompanying materials
17 are licensed and made available under the terms and conditions of the BSD License
18 which accompanies this distribution. The full text of the license may be found at
19 http://opensource.org/licenses/bsd-license.php
21 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
22 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24 @par Revision Reference:
28 #ifndef __PI_PCD_PPI_H__
29 #define __PI_PCD_PPI_H__
31 extern EFI_GUID gEfiPeiPcdPpiGuid
;
33 #define EFI_PEI_PCD_PPI_GUID \
34 { 0x1f34d25, 0x4de2, 0x23ad, { 0x3f, 0xf3, 0x36, 0x35, 0x3f, 0xf3, 0x23, 0xf1 } }
36 #define EFI_PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
39 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. SetSku() is
40 normally called only once by the system.
41 For each item (token), the database can hold a single value that applies to all SKUs, or multiple
42 values, where each value is associated with a specific SKU Id. Items with multiple, SKU-specific
43 values are called SKU enabled.
44 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. For tokens that are
45 not SKU enabled, the system ignores any set SKU Id and works with the single value for that token.
46 For SKU-enabled tokens, the system will use the SKU Id set by the last call to SetSku(). If no
47 SKU Id is set or the currently set SKU Id isn't valid for the specified token, the system uses the
48 default SKU Id. If the system attempts to use the default SKU Id and no value has been set for that
49 Id, the results are unpredictable.
51 @param[in] SkuId The SKU value to set.
55 (EFIAPI
*EFI_PEI_PCD_PPI_SET_SKU
)(
60 Retrieves the current byte-sized value for a PCD token number. If the TokenNumber is invalid,
61 the results are unpredictable.
63 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
64 @param[in] TokenNumber The PCD token number.
66 @return 8-bit value for a given PCD token.
70 (EFIAPI
*EFI_PEI_PCD_PPI_GET_EX_8
)(
71 IN CONST EFI_GUID
*Guid
,
76 Retrieves the current byte-sized value for a PCD token number. If the TokenNumber is invalid,
77 the results are unpredictable.
79 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
80 @param[in] TokenNumber The PCD token number.
82 @return 16-bit value for a given PCD token.
86 (EFIAPI
*EFI_PEI_PCD_PPI_GET_EX_16
)(
87 IN CONST EFI_GUID
*Guid
,
92 Retrieves the current 32-bit value for a PCD token number. If the TokenNumber is invalid, the
93 results are unpredictable.
95 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
96 @param[in] TokenNumber The PCD token number.
98 @return 32-bit value for a given PCD token.
102 (EFIAPI
*EFI_PEI_PCD_PPI_GET_EX_32
)(
103 IN CONST EFI_GUID
*Guid
,
108 Retrieves the current pointer to the value for a PCD token number. There should not be any
109 alignment assumptions about the pointer that is returned by this function call. If the TokenNumber
110 is invalid, the results are unpredictable.
112 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
113 @param[in] TokenNumber The PCD token number.
117 (EFIAPI
*EFI_PEI_PCD_PPI_GET_EX_POINTER
)(
118 IN CONST EFI_GUID
*Guid
,
123 Retrieves the current Boolean-sized value for a PCD token number. If the TokenNumber is
124 invalid, the results are unpredictable.
126 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
127 @param[in] TokenNumber The PCD token number.
129 @return Boolean value for a given PCD token.
133 (EFIAPI
*EFI_PEI_PCD_PPI_GET_EX_BOOLEAN
)(
134 IN CONST EFI_GUID
*Guid
,
139 Retrieves the current size of a particular PCD token. If the TokenNumber is invalid, the results are
142 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
143 @param[in] TokenNumber The PCD token number.
145 @return the size of the value for a given PCD token.
149 (EFIAPI
*EFI_PEI_PCD_PPI_GET_EX_SIZE
)(
150 IN CONST EFI_GUID
*Guid
,
155 Sets an 8-bit value for a given PCD token.
157 When the PCD service sets a value, it will check to ensure that the size of the value being set is
158 compatible with the Token's existing definition. If it is not, an error will be returned.
160 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
161 @param[in] TokenNumber The PCD token number.
162 @param[in] Value The value to set for the PCD token.
164 @retval EFI_SUCCESS The PCD service has set the value requested
165 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
166 incompatible with a call to this function. Use GetSizeEx() to
167 retrieve the size of the target data.
168 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
172 (EFIAPI
*EFI_PEI_PCD_PPI_SET_EX_8
)(
173 IN CONST EFI_GUID
*Guid
,
174 IN UINTN TokenNumber
,
179 Sets an 16-bit value for a given PCD token.
181 When the PCD service sets a value, it will check to ensure that the size of the value being set is
182 compatible with the Token's existing definition. If it is not, an error will be returned.
184 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
185 @param[in] TokenNumber The PCD token number.
186 @param[in] Value The value to set for the PCD token.
188 @retval EFI_SUCCESS The PCD service has set the value requested
189 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
190 incompatible with a call to this function. Use GetSizeEx() to
191 retrieve the size of the target data.
192 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
196 (EFIAPI
*EFI_PEI_PCD_PPI_SET_EX_16
)(
197 IN CONST EFI_GUID
*Guid
,
198 IN UINTN TokenNumber
,
203 Sets an 32-bit value for a given PCD token.
205 When the PCD service sets a value, it will check to ensure that the size of the value being set is
206 compatible with the Token's existing definition. If it is not, an error will be returned.
208 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
209 @param[in] TokenNumber The PCD token number.
210 @param[in] Value The value to set for the PCD token.
212 @retval EFI_SUCCESS The PCD service has set the value requested
213 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
214 incompatible with a call to this function. Use GetSizeEx() to
215 retrieve the size of the target data.
216 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
220 (EFIAPI
*EFI_PEI_PCD_PPI_SET_EX_32
)(
221 IN CONST EFI_GUID
*Guid
,
222 IN UINTN TokenNumber
,
227 Sets an 64-bit value for a given PCD token.
229 When the PCD service sets a value, it will check to ensure that the size of the value being set is
230 compatible with the Token's existing definition. If it is not, an error will be returned.
232 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
233 @param[in] TokenNumber The PCD token number.
234 @param[in] Value The value to set for the PCD token.
236 @retval EFI_SUCCESS The PCD service has set the value requested
237 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
238 incompatible with a call to this function. Use GetSizeEx() to
239 retrieve the size of the target data.
240 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
244 (EFIAPI
*EFI_PEI_PCD_PPI_SET_EX_64
)(
245 IN CONST EFI_GUID
*Guid
,
246 IN UINTN TokenNumber
,
251 Sets a value of the specified size for a given PCD token.
253 When the PCD service sets a value, it will check to ensure that the size of the value being set is
254 compatible with the Token's existing definition. If it is not, an error will be returned.
256 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
257 @param[in] TokenNumber The PCD token number.
258 @param[in] SizeOfValue The length of the Value being set for the PCD token.
259 @param[in] Buffer A pointer to the buffer containing the value to set for the PCD token.
261 @retval EFI_SUCCESS The PCD service has set the value requested
262 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
263 incompatible with a call to this function. Use GetSizeEx() to
264 retrieve the size of the target data.
265 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
269 (EFIAPI
*EFI_PEI_PCD_PPI_SET_EX_POINTER
)(
270 IN CONST EFI_GUID
*Guid
,
271 IN UINTN TokenNumber
,
272 IN UINTN SizeOfValue
,
277 Sets a Boolean value for a given PCD token.
279 When the PCD service sets a value, it will check to ensure that the size of the value being set is
280 compatible with the Token's existing definition. If it is not, an error will be returned.
282 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
283 @param[in] TokenNumber The PCD token number.
284 @param[in] Value The value to set for the PCD token.
286 @retval EFI_SUCCESS The PCD service has set the value requested
287 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
288 incompatible with a call to this function. Use GetSizeEx() to
289 retrieve the size of the target data.
290 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
294 (EFIAPI
*EFI_PEI_PCD_PPI_SET_EX_BOOLEAN
)(
295 IN CONST EFI_GUID
*Guid
,
296 IN UINTN TokenNumber
,
302 (EFIAPI
*PCD_PPI_CALLBACK
)(
303 IN EFI_GUID
*Guid OPTIONAL
,
304 IN UINTN CallBackToken
,
306 IN UINTN TokenDatSize
310 Specifies a function to be called anytime the value of a designated token is changed.
312 @param[in] Guid The 128-bit unique value that designates which namespace to monitor. If NULL, use
313 the standard platform namespace.
314 @param[in] CallBackToken The PCD token number to monitor.
315 @param[in] CallBackFunction The function prototype that will be called when the value associated with the
316 CallBackToken is set.
318 @retval EFI_SUCCESS The PCD service has successfully established a call event for the
319 CallBackToken requested.
320 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
324 (EFIAPI
*EFI_PEI_PCD_PPI_CALL_BACK_ON_SET
)(
325 IN CONST EFI_GUID
*Guid OPTIONAL
,
326 IN UINTN CallBackToken
,
327 IN PCD_PPI_CALLBACK CallBackFunction
331 Cancels a previously set callback function for a particular PCD token number.
333 @param[in] Guid The 128-bit unique value that designates which namespace to monitor. If NULL, use
334 the standard platform namespace.
335 @param[in] CallBackToken The PCD token number to cancel monitoring.
336 @param[in] CallBackFunction The function prototype that was originally passed to the CallBackOnSet function.
338 @retval EFI_SUCCESS The PCD service has cancelled the call event associated with the
340 @retval EFI_INVALID_PARAMETER The PCD service did not match the CallBackFunction to one
341 that is currently being monitored.
342 @retval EFI_NOT_FOUND The PCD service could not find data the requested token number.
346 (EFIAPI
*EFI_PEI_PCD_PPI_CANCEL_CALL_BACK
)(
347 IN CONST EFI_GUID
*Guid OPTIONAL
,
348 IN UINTN CallBackToken
,
349 IN PCD_PPI_CALLBACK CallBackFunction
353 Retrieves the next valid PCD token for a given namespace.
355 This provides a means by which to get the next valid token number in a given namespace. This is
356 useful since the PCD infrastructure has a sparse list of token numbers in it, and one cannot a priori
357 know what token numbers are valid in the database.
359 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
360 @param[in] TokenNumber The PCD token number.
362 @retval EFI_SUCCESS The PCD service has retrieved the value requested.
363 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
367 (EFIAPI
*EFI_PEI_PCD_PPI_GET_NEXT_TOKEN
)(
368 IN CONST EFI_GUID
*Guid OPTIONAL
,
369 IN UINTN
*TokenNumber
373 Retrieves the next valid PCD token namespace for a given namespace.
375 Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
376 token namespaces on a platform.
378 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token
379 namespace from which the search will start. On output, it designates the next valid
380 token namespace on the platform. If *Guid is NULL, then the GUID of the first token
381 space of the current platform is returned. If the search cannot locate the next valid
382 token namespace, an error is returned and the value of *Guid is undefined.
384 @retval EFI_SUCCESS The PCD service retrieved the value requested.
385 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
389 (EFIAPI
*EFI_PEI_PCD_PPI_GET_NEXT_TOKEN_SPACE
)(
390 IN OUT CONST EFI_GUID
**Guid
394 EFI_PEI_PCD_PPI_SET_SKU SetSku
;
395 EFI_PEI_PCD_PPI_GET_EX_8 GetEx8
;
396 EFI_PEI_PCD_PPI_GET_EX_16 GetEx16
;
397 EFI_PEI_PCD_PPI_GET_EX_32 GetEx32
;
398 EFI_PEI_PCD_PPI_GET_EX_64 GetEx64
;
399 EFI_PEI_PCD_PPI_GET_EX_POINTER GetExPtr
;
400 EFI_PEI_PCD_PPI_GET_EX_BOOLEAN GetExBool
;
401 EFI_PEI_PCD_PPI_GET_EX_SIZE GetExSize
;
402 EFI_PEI_PCD_PPI_SET_EX_8 SetEx8
;
403 EFI_PEI_PCD_PPI_SET_EX_16 SetEx16
;
404 EFI_PEI_PCD_PPI_SET_EX_32 SetEx32
;
405 EFI_PEI_PCD_PPI_SET_EX_64 SetEx64
;
406 EFI_PEI_PCD_PPI_SET_EX_POINTER SetExPtr
;
407 EFI_PEI_PCD_PPI_SET_EX_BOOLEAN SetExBool
;
408 EFI_PEI_PCD_PPI_CALLBACK_ON_SET CallbackOnSet
;
409 EFI_PEI_PCD_PPI_CANCEL_CALLBACK CancelCallback
;
410 EFI_PEI_PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
411 EFI_PEI_PCD_PPI_GET_NEXT_TOKEN_SPACE GetNextTokenSpace
;