2 Platform Configuration Database (PCD) PPI 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 ppi only provide the accessing interfaces for Dynamic-Ex type PCD.
8 This is the base PCD service API that provides an abstraction for accessing configuration content in
9 the platform. It a seamless mechanism for extracting information regardless of where the
10 information is stored (such as in Read-only data, or an EFI Variable).
11 This protocol allows access to data through size-granular APIs and provides a mechanism for a
12 firmware component to monitor specific settings and be alerted when a setting is changed.
14 Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
15 SPDX-License-Identifier: BSD-2-Clause-Patent
17 @par Revision Reference:
21 #ifndef __PI_PCD_PPI_H__
22 #define __PI_PCD_PPI_H__
24 extern EFI_GUID gEfiPeiPcdPpiGuid
;
26 #define EFI_PEI_PCD_PPI_GUID \
27 { 0x1f34d25, 0x4de2, 0x23ad, { 0x3f, 0xf3, 0x36, 0x35, 0x3f, 0xf3, 0x23, 0xf1 } }
29 #define EFI_PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
32 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. SetSku() is
33 normally called only once by the system.
34 For each item (token), the database can hold a single value that applies to all SKUs, or multiple
35 values, where each value is associated with a specific SKU Id. Items with multiple, SKU-specific
36 values are called SKU enabled.
37 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. For tokens that are
38 not SKU enabled, the system ignores any set SKU Id and works with the single value for that token.
39 For SKU-enabled tokens, the system will use the SKU Id set by the last call to SetSku(). If no
40 SKU Id is set or the currently set SKU Id isn't valid for the specified token, the system uses the
41 default SKU Id. If the system attempts to use the default SKU Id and no value has been set for that
42 Id, the results are unpredictable.
44 @param[in] SkuId The SKU value to set.
48 (EFIAPI
*EFI_PEI_PCD_PPI_SET_SKU
)(
53 Retrieves the current byte-sized value for a PCD token number. If the TokenNumber is invalid,
54 the results are unpredictable.
56 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
57 @param[in] TokenNumber The PCD token number.
59 @return 8-bit value for a given PCD token.
63 (EFIAPI
*EFI_PEI_PCD_PPI_GET_8
)(
64 IN CONST EFI_GUID
*Guid
,
69 Retrieves the current word-sized value for a PCD token number. If the TokenNumber is invalid,
70 the results are unpredictable.
72 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
73 @param[in] TokenNumber The PCD token number.
75 @return 16-bit value for a given PCD token.
79 (EFIAPI
*EFI_PEI_PCD_PPI_GET_16
)(
80 IN CONST EFI_GUID
*Guid
,
85 Retrieves the current 32-bit value for a PCD token number. If the TokenNumber is invalid, the
86 results are unpredictable.
88 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
89 @param[in] TokenNumber The PCD token number.
91 @return 32-bit value for a given PCD token.
95 (EFIAPI
*EFI_PEI_PCD_PPI_GET_32
)(
96 IN CONST EFI_GUID
*Guid
,
101 Retrieves the current 64-bit value for a PCD token number. If the TokenNumber is invalid, the
102 results are unpredictable.
104 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
105 @param[in] TokenNumber The PCD token number.
107 @return 64-bit value for a given PCD token.
111 (EFIAPI
*EFI_PEI_PCD_PPI_GET_64
)(
112 IN CONST EFI_GUID
*Guid
,
117 Retrieves the current pointer to the value for a PCD token number. There should not be any
118 alignment assumptions about the pointer that is returned by this function call. If the TokenNumber
119 is invalid, the results are unpredictable.
121 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
122 @param[in] TokenNumber The PCD token number.
126 (EFIAPI
*EFI_PEI_PCD_PPI_GET_POINTER
)(
127 IN CONST EFI_GUID
*Guid
,
132 Retrieves the current Boolean-sized value for a PCD token number. If the TokenNumber is
133 invalid, the results are unpredictable.
135 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
136 @param[in] TokenNumber The PCD token number.
138 @return Boolean value for a given PCD token.
142 (EFIAPI
*EFI_PEI_PCD_PPI_GET_BOOLEAN
)(
143 IN CONST EFI_GUID
*Guid
,
148 Retrieves the current size of a particular PCD token. If the TokenNumber is invalid, the results are
151 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
152 @param[in] TokenNumber The PCD token number.
154 @return the size of the value for a given PCD token.
158 (EFIAPI
*EFI_PEI_PCD_PPI_GET_SIZE
)(
159 IN CONST EFI_GUID
*Guid
,
164 Sets an 8-bit value for a given PCD token.
166 When the PCD service sets a value, it will check to ensure that the size of the value being set is
167 compatible with the Token's existing definition. If it is not, an error will be returned.
169 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
170 @param[in] TokenNumber The PCD token number.
171 @param[in] Value The value to set for the PCD token.
173 @retval EFI_SUCCESS The PCD service has set the value requested
174 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
175 incompatible with a call to this function. Use GetSizeEx() to
176 retrieve the size of the target data.
177 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
181 (EFIAPI
*EFI_PEI_PCD_PPI_SET_8
)(
182 IN CONST EFI_GUID
*Guid
,
183 IN UINTN TokenNumber
,
188 Sets an 16-bit value for a given PCD token.
190 When the PCD service sets a value, it will check to ensure that the size of the value being set is
191 compatible with the Token's existing definition. If it is not, an error will be returned.
193 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
194 @param[in] TokenNumber The PCD token number.
195 @param[in] Value The value to set for the PCD token.
197 @retval EFI_SUCCESS The PCD service has set the value requested
198 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
199 incompatible with a call to this function. Use GetSizeEx() to
200 retrieve the size of the target data.
201 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
205 (EFIAPI
*EFI_PEI_PCD_PPI_SET_16
)(
206 IN CONST EFI_GUID
*Guid
,
207 IN UINTN TokenNumber
,
212 Sets an 32-bit value for a given PCD token.
214 When the PCD service sets a value, it will check to ensure that the size of the value being set is
215 compatible with the Token's existing definition. If it is not, an error will be returned.
217 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
218 @param[in] TokenNumber The PCD token number.
219 @param[in] Value The value to set for the PCD token.
221 @retval EFI_SUCCESS The PCD service has set the value requested
222 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
223 incompatible with a call to this function. Use GetSizeEx() to
224 retrieve the size of the target data.
225 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
229 (EFIAPI
*EFI_PEI_PCD_PPI_SET_32
)(
230 IN CONST EFI_GUID
*Guid
,
231 IN UINTN TokenNumber
,
236 Sets an 64-bit value for a given PCD token.
238 When the PCD service sets a value, it will check to ensure that the size of the value being set is
239 compatible with the Token's existing definition. If it is not, an error will be returned.
241 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
242 @param[in] TokenNumber The PCD token number.
243 @param[in] Value The value to set for the PCD token.
245 @retval EFI_SUCCESS The PCD service has set the value requested
246 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
247 incompatible with a call to this function. Use GetSizeEx() to
248 retrieve the size of the target data.
249 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
253 (EFIAPI
*EFI_PEI_PCD_PPI_SET_64
)(
254 IN CONST EFI_GUID
*Guid
,
255 IN UINTN TokenNumber
,
260 Sets a value of the specified size for a given PCD token.
262 When the PCD service sets a value, it will check to ensure that the size of the value being set is
263 compatible with the Token's existing definition. If it is not, an error will be returned.
265 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
266 @param[in] TokenNumber The PCD token number.
267 @param[in] SizeOfValue The length of the value being set for the PCD token. If too large of a length is
268 specified, upon return from this function the value of SizeOfValue will reflect the
269 maximum size for the PCD token.
270 @param[in] Buffer A pointer to the buffer containing the value to set for the PCD token.
272 @retval EFI_SUCCESS The PCD service has set the value requested
273 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
274 incompatible with a call to this function. Use GetSizeEx() to
275 retrieve the size of the target data.
276 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
280 (EFIAPI
*EFI_PEI_PCD_PPI_SET_POINTER
)(
281 IN CONST EFI_GUID
*Guid
,
282 IN UINTN TokenNumber
,
283 IN OUT UINTN
*SizeOfValue
,
288 Sets a Boolean value for a given PCD token.
290 When the PCD service sets a value, it will check to ensure that the size of the value being set is
291 compatible with the Token's existing definition. If it is not, an error will be returned.
293 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
294 @param[in] TokenNumber The PCD token number.
295 @param[in] Value The value to set for the PCD token.
297 @retval EFI_SUCCESS The PCD service has set the value requested
298 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
299 incompatible with a call to this function. Use GetSizeEx() to
300 retrieve the size of the target data.
301 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
305 (EFIAPI
*EFI_PEI_PCD_PPI_SET_BOOLEAN
)(
306 IN CONST EFI_GUID
*Guid
,
307 IN UINTN TokenNumber
,
313 (EFIAPI
*EFI_PEI_PCD_PPI_CALLBACK
)(
314 IN EFI_GUID
*Guid OPTIONAL
,
315 IN UINTN CallBackToken
,
316 IN OUT VOID
*TokenData
,
317 IN UINTN TokenDatSize
321 Specifies a function to be called anytime the value of a designated token is changed.
323 @param[in] Guid The 128-bit unique value that designates which namespace to monitor. If NULL, use
324 the standard platform namespace.
325 @param[in] CallBackToken The PCD token number to monitor.
326 @param[in] CallBackFunction The function prototype that will be called when the value associated with the
327 CallBackToken is set.
329 @retval EFI_SUCCESS The PCD service has successfully established a call event for the
330 CallBackToken requested.
331 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
335 (EFIAPI
*EFI_PEI_PCD_PPI_CALLBACK_ON_SET
)(
336 IN CONST EFI_GUID
*Guid OPTIONAL
,
337 IN UINTN CallBackToken
,
338 IN EFI_PEI_PCD_PPI_CALLBACK CallBackFunction
342 Cancels a previously set callback function for a particular PCD token number.
344 @param[in] Guid The 128-bit unique value that designates which namespace to monitor. If NULL, use
345 the standard platform namespace.
346 @param[in] CallBackToken The PCD token number to cancel monitoring.
347 @param[in] CallBackFunction The function prototype that was originally passed to the CallBackOnSet function.
349 @retval EFI_SUCCESS The PCD service has cancelled the call event associated with the
351 @retval EFI_INVALID_PARAMETER The PCD service did not match the CallBackFunction to one
352 that is currently being monitored.
353 @retval EFI_NOT_FOUND The PCD service could not find data the requested token number.
357 (EFIAPI
*EFI_PEI_PCD_PPI_CANCEL_CALLBACK
)(
358 IN CONST EFI_GUID
*Guid OPTIONAL
,
359 IN UINTN CallBackToken
,
360 IN EFI_PEI_PCD_PPI_CALLBACK CallBackFunction
364 Retrieves the next valid PCD token for a given namespace.
366 This provides a means by which to get the next valid token number in a given namespace. This is
367 useful since the PCD infrastructure has a sparse list of token numbers in it, and one cannot a priori
368 know what token numbers are valid in the database.
370 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
371 @param[in] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. To
372 retrieve the "first" token, have the pointer reference a TokenNumber value of 0.
374 @retval EFI_SUCCESS The PCD service has retrieved the value requested.
375 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
379 (EFIAPI
*EFI_PEI_PCD_PPI_GET_NEXT_TOKEN
)(
380 IN CONST EFI_GUID
*Guid OPTIONAL
,
381 IN UINTN
*TokenNumber
385 Retrieves the next valid PCD token namespace for a given namespace.
387 Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
388 token namespaces on a platform.
390 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token
391 namespace from which the search will start. On output, it designates the next valid
392 token namespace on the platform. If *Guid is NULL, then the GUID of the first token
393 space of the current platform is returned. If the search cannot locate the next valid
394 token namespace, an error is returned and the value of *Guid is undefined.
396 @retval EFI_SUCCESS The PCD service retrieved the value requested.
397 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
401 (EFIAPI
*EFI_PEI_PCD_PPI_GET_NEXT_TOKEN_SPACE
)(
402 IN OUT CONST EFI_GUID
**Guid
406 EFI_PEI_PCD_PPI_SET_SKU SetSku
;
407 EFI_PEI_PCD_PPI_GET_8 Get8
;
408 EFI_PEI_PCD_PPI_GET_16 Get16
;
409 EFI_PEI_PCD_PPI_GET_32 Get32
;
410 EFI_PEI_PCD_PPI_GET_64 Get64
;
411 EFI_PEI_PCD_PPI_GET_POINTER GetPtr
;
412 EFI_PEI_PCD_PPI_GET_BOOLEAN GetBool
;
413 EFI_PEI_PCD_PPI_GET_SIZE GetSize
;
414 EFI_PEI_PCD_PPI_SET_8 Set8
;
415 EFI_PEI_PCD_PPI_SET_16 Set16
;
416 EFI_PEI_PCD_PPI_SET_32 Set32
;
417 EFI_PEI_PCD_PPI_SET_64 Set64
;
418 EFI_PEI_PCD_PPI_SET_POINTER SetPtr
;
419 EFI_PEI_PCD_PPI_SET_BOOLEAN SetBool
;
420 EFI_PEI_PCD_PPI_CALLBACK_ON_SET CallbackOnSet
;
421 EFI_PEI_PCD_PPI_CANCEL_CALLBACK CancelCallback
;
422 EFI_PEI_PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
423 EFI_PEI_PCD_PPI_GET_NEXT_TOKEN_SPACE GetNextTokenSpace
;