2 Platform Configuration Database (PCD) PPI
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #define PCD_PPI_GUID \
20 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }
22 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
27 Sets the SKU value for subsequent calls to set or get PCD token values.
29 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
30 SetSku() is normally called only once by the system.
32 For each item (token), the database can hold a single value that applies to all SKUs,
33 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
34 SKU-specific values are called SKU enabled.
36 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
37 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
38 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
39 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
40 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
41 set for that Id, the results are unpredictable.
43 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
44 set values associated with a PCD token.
51 (EFIAPI
*PCD_PPI_SET_SKU
) (
58 Retrieves an 8-bit value for a given PCD token.
60 Retrieves the current byte-sized value for a PCD token number.
61 If the TokenNumber is invalid, the results are unpredictable.
63 @param[in] TokenNumber The PCD token number.
65 @return The UINT8 value.
70 (EFIAPI
*PCD_PPI_GET8
) (
77 Retrieves an 16-bit value for a given PCD token.
79 Retrieves the current 16-bits value for a PCD token number.
80 If the TokenNumber is invalid, the results are unpredictable.
82 @param[in] TokenNumber The PCD token number.
84 @return The UINT16 value.
89 (EFIAPI
*PCD_PPI_GET16
) (
96 Retrieves an 32-bit value for a given PCD token.
98 Retrieves the current 32-bits value for a PCD token number.
99 If the TokenNumber is invalid, the results are unpredictable.
101 @param[in] TokenNumber The PCD token number.
103 @return The UINT32 value.
108 (EFIAPI
*PCD_PPI_GET32
) (
115 Retrieves an 64-bit value for a given PCD token.
117 Retrieves the current 64-bits value for a PCD token number.
118 If the TokenNumber is invalid, the results are unpredictable.
120 @param[in] TokenNumber The PCD token number.
122 @return The UINT64 value.
127 (EFIAPI
*PCD_PPI_GET64
) (
134 Retrieves a pointer to a value for a given PCD token.
136 Retrieves the current pointer to the buffer for a PCD token number.
137 Do not make any assumptions about the alignment of the pointer that
138 is returned by this function call. If the TokenNumber is invalid,
139 the results are unpredictable.
141 @param[in] TokenNumber The PCD token number.
143 @return The pointer to the buffer to be retrived.
148 (EFIAPI
*PCD_PPI_GET_POINTER
) (
155 Retrieves a Boolean value for a given PCD token.
157 Retrieves the current boolean value for a PCD token number.
158 Do not make any assumptions about the alignment of the pointer that
159 is returned by this function call. If the TokenNumber is invalid,
160 the results are unpredictable.
162 @param[in] TokenNumber The PCD token number.
164 @return The Boolean value.
169 (EFIAPI
*PCD_PPI_GET_BOOLEAN
) (
176 Retrieves the size of the value for a given PCD token.
178 Retrieves the current size of a particular PCD token.
179 If the TokenNumber is invalid, the results are unpredictable.
181 @param[in] TokenNumber The PCD token number.
183 @return The size of the value for the PCD token.
188 (EFIAPI
*PCD_PPI_GET_SIZE
) (
195 Retrieves an 8-bit value for a given PCD token.
197 Retrieves the 8-bit value of a particular PCD token.
198 If the TokenNumber is invalid or the token space
199 specified by Guid does not exist, the results are
202 @param[in] Guid The token space for the token number.
203 @param[in] TokenNumber The PCD token number.
205 @return The size 8-bit value for the PCD token.
210 (EFIAPI
*PCD_PPI_GET_EX_8
) (
211 IN CONST EFI_GUID
*Guid
,
218 Retrieves an 16-bit value for a given PCD token.
220 Retrieves the 16-bit value of a particular PCD token.
221 If the TokenNumber is invalid or the token space
222 specified by Guid does not exist, the results are
225 @param[in] Guid The token space for the token number.
226 @param[in] TokenNumber The PCD token number.
228 @return The size 16-bit value for the PCD token.
233 (EFIAPI
*PCD_PPI_GET_EX_16
) (
234 IN CONST EFI_GUID
*Guid
,
241 Retrieves an 32-bit value for a given PCD token.
243 Retrieves the 32-bit value of a particular PCD token.
244 If the TokenNumber is invalid or the token space
245 specified by Guid does not exist, the results are
248 @param[in] Guid The token space for the token number.
249 @param[in] TokenNumber The PCD token number.
251 @return The size 32-bit value for the PCD token.
256 (EFIAPI
*PCD_PPI_GET_EX_32
) (
257 IN CONST EFI_GUID
*Guid
,
264 Retrieves an 64-bit value for a given PCD token.
266 Retrieves the 64-bit value of a particular PCD token.
267 If the TokenNumber is invalid or the token space
268 specified by Guid does not exist, the results are
271 @param[in] Guid The token space for the token number.
272 @param[in] TokenNumber The PCD token number.
274 @return The size 64-bit value for the PCD token.
279 (EFIAPI
*PCD_PPI_GET_EX_64
) (
280 IN CONST EFI_GUID
*Guid
,
287 Retrieves a pointer to a value for a given PCD token.
289 Retrieves the current pointer to the buffer for a PCD token number.
290 Do not make any assumptions about the alignment of the pointer that
291 is returned by this function call. If the TokenNumber is invalid,
292 the results are unpredictable.
294 @param[in] Guid The token space for the token number.
295 @param[in] TokenNumber The PCD token number.
297 @return The pointer to the buffer to be retrived.
302 (EFIAPI
*PCD_PPI_GET_EX_POINTER
) (
303 IN CONST EFI_GUID
*Guid
,
310 Retrieves an Boolean value for a given PCD token.
312 Retrieves the Boolean value of a particular PCD token.
313 If the TokenNumber is invalid or the token space
314 specified by Guid does not exist, the results are
317 @param[in] Guid The token space for the token number.
318 @param[in] TokenNumber The PCD token number.
320 @return The size Boolean value for the PCD token.
325 (EFIAPI
*PCD_PPI_GET_EX_BOOLEAN
) (
326 IN CONST EFI_GUID
*Guid
,
333 Retrieves the size of the value for a given PCD token.
335 Retrieves the current size of a particular PCD token.
336 If the TokenNumber is invalid, the results are unpredictable.
338 @param[in] Guid The token space for the token number.
339 @param[in] TokenNumber The PCD token number.
341 @return The size of the value for the PCD token.
346 (EFIAPI
*PCD_PPI_GET_EX_SIZE
) (
347 IN CONST EFI_GUID
*Guid
,
354 Sets an 8-bit value for a given PCD token.
356 When the PCD service sets a value, it will check to ensure that the
357 size of the value being set is compatible with the Token's existing definition.
358 If it is not, an error will be returned.
360 @param[in] TokenNumber The PCD token number.
361 @param[in] Value The value to set for the PCD token.
363 @retval EFI_SUCCESS Procedure returned successfully.
364 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
365 being set was incompatible with a call to this function.
366 Use GetSize() to retrieve the size of the target data.
367 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
372 (EFIAPI
*PCD_PPI_SET8
) (
373 IN UINTN TokenNumber
,
380 Sets an 16-bit value for a given PCD token.
382 When the PCD service sets a value, it will check to ensure that the
383 size of the value being set is compatible with the Token's existing definition.
384 If it is not, an error will be returned.
386 @param[in] TokenNumber The PCD token number.
387 @param[in] Value The value to set for the PCD token.
389 @retval EFI_SUCCESS Procedure returned successfully.
390 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
391 being set was incompatible with a call to this function.
392 Use GetSize() to retrieve the size of the target data.
393 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
398 (EFIAPI
*PCD_PPI_SET16
) (
399 IN UINTN TokenNumber
,
406 Sets an 32-bit value for a given PCD token.
408 When the PCD service sets a value, it will check to ensure that the
409 size of the value being set is compatible with the Token's existing definition.
410 If it is not, an error will be returned.
412 @param[in] TokenNumber The PCD token number.
413 @param[in] Value The value to set for the PCD token.
415 @retval EFI_SUCCESS Procedure returned successfully.
416 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
417 being set was incompatible with a call to this function.
418 Use GetSize() to retrieve the size of the target data.
419 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
424 (EFIAPI
*PCD_PPI_SET32
) (
425 IN UINTN TokenNumber
,
432 Sets an 64-bit value for a given PCD token.
434 When the PCD service sets a value, it will check to ensure that the
435 size of the value being set is compatible with the Token's existing definition.
436 If it is not, an error will be returned.
438 @param[in] TokenNumber The PCD token number.
439 @param[in] Value The value to set for the PCD token.
441 @retval EFI_SUCCESS Procedure returned successfully.
442 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
443 being set was incompatible with a call to this function.
444 Use GetSize() to retrieve the size of the target data.
445 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
450 (EFIAPI
*PCD_PPI_SET64
) (
451 IN UINTN TokenNumber
,
459 Sets a value of a specified size for a given PCD token.
461 When the PCD service sets a value, it will check to ensure that the
462 size of the value being set is compatible with the Token's existing definition.
463 If it is not, an error will be returned.
465 @param[in] TokenNumber The PCD token number.
466 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
467 On input, if the SizeOfValue is greater than the maximum size supported
468 for this TokenNumber then the output value of SizeOfValue will reflect
469 the maximum size supported for this TokenNumber.
470 @param[in] Buffer The buffer to set for the PCD token.
472 @retval EFI_SUCCESS Procedure returned successfully.
473 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
474 being set was incompatible with a call to this function.
475 Use GetSize() to retrieve the size of the target data.
476 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
481 (EFIAPI
*PCD_PPI_SET_POINTER
) (
482 IN UINTN TokenNumber
,
483 IN OUT UINTN
*SizeOfBuffer
,
490 Sets an Boolean value for a given PCD token.
492 When the PCD service sets a value, it will check to ensure that the
493 size of the value being set is compatible with the Token's existing definition.
494 If it is not, an error will be returned.
496 @param[in] TokenNumber The PCD token number.
497 @param[in] Value The value to set for the PCD token.
499 @retval EFI_SUCCESS Procedure returned successfully.
500 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
501 being set was incompatible with a call to this function.
502 Use GetSize() to retrieve the size of the target data.
503 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
508 (EFIAPI
*PCD_PPI_SET_BOOLEAN
) (
509 IN UINTN TokenNumber
,
516 Sets an 8-bit value for a given PCD token.
518 When the PCD service sets a value, it will check to ensure that the
519 size of the value being set is compatible with the Token's existing definition.
520 If it is not, an error will be returned.
522 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
523 @param[in] TokenNumber The PCD token number.
524 @param[in] Value The value to set for the PCD token.
526 @retval EFI_SUCCESS Procedure returned successfully.
527 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
528 being set was incompatible with a call to this function.
529 Use GetSize() to retrieve the size of the target data.
530 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
535 (EFIAPI
*PCD_PPI_SET_EX_8
) (
536 IN CONST EFI_GUID
*Guid
,
537 IN UINTN TokenNumber
,
544 Sets an 16-bit value for a given PCD token.
546 When the PCD service sets a value, it will check to ensure that the
547 size of the value being set is compatible with the Token's existing definition.
548 If it is not, an error will be returned.
550 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
551 @param[in] TokenNumber The PCD token number.
552 @param[in] Value The value to set for the PCD token.
554 @retval EFI_SUCCESS Procedure returned successfully.
555 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
556 being set was incompatible with a call to this function.
557 Use GetSize() to retrieve the size of the target data.
558 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
563 (EFIAPI
*PCD_PPI_SET_EX_16
) (
564 IN CONST EFI_GUID
*Guid
,
565 IN UINTN TokenNumber
,
572 Sets an 32-bit value for a given PCD token.
574 When the PCD service sets a value, it will check to ensure that the
575 size of the value being set is compatible with the Token's existing definition.
576 If it is not, an error will be returned.
578 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
579 @param[in] TokenNumber The PCD token number.
580 @param[in] Value The value to set for the PCD token.
582 @retval EFI_SUCCESS Procedure returned successfully.
583 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
584 being set was incompatible with a call to this function.
585 Use GetSize() to retrieve the size of the target data.
586 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
591 (EFIAPI
*PCD_PPI_SET_EX_32
) (
592 IN CONST EFI_GUID
*Guid
,
593 IN UINTN TokenNumber
,
600 Sets an 64-bit value for a given PCD token.
602 When the PCD service sets a value, it will check to ensure that the
603 size of the value being set is compatible with the Token's existing definition.
604 If it is not, an error will be returned.
606 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
607 @param[in] TokenNumber The PCD token number.
608 @param[in] Value The value to set for the PCD token.
610 @retval EFI_SUCCESS Procedure returned successfully.
611 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
612 being set was incompatible with a call to this function.
613 Use GetSize() to retrieve the size of the target data.
614 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
619 (EFIAPI
*PCD_PPI_SET_EX_64
) (
620 IN CONST EFI_GUID
*Guid
,
621 IN UINTN TokenNumber
,
628 Sets a value of a specified size for a given PCD token.
630 When the PCD service sets a value, it will check to ensure that the
631 size of the value being set is compatible with the Token's existing definition.
632 If it is not, an error will be returned.
634 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
635 @param[in] TokenNumber The PCD token number.
636 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
637 On input, if the SizeOfValue is greater than the maximum size supported
638 for this TokenNumber then the output value of SizeOfValue will reflect
639 the maximum size supported for this TokenNumber.
640 @param[in] Buffer The buffer to set for the PCD token.
642 @retval EFI_SUCCESS Procedure returned successfully.
643 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
644 being set was incompatible with a call to this function.
645 Use GetSize() to retrieve the size of the target data.
646 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
651 (EFIAPI
*PCD_PPI_SET_EX_POINTER
) (
652 IN CONST EFI_GUID
*Guid
,
653 IN UINTN TokenNumber
,
654 IN OUT UINTN
*SizeOfBuffer
,
661 Sets an Boolean value for a given PCD token.
663 When the PCD service sets a value, it will check to ensure that the
664 size of the value being set is compatible with the Token's existing definition.
665 If it is not, an error will be returned.
667 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
668 @param[in] TokenNumber The PCD token number.
669 @param[in] Value The value to set for the PCD token.
671 @retval EFI_SUCCESS Procedure returned successfully.
672 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
673 being set was incompatible with a call to this function.
674 Use GetSize() to retrieve the size of the target data.
675 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
680 (EFIAPI
*PCD_PPI_SET_EX_BOOLEAN
) (
681 IN CONST EFI_GUID
*Guid
,
682 IN UINTN TokenNumber
,
689 Callback on SET function prototype definition.
691 This notification function serves two purposes. Firstly, it notifies the module
692 which did the registration that the value of this PCD token has been set. Secondly,
693 it provides a mechanism for the module which did the registration to intercept the set
694 operation and override the value been set if necessary. After the invocation of the
695 callback function, TokenData will be used by PCD service PEIM to modify the internal data
698 @param[in] CallBackGuid The PCD token GUID being set.
699 @param[in] CallBackToken The PCD token number being set.
700 @param[in, out] TokenData A pointer to the token data being set.
701 @param[in] TokenDataSize The size, in bytes, of the data being set.
708 (EFIAPI
*PCD_PPI_CALLBACK
) (
709 IN CONST EFI_GUID
*CallBackGuid
, OPTIONAL
710 IN UINTN CallBackToken
,
711 IN OUT VOID
*TokenData
,
712 IN UINTN TokenDataSize
718 Specifies a function to be called anytime the value of a designated token is changed.
720 @param[in] TokenNumber The PCD token number.
721 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
722 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
724 @retval EFI_SUCCESS The PCD service has successfully established a call event
725 for the CallBackToken requested.
726 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
731 (EFIAPI
*PCD_PPI_CALLBACK_ONSET
) (
732 IN CONST EFI_GUID
*Guid
, OPTIONAL
733 IN UINTN TokenNumber
,
734 IN PCD_PPI_CALLBACK CallBackFunction
740 Cancels a previously set callback function for a particular PCD token number.
742 @param[in] TokenNumber The PCD token number.
743 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
744 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
746 @retval EFI_SUCCESS The PCD service has successfully established a call event
747 for the CallBackToken requested.
748 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
753 (EFIAPI
*PCD_PPI_CANCEL_CALLBACK
) (
754 IN CONST EFI_GUID
*Guid
, OPTIONAL
755 IN UINTN TokenNumber
,
756 IN PCD_PPI_CALLBACK CallBackFunction
762 Retrieves the next valid PCD token for a given namespace.
764 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
765 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
766 If the input token namespace or token number does not exist on the platform, an error is
767 returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
768 have the pointer reference a TokenNumber value of 0. If the input token number is 0
769 and there is no valid token number for this token namespace, *TokenNumber will be
770 assigned to 0 and the function return EFI_SUCCESS. If the token number is the last valid
771 token number, *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
773 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
774 Or the input token number is already the last valid token number in the PCD database.
775 In the later case, *TokenNumber is updated with the value of 0.
776 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
781 (EFIAPI
*PCD_PPI_GET_NEXT_TOKEN
) (
782 IN CONST EFI_GUID
*Guid
, OPTIONAL
783 IN OUT UINTN
*TokenNumber
789 Retrieves the next valid PCD token namespace for a given namespace.
791 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known
792 token namespace from which the search will start. On output, it designates
793 the next valid token namespace on the platform. If the input token namespace
794 does not exist on the platform, an error is returned and the value of *Guid is
795 undefined. If *Guid is NULL, then the GUID of the first token space of the
796 current platform is assigned to *Guid the function return EFI_SUCCESS.
797 If *Guid is NULL and there is no namespace exist in the platform other than the default
798 (NULL) tokennamespace, *Guid is unchanged and the function return EFI_SUCCESS.
799 If this input token namespace is the last namespace on the platform,
800 *Guid will be assigned to NULL and the function return EFI_SUCCESS.
802 @retval EFI_SUCCESS The PCD service has retrieved the next valid token namespace.
803 Or the input token namespace is already the last valid token
804 number in the PCD database. In the later case, *Guid is updated
805 with the value of NULL. Or the input token name space is NULL and there
806 is no valid token namespace other than the default namespace (NULL).
807 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
812 (EFIAPI
*PCD_PPI_GET_NEXT_TOKENSPACE
) (
813 IN OUT CONST EFI_GUID
**Guid
819 // Interface structure for the PCD PPI
822 PCD_PPI_SET_SKU SetSku
;
828 PCD_PPI_GET_POINTER GetPtr
;
829 PCD_PPI_GET_BOOLEAN GetBool
;
830 PCD_PPI_GET_SIZE GetSize
;
832 PCD_PPI_GET_EX_8 Get8Ex
;
833 PCD_PPI_GET_EX_16 Get16Ex
;
834 PCD_PPI_GET_EX_32 Get32Ex
;
835 PCD_PPI_GET_EX_64 Get64Ex
;
836 PCD_PPI_GET_EX_POINTER GetPtrEx
;
837 PCD_PPI_GET_EX_BOOLEAN GetBoolEx
;
838 PCD_PPI_GET_EX_SIZE GetSizeEx
;
844 PCD_PPI_SET_POINTER SetPtr
;
845 PCD_PPI_SET_BOOLEAN SetBool
;
847 PCD_PPI_SET_EX_8 Set8Ex
;
848 PCD_PPI_SET_EX_16 Set16Ex
;
849 PCD_PPI_SET_EX_32 Set32Ex
;
850 PCD_PPI_SET_EX_64 Set64Ex
;
851 PCD_PPI_SET_EX_POINTER SetPtrEx
;
852 PCD_PPI_SET_EX_BOOLEAN SetBoolEx
;
854 PCD_PPI_CALLBACK_ONSET CallbackOnSet
;
855 PCD_PPI_CANCEL_CALLBACK CancelCallback
;
856 PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
857 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace
;
861 extern EFI_GUID gPcdPpiGuid
;