2 Native Platform Configuration Database (PCD) PPI
4 Different with the EFI_PCD_PPI defined in PI 1.2 specification, the native
5 PCD PPI provide interfaces for dynamic and dynamic-ex type PCD.
6 The interfaces for dynamic type PCD do not require the token space guid as parameter,
7 but interfaces for dynamic-ex type PCD require token space guid as parameter.
9 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
17 #define PCD_PPI_GUID \
18 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }
20 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
24 Sets the SKU value for subsequent calls to set or get PCD token values.
26 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
27 SetSku() is normally called only once by the system.
29 For each item (token), the database can hold a single value that applies to all SKUs,
30 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
31 SKU-specific values are called SKU enabled.
33 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
34 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
35 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
36 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
37 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
38 set for that Id, the results are unpredictable.
40 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
41 set values associated with a PCD token.
48 (EFIAPI
*PCD_PPI_SET_SKU
)(
55 Retrieves an 8-bit value for a given PCD token.
57 Retrieves the current byte-sized value for a PCD token number.
58 If the TokenNumber is invalid, the results are unpredictable.
60 @param[in] TokenNumber The PCD token number.
62 @return The UINT8 value.
67 (EFIAPI
*PCD_PPI_GET8
)(
74 Retrieves a 16-bit value for a given PCD token.
76 Retrieves the current 16-bit value for a PCD token number.
77 If the TokenNumber is invalid, the results are unpredictable.
79 @param[in] TokenNumber The PCD token number.
81 @return The UINT16 value.
86 (EFIAPI
*PCD_PPI_GET16
)(
93 Retrieves a 32-bit value for a given PCD token.
95 Retrieves the current 32-bit value for a PCD token number.
96 If the TokenNumber is invalid, the results are unpredictable.
98 @param[in] TokenNumber The PCD token number.
100 @return The UINT32 value.
105 (EFIAPI
*PCD_PPI_GET32
)(
112 Retrieves a 64-bit value for a given PCD token.
114 Retrieves the current 64-bit value for a PCD token number.
115 If the TokenNumber is invalid, the results are unpredictable.
117 @param[in] TokenNumber The PCD token number.
119 @return The UINT64 value.
124 (EFIAPI
*PCD_PPI_GET64
)(
131 Retrieves a pointer to a value for a given PCD token.
133 Retrieves the current pointer to the buffer for a PCD token number.
134 Do not make any assumptions about the alignment of the pointer that
135 is returned by this function call. If the TokenNumber is invalid,
136 the results are unpredictable.
138 @param[in] TokenNumber The PCD token number.
140 @return The pointer to the buffer to be retrived.
145 (EFIAPI
*PCD_PPI_GET_POINTER
)(
152 Retrieves a Boolean value for a given PCD token.
154 Retrieves the current boolean value for a PCD token number.
155 Do not make any assumptions about the alignment of the pointer that
156 is returned by this function call. If the TokenNumber is invalid,
157 the results are unpredictable.
159 @param[in] TokenNumber The PCD token number.
161 @return The Boolean value.
166 (EFIAPI
*PCD_PPI_GET_BOOLEAN
)(
173 Retrieves the size of the value for a given PCD token.
175 Retrieves the current size of a particular PCD token.
176 If the TokenNumber is invalid, the results are unpredictable.
178 @param[in] TokenNumber The PCD token number.
180 @return The size of the value for the PCD token.
185 (EFIAPI
*PCD_PPI_GET_SIZE
)(
192 Retrieves an 8-bit value for a given PCD token and token space.
194 Retrieves the 8-bit value of a particular PCD token.
195 If the TokenNumber is invalid or the token space
196 specified by Guid does not exist, the results are
199 @param[in] Guid The token space for the token number.
200 @param[in] TokenNumber The PCD token number.
202 @return The size 8-bit value for the PCD token.
207 (EFIAPI
*PCD_PPI_GET_EX_8
)(
208 IN CONST EFI_GUID
*Guid
,
215 Retrieves a 16-bit value for a given PCD token and token space.
217 Retrieves the 16-bit value of a particular PCD token.
218 If the TokenNumber is invalid or the token space
219 specified by Guid does not exist, the results are
222 @param[in] Guid The token space for the token number.
223 @param[in] TokenNumber The PCD token number.
225 @return The size 16-bit value for the PCD token.
230 (EFIAPI
*PCD_PPI_GET_EX_16
)(
231 IN CONST EFI_GUID
*Guid
,
238 Retrieves a 32-bit value for a given PCD token and token space.
240 Retrieves the 32-bit value of a particular PCD token.
241 If the TokenNumber is invalid or the token space
242 specified by Guid does not exist, the results are
245 @param[in] Guid The token space for the token number.
246 @param[in] TokenNumber The PCD token number.
248 @return The size 32-bit value for the PCD token.
253 (EFIAPI
*PCD_PPI_GET_EX_32
)(
254 IN CONST EFI_GUID
*Guid
,
261 Retrieves a 64-bit value for a given PCD token and token space.
263 Retrieves the 64-bit value of a particular PCD token.
264 If the TokenNumber is invalid or the token space
265 specified by Guid does not exist, the results are
268 @param[in] Guid The token space for the token number.
269 @param[in] TokenNumber The PCD token number.
271 @return The size 64-bit value for the PCD token.
276 (EFIAPI
*PCD_PPI_GET_EX_64
)(
277 IN CONST EFI_GUID
*Guid
,
284 Retrieves a pointer to a value for a given PCD token and token space.
286 Retrieves the current pointer to the buffer for a PCD token number.
287 Do not make any assumptions about the alignment of the pointer that
288 is returned by this function call. If the TokenNumber is invalid,
289 the results are unpredictable.
291 @param[in] Guid The token space for the token number.
292 @param[in] TokenNumber The PCD token number.
294 @return The pointer to the buffer to be retrived.
299 (EFIAPI
*PCD_PPI_GET_EX_POINTER
)(
300 IN CONST EFI_GUID
*Guid
,
307 Retrieves an Boolean value for a given PCD token and token space.
309 Retrieves the Boolean value of a particular PCD token.
310 If the TokenNumber is invalid or the token space
311 specified by Guid does not exist, the results are
314 @param[in] Guid The token space for the token number.
315 @param[in] TokenNumber The PCD token number.
317 @return The size Boolean value for the PCD token.
322 (EFIAPI
*PCD_PPI_GET_EX_BOOLEAN
)(
323 IN CONST EFI_GUID
*Guid
,
330 Retrieves the size of the value for a given PCD token and token space.
332 Retrieves the current size of a particular PCD token.
333 If the TokenNumber is invalid, the results are unpredictable.
335 @param[in] Guid The token space for the token number.
336 @param[in] TokenNumber The PCD token number.
338 @return The size of the value for the PCD token.
343 (EFIAPI
*PCD_PPI_GET_EX_SIZE
)(
344 IN CONST EFI_GUID
*Guid
,
351 Sets an 8-bit value for a given PCD token.
353 When the PCD service sets a value, it will check to ensure that the
354 size of the value being set is compatible with the Token's existing definition.
355 If it is not, an error will be returned.
357 @param[in] TokenNumber The PCD token number.
358 @param[in] Value The value to set for the PCD token.
360 @retval EFI_SUCCESS The procedure returned successfully.
361 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
362 being set was incompatible with a call to this function.
363 Use GetSize() to retrieve the size of the target data.
364 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
369 (EFIAPI
*PCD_PPI_SET8
)(
370 IN UINTN TokenNumber
,
377 Sets a 16-bit value for a given PCD token.
379 When the PCD service sets a value, it will check to ensure that the
380 size of the value being set is compatible with the Token's existing definition.
381 If it is not, an error will be returned.
383 @param[in] TokenNumber The PCD token number.
384 @param[in] Value The value to set for the PCD token.
386 @retval EFI_SUCCESS The procedure returned successfully.
387 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
388 being set was incompatible with a call to this function.
389 Use GetSize() to retrieve the size of the target data.
390 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
395 (EFIAPI
*PCD_PPI_SET16
)(
396 IN UINTN TokenNumber
,
403 Sets a 32-bit value for a given PCD token.
405 When the PCD service sets a value, it will check to ensure that the
406 size of the value being set is compatible with the Token's existing definition.
407 If it is not, an error will be returned.
409 @param[in] TokenNumber The PCD token number.
410 @param[in] Value The value to set for the PCD token.
412 @retval EFI_SUCCESS The procedure returned successfully.
413 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
414 being set was incompatible with a call to this function.
415 Use GetSize() to retrieve the size of the target data.
416 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
421 (EFIAPI
*PCD_PPI_SET32
)(
422 IN UINTN TokenNumber
,
429 Sets a 64-bit value for a given PCD token.
431 When the PCD service sets a value, it will check to ensure that the
432 size of the value being set is compatible with the Token's existing definition.
433 If it is not, an error will be returned.
435 @param[in] TokenNumber The PCD token number.
436 @param[in] Value The value to set for the PCD token.
438 @retval EFI_SUCCESS The procedure returned successfully.
439 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
440 being set was incompatible with a call to this function.
441 Use GetSize() to retrieve the size of the target data.
442 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
447 (EFIAPI
*PCD_PPI_SET64
)(
448 IN UINTN TokenNumber
,
453 Sets a value of a specified size for a given PCD token.
455 When the PCD service sets a value, it will check to ensure that the
456 size of the value being set is compatible with the Token's existing definition.
457 If it is not, an error will be returned.
459 @param[in] TokenNumber The PCD token number.
460 @param[in, out] SizeOfValue A pointer to the length of the value being set for the PCD token.
461 On input, if the SizeOfValue is greater than the maximum size supported
462 for this TokenNumber then the output value of SizeOfValue will reflect
463 the maximum size supported for this TokenNumber.
464 @param[in] Buffer The buffer to set for the PCD token.
466 @retval EFI_SUCCESS The procedure returned successfully.
467 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
468 being set was incompatible with a call to this function.
469 Use GetSize() to retrieve the size of the target data.
470 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
475 (EFIAPI
*PCD_PPI_SET_POINTER
)(
476 IN UINTN TokenNumber
,
477 IN OUT UINTN
*SizeOfValue
,
482 Sets an Boolean value for a given PCD token.
484 When the PCD service sets a value, it will check to ensure that the
485 size of the value being set is compatible with the Token's existing definition.
486 If it is not, an error will be returned.
488 @param[in] TokenNumber The PCD token number.
489 @param[in] Value The value to set for the PCD token.
491 @retval EFI_SUCCESS The procedure returned successfully.
492 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
493 being set was incompatible with a call to this function.
494 Use GetSize() to retrieve the size of the target data.
495 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
500 (EFIAPI
*PCD_PPI_SET_BOOLEAN
)(
501 IN UINTN TokenNumber
,
508 Sets an 8-bit value for a given PCD token.
510 When the PCD service sets a value, it will check to ensure that the
511 size of the value being set is compatible with the Token's existing definition.
512 If it is not, an error will be returned.
514 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
515 @param[in] TokenNumber The PCD token number.
516 @param[in] Value The value to set for the PCD token.
518 @retval EFI_SUCCESS The procedure returned successfully.
519 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
520 being set was incompatible with a call to this function.
521 Use GetSize() to retrieve the size of the target data.
522 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
527 (EFIAPI
*PCD_PPI_SET_EX_8
)(
528 IN CONST EFI_GUID
*Guid
,
529 IN UINTN TokenNumber
,
536 Sets a 16-bit value for a given PCD token.
538 When the PCD service sets a value, it will check to ensure that the
539 size of the value being set is compatible with the Token's existing definition.
540 If it is not, an error will be returned.
542 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
543 @param[in] TokenNumber The PCD token number.
544 @param[in] Value The value to set for the PCD token.
546 @retval EFI_SUCCESS The procedure returned successfully.
547 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
548 being set was incompatible with a call to this function.
549 Use GetSize() to retrieve the size of the target data.
550 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
555 (EFIAPI
*PCD_PPI_SET_EX_16
)(
556 IN CONST EFI_GUID
*Guid
,
557 IN UINTN TokenNumber
,
564 Sets a 32-bit value for a given PCD token.
566 When the PCD service sets a value, it will check to ensure that the
567 size of the value being set is compatible with the Token's existing definition.
568 If it is not, an error will be returned.
570 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
571 @param[in] TokenNumber The PCD token number.
572 @param[in] Value The value to set for the PCD token.
574 @retval EFI_SUCCESS The procedure returned successfully.
575 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
576 being set was incompatible with a call to this function.
577 Use GetSize() to retrieve the size of the target data.
578 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
583 (EFIAPI
*PCD_PPI_SET_EX_32
)(
584 IN CONST EFI_GUID
*Guid
,
585 IN UINTN TokenNumber
,
592 Sets a 64-bit value for a given PCD token.
594 When the PCD service sets a value, it will check to ensure that the
595 size of the value being set is compatible with the Token's existing definition.
596 If it is not, an error will be returned.
598 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
599 @param[in] TokenNumber The PCD token number.
600 @param[in] Value The value to set for the PCD token.
602 @retval EFI_SUCCESS The procedure returned successfully.
603 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
604 being set was incompatible with a call to this function.
605 Use GetSize() to retrieve the size of the target data.
606 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
611 (EFIAPI
*PCD_PPI_SET_EX_64
)(
612 IN CONST EFI_GUID
*Guid
,
613 IN UINTN TokenNumber
,
620 Sets a value of a specified size for a given PCD token.
622 When the PCD service sets a value, it will check to ensure that the
623 size of the value being set is compatible with the Token's existing definition.
624 If it is not, an error will be returned.
626 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
627 @param[in] TokenNumber The PCD token number.
628 @param[in, out] SizeOfValue A pointer to the length of the value being set for the PCD token.
629 On input, if the SizeOfValue is greater than the maximum size supported
630 for this TokenNumber then the output value of SizeOfValue will reflect
631 the maximum size supported for this TokenNumber.
632 @param[in] Buffer The buffer to set for the PCD token.
634 @retval EFI_SUCCESS The procedure returned successfully.
635 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
636 being set was incompatible with a call to this function.
637 Use GetSize() to retrieve the size of the target data.
638 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
643 (EFIAPI
*PCD_PPI_SET_EX_POINTER
)(
644 IN CONST EFI_GUID
*Guid
,
645 IN UINTN TokenNumber
,
646 IN OUT UINTN
*SizeOfValue
,
651 Sets an Boolean value for a given PCD token.
653 When the PCD service sets a value, it will check to ensure that the
654 size of the value being set is compatible with the Token's existing definition.
655 If it is not, an error will be returned.
657 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
658 @param[in] TokenNumber The PCD token number.
659 @param[in] Value The value to set for the PCD token.
661 @retval EFI_SUCCESS The procedure returned successfully.
662 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
663 being set was incompatible with a call to this function.
664 Use GetSize() to retrieve the size of the target data.
665 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
670 (EFIAPI
*PCD_PPI_SET_EX_BOOLEAN
)(
671 IN CONST EFI_GUID
*Guid
,
672 IN UINTN TokenNumber
,
679 Callback on SET function prototype definition.
681 This notification function serves two purposes. Firstly, it notifies the module
682 which did the registration that the value of this PCD token has been set. Secondly,
683 it provides a mechanism for the module which did the registration to intercept the set
684 operation and override the value been set if necessary. After the invocation of the
685 callback function, TokenData will be used by PCD service PEIM to modify the internal data
688 @param[in] CallBackGuid The PCD token GUID being set.
689 @param[in] CallBackToken The PCD token number being set.
690 @param[in, out] TokenData A pointer to the token data being set.
691 @param[in] TokenDataSize The size, in bytes, of the data being set.
698 (EFIAPI
*PCD_PPI_CALLBACK
)(
699 IN CONST EFI_GUID
*CallBackGuid
, OPTIONAL
700 IN UINTN CallBackToken
,
701 IN OUT VOID
*TokenData
,
702 IN UINTN TokenDataSize
708 Specifies a function to be called anytime the value of a designated token is changed.
710 @param[in] TokenNumber The PCD token number.
711 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
712 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
714 @retval EFI_SUCCESS The PCD service has successfully established a call event
715 for the CallBackToken requested.
716 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
721 (EFIAPI
*PCD_PPI_CALLBACK_ONSET
)(
722 IN CONST EFI_GUID
*Guid
, OPTIONAL
723 IN UINTN TokenNumber
,
724 IN PCD_PPI_CALLBACK CallBackFunction
730 Cancels a previously set callback function for a particular PCD token number.
732 @param[in] TokenNumber The PCD token number.
733 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
734 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
736 @retval EFI_SUCCESS The PCD service has successfully established a call event
737 for the CallBackToken requested.
738 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
743 (EFIAPI
*PCD_PPI_CANCEL_CALLBACK
)(
744 IN CONST EFI_GUID
*Guid
, OPTIONAL
745 IN UINTN TokenNumber
,
746 IN PCD_PPI_CALLBACK CallBackFunction
752 Retrieves the next valid token number in a given namespace.
754 This is useful since the PCD infrastructure contains a sparse list of token numbers,
755 and one cannot a priori know what token numbers are valid in the database.
757 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
758 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
759 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
760 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
761 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
762 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
763 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
764 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
767 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
768 This is an optional parameter that may be NULL. If this parameter is NULL, then a request
769 is being made to retrieve tokens from the default token space.
770 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
772 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
773 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
778 (EFIAPI
*PCD_PPI_GET_NEXT_TOKEN
)(
779 IN CONST EFI_GUID
*Guid
, OPTIONAL
780 IN OUT UINTN
*TokenNumber
786 Retrieves the next valid PCD token namespace for a given namespace.
788 Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
789 token namespaces on a platform.
791 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token
792 namespace from which the search will start. On output, it designates the next valid
793 token namespace on the platform. If *Guid is NULL, then the GUID of the first token
794 space of the current platform is returned. If the search cannot locate the next valid
795 token namespace, an error is returned and the value of *Guid is undefined.
797 @retval EFI_SUCCESS The PCD service retrieved the value requested.
798 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
803 (EFIAPI
*PCD_PPI_GET_NEXT_TOKENSPACE
)(
804 IN OUT CONST EFI_GUID
**Guid
810 /// This service abstracts the ability to set/get Platform Configuration Database (PCD).
813 PCD_PPI_SET_SKU SetSku
;
819 PCD_PPI_GET_POINTER GetPtr
;
820 PCD_PPI_GET_BOOLEAN GetBool
;
821 PCD_PPI_GET_SIZE GetSize
;
823 PCD_PPI_GET_EX_8 Get8Ex
;
824 PCD_PPI_GET_EX_16 Get16Ex
;
825 PCD_PPI_GET_EX_32 Get32Ex
;
826 PCD_PPI_GET_EX_64 Get64Ex
;
827 PCD_PPI_GET_EX_POINTER GetPtrEx
;
828 PCD_PPI_GET_EX_BOOLEAN GetBoolEx
;
829 PCD_PPI_GET_EX_SIZE GetSizeEx
;
835 PCD_PPI_SET_POINTER SetPtr
;
836 PCD_PPI_SET_BOOLEAN SetBool
;
838 PCD_PPI_SET_EX_8 Set8Ex
;
839 PCD_PPI_SET_EX_16 Set16Ex
;
840 PCD_PPI_SET_EX_32 Set32Ex
;
841 PCD_PPI_SET_EX_64 Set64Ex
;
842 PCD_PPI_SET_EX_POINTER SetPtrEx
;
843 PCD_PPI_SET_EX_BOOLEAN SetBoolEx
;
845 PCD_PPI_CALLBACK_ONSET CallbackOnSet
;
846 PCD_PPI_CANCEL_CALLBACK CancelCallback
;
847 PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
848 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace
;
852 extern EFI_GUID gPcdPpiGuid
;