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.
21 #define PCD_PPI_GUID \
22 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }
24 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
29 Sets the SKU value for subsequent calls to set or get PCD token values.
31 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
32 SetSku() is normally called only once by the system.
34 For each item (token), the database can hold a single value that applies to all SKUs,
35 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
36 SKU-specific values are called SKU enabled.
38 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
39 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
40 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
41 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
42 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
43 set for that Id, the results are unpredictable.
45 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
46 set values associated with a PCD token.
53 (EFIAPI
*PCD_PPI_SET_SKU
) (
60 Retrieves an 8-bit value for a given PCD token.
62 Retrieves the current byte-sized value for a PCD token number.
63 If the TokenNumber is invalid, the results are unpredictable.
65 @param[in] TokenNumber The PCD token number.
67 @return The UINT8 value.
72 (EFIAPI
*PCD_PPI_GET8
) (
79 Retrieves an 16-bit value for a given PCD token.
81 Retrieves the current 16-bits value for a PCD token number.
82 If the TokenNumber is invalid, the results are unpredictable.
84 @param[in] TokenNumber The PCD token number.
86 @return The UINT16 value.
91 (EFIAPI
*PCD_PPI_GET16
) (
98 Retrieves an 32-bit value for a given PCD token.
100 Retrieves the current 32-bits value for a PCD token number.
101 If the TokenNumber is invalid, the results are unpredictable.
103 @param[in] TokenNumber The PCD token number.
105 @return The UINT32 value.
110 (EFIAPI
*PCD_PPI_GET32
) (
117 Retrieves an 64-bit value for a given PCD token.
119 Retrieves the current 64-bits value for a PCD token number.
120 If the TokenNumber is invalid, the results are unpredictable.
122 @param[in] TokenNumber The PCD token number.
124 @return The UINT64 value.
129 (EFIAPI
*PCD_PPI_GET64
) (
136 Retrieves a pointer to a value for a given PCD token.
138 Retrieves the current pointer to the buffer for a PCD token number.
139 Do not make any assumptions about the alignment of the pointer that
140 is returned by this function call. If the TokenNumber is invalid,
141 the results are unpredictable.
143 @param[in] TokenNumber The PCD token number.
145 @return The pointer to the buffer to be retrived.
150 (EFIAPI
*PCD_PPI_GET_POINTER
) (
157 Retrieves a Boolean value for a given PCD token.
159 Retrieves the current boolean value for a PCD token number.
160 Do not make any assumptions about the alignment of the pointer that
161 is returned by this function call. If the TokenNumber is invalid,
162 the results are unpredictable.
164 @param[in] TokenNumber The PCD token number.
166 @return The Boolean value.
171 (EFIAPI
*PCD_PPI_GET_BOOLEAN
) (
178 Retrieves the size of the value for a given PCD token.
180 Retrieves the current size of a particular PCD token.
181 If the TokenNumber is invalid, the results are unpredictable.
183 @param[in] TokenNumber The PCD token number.
185 @return The size of the value for the PCD token.
190 (EFIAPI
*PCD_PPI_GET_SIZE
) (
197 Retrieves an 8-bit value for a given PCD token.
199 Retrieves the 8-bit value of a particular PCD token.
200 If the TokenNumber is invalid or the token space
201 specified by Guid does not exist, the results are
204 @param[in] Guid The token space for the token number.
205 @param[in] TokenNumber The PCD token number.
207 @return The size 8-bit value for the PCD token.
212 (EFIAPI
*PCD_PPI_GET_EX_8
) (
213 IN CONST EFI_GUID
*Guid
,
220 Retrieves an 16-bit value for a given PCD token.
222 Retrieves the 16-bit value of a particular PCD token.
223 If the TokenNumber is invalid or the token space
224 specified by Guid does not exist, the results are
227 @param[in] Guid The token space for the token number.
228 @param[in] TokenNumber The PCD token number.
230 @return The size 16-bit value for the PCD token.
235 (EFIAPI
*PCD_PPI_GET_EX_16
) (
236 IN CONST EFI_GUID
*Guid
,
243 Retrieves an 32-bit value for a given PCD token.
245 Retrieves the 32-bit value of a particular PCD token.
246 If the TokenNumber is invalid or the token space
247 specified by Guid does not exist, the results are
250 @param[in] Guid The token space for the token number.
251 @param[in] TokenNumber The PCD token number.
253 @return The size 32-bit value for the PCD token.
258 (EFIAPI
*PCD_PPI_GET_EX_32
) (
259 IN CONST EFI_GUID
*Guid
,
266 Retrieves an 64-bit value for a given PCD token.
268 Retrieves the 64-bit value of a particular PCD token.
269 If the TokenNumber is invalid or the token space
270 specified by Guid does not exist, the results are
273 @param[in] Guid The token space for the token number.
274 @param[in] TokenNumber The PCD token number.
276 @return The size 64-bit value for the PCD token.
281 (EFIAPI
*PCD_PPI_GET_EX_64
) (
282 IN CONST EFI_GUID
*Guid
,
289 Retrieves a pointer to a value for a given PCD token.
291 Retrieves the current pointer to the buffer for a PCD token number.
292 Do not make any assumptions about the alignment of the pointer that
293 is returned by this function call. If the TokenNumber is invalid,
294 the results are unpredictable.
296 @param[in] Guid The token space for the token number.
297 @param[in] TokenNumber The PCD token number.
299 @return The pointer to the buffer to be retrived.
304 (EFIAPI
*PCD_PPI_GET_EX_POINTER
) (
305 IN CONST EFI_GUID
*Guid
,
312 Retrieves an Boolean value for a given PCD token.
314 Retrieves the Boolean value of a particular PCD token.
315 If the TokenNumber is invalid or the token space
316 specified by Guid does not exist, the results are
319 @param[in] Guid The token space for the token number.
320 @param[in] TokenNumber The PCD token number.
322 @return The size Boolean value for the PCD token.
327 (EFIAPI
*PCD_PPI_GET_EX_BOOLEAN
) (
328 IN CONST EFI_GUID
*Guid
,
335 Retrieves the size of the value for a given PCD token.
337 Retrieves the current size of a particular PCD token.
338 If the TokenNumber is invalid, the results are unpredictable.
340 @param[in] Guid The token space for the token number.
341 @param[in] TokenNumber The PCD token number.
343 @return The size of the value for the PCD token.
348 (EFIAPI
*PCD_PPI_GET_EX_SIZE
) (
349 IN CONST EFI_GUID
*Guid
,
356 Sets an 8-bit value for a given PCD token.
358 When the PCD service sets a value, it will check to ensure that the
359 size of the value being set is compatible with the Token's existing definition.
360 If it is not, an error will be returned.
362 @param[in] TokenNumber The PCD token number.
363 @param[in] Value The value to set for the PCD token.
365 @retval EFI_SUCCESS Procedure returned successfully.
366 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
367 being set was incompatible with a call to this function.
368 Use GetSize() to retrieve the size of the target data.
369 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
374 (EFIAPI
*PCD_PPI_SET8
) (
375 IN UINTN TokenNumber
,
382 Sets an 16-bit value for a given PCD token.
384 When the PCD service sets a value, it will check to ensure that the
385 size of the value being set is compatible with the Token's existing definition.
386 If it is not, an error will be returned.
388 @param[in] TokenNumber The PCD token number.
389 @param[in] Value The value to set for the PCD token.
391 @retval EFI_SUCCESS Procedure returned successfully.
392 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
393 being set was incompatible with a call to this function.
394 Use GetSize() to retrieve the size of the target data.
395 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
400 (EFIAPI
*PCD_PPI_SET16
) (
401 IN UINTN TokenNumber
,
408 Sets an 32-bit value for a given PCD token.
410 When the PCD service sets a value, it will check to ensure that the
411 size of the value being set is compatible with the Token's existing definition.
412 If it is not, an error will be returned.
414 @param[in] TokenNumber The PCD token number.
415 @param[in] Value The value to set for the PCD token.
417 @retval EFI_SUCCESS Procedure returned successfully.
418 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
419 being set was incompatible with a call to this function.
420 Use GetSize() to retrieve the size of the target data.
421 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
426 (EFIAPI
*PCD_PPI_SET32
) (
427 IN UINTN TokenNumber
,
434 Sets an 64-bit value for a given PCD token.
436 When the PCD service sets a value, it will check to ensure that the
437 size of the value being set is compatible with the Token's existing definition.
438 If it is not, an error will be returned.
440 @param[in] TokenNumber The PCD token number.
441 @param[in] Value The value to set for the PCD token.
443 @retval EFI_SUCCESS Procedure returned successfully.
444 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
445 being set was incompatible with a call to this function.
446 Use GetSize() to retrieve the size of the target data.
447 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
452 (EFIAPI
*PCD_PPI_SET64
) (
453 IN UINTN TokenNumber
,
461 Sets a value of a specified size for a given PCD token.
463 When the PCD service sets a value, it will check to ensure that the
464 size of the value being set is compatible with the Token's existing definition.
465 If it is not, an error will be returned.
467 @param[in] TokenNumber The PCD token number.
468 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
469 On input, if the SizeOfValue is greater than the maximum size supported
470 for this TokenNumber then the output value of SizeOfValue will reflect
471 the maximum size supported for this TokenNumber.
472 @param[in] Buffer The buffer to set for the PCD token.
474 @retval EFI_SUCCESS Procedure returned successfully.
475 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
476 being set was incompatible with a call to this function.
477 Use GetSize() to retrieve the size of the target data.
478 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
483 (EFIAPI
*PCD_PPI_SET_POINTER
) (
484 IN UINTN TokenNumber
,
485 IN OUT UINTN
*SizeOfBuffer
,
492 Sets an Boolean value for a given PCD token.
494 When the PCD service sets a value, it will check to ensure that the
495 size of the value being set is compatible with the Token's existing definition.
496 If it is not, an error will be returned.
498 @param[in] TokenNumber The PCD token number.
499 @param[in] Value The value to set for the PCD token.
501 @retval EFI_SUCCESS Procedure returned successfully.
502 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
503 being set was incompatible with a call to this function.
504 Use GetSize() to retrieve the size of the target data.
505 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
510 (EFIAPI
*PCD_PPI_SET_BOOLEAN
) (
511 IN UINTN TokenNumber
,
518 Sets an 8-bit value for a given PCD token.
520 When the PCD service sets a value, it will check to ensure that the
521 size of the value being set is compatible with the Token's existing definition.
522 If it is not, an error will be returned.
524 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
525 @param[in] TokenNumber The PCD token number.
526 @param[in] Value The value to set for the PCD token.
528 @retval EFI_SUCCESS Procedure returned successfully.
529 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
530 being set was incompatible with a call to this function.
531 Use GetSize() to retrieve the size of the target data.
532 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
537 (EFIAPI
*PCD_PPI_SET_EX_8
) (
538 IN CONST EFI_GUID
*Guid
,
539 IN UINTN TokenNumber
,
546 Sets an 16-bit value for a given PCD token.
548 When the PCD service sets a value, it will check to ensure that the
549 size of the value being set is compatible with the Token's existing definition.
550 If it is not, an error will be returned.
552 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
553 @param[in] TokenNumber The PCD token number.
554 @param[in] Value The value to set for the PCD token.
556 @retval EFI_SUCCESS Procedure returned successfully.
557 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
558 being set was incompatible with a call to this function.
559 Use GetSize() to retrieve the size of the target data.
560 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
565 (EFIAPI
*PCD_PPI_SET_EX_16
) (
566 IN CONST EFI_GUID
*Guid
,
567 IN UINTN TokenNumber
,
574 Sets an 32-bit value for a given PCD token.
576 When the PCD service sets a value, it will check to ensure that the
577 size of the value being set is compatible with the Token's existing definition.
578 If it is not, an error will be returned.
580 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
581 @param[in] TokenNumber The PCD token number.
582 @param[in] Value The value to set for the PCD token.
584 @retval EFI_SUCCESS Procedure returned successfully.
585 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
586 being set was incompatible with a call to this function.
587 Use GetSize() to retrieve the size of the target data.
588 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
593 (EFIAPI
*PCD_PPI_SET_EX_32
) (
594 IN CONST EFI_GUID
*Guid
,
595 IN UINTN TokenNumber
,
602 Sets an 64-bit value for a given PCD token.
604 When the PCD service sets a value, it will check to ensure that the
605 size of the value being set is compatible with the Token's existing definition.
606 If it is not, an error will be returned.
608 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
609 @param[in] TokenNumber The PCD token number.
610 @param[in] Value The value to set for the PCD token.
612 @retval EFI_SUCCESS Procedure returned successfully.
613 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
614 being set was incompatible with a call to this function.
615 Use GetSize() to retrieve the size of the target data.
616 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
621 (EFIAPI
*PCD_PPI_SET_EX_64
) (
622 IN CONST EFI_GUID
*Guid
,
623 IN UINTN TokenNumber
,
630 Sets a value of a specified size for a given PCD token.
632 When the PCD service sets a value, it will check to ensure that the
633 size of the value being set is compatible with the Token's existing definition.
634 If it is not, an error will be returned.
636 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
637 @param[in] TokenNumber The PCD token number.
638 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
639 On input, if the SizeOfValue is greater than the maximum size supported
640 for this TokenNumber then the output value of SizeOfValue will reflect
641 the maximum size supported for this TokenNumber.
642 @param[in] Buffer The buffer to set for the PCD token.
644 @retval EFI_SUCCESS Procedure returned successfully.
645 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
646 being set was incompatible with a call to this function.
647 Use GetSize() to retrieve the size of the target data.
648 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
653 (EFIAPI
*PCD_PPI_SET_EX_POINTER
) (
654 IN CONST EFI_GUID
*Guid
,
655 IN UINTN TokenNumber
,
656 IN OUT UINTN
*SizeOfBuffer
,
663 Sets an Boolean value for a given PCD token.
665 When the PCD service sets a value, it will check to ensure that the
666 size of the value being set is compatible with the Token's existing definition.
667 If it is not, an error will be returned.
669 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
670 @param[in] TokenNumber The PCD token number.
671 @param[in] Value The value to set for the PCD token.
673 @retval EFI_SUCCESS Procedure returned successfully.
674 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
675 being set was incompatible with a call to this function.
676 Use GetSize() to retrieve the size of the target data.
677 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
682 (EFIAPI
*PCD_PPI_SET_EX_BOOLEAN
) (
683 IN CONST EFI_GUID
*Guid
,
684 IN UINTN TokenNumber
,
691 Callback on SET function prototype definition.
693 This notification function serves two purposes. Firstly, it notifies the module
694 which did the registration that the value of this PCD token has been set. Secondly,
695 it provides a mechanism for the module which did the registration to intercept the set
696 operation and override the value been set if necessary. After the invocation of the
697 callback function, TokenData will be used by PCD service PEIM to modify the internal data
700 @param[in] CallBackGuid The PCD token GUID being set.
701 @param[in] CallBackToken The PCD token number being set.
702 @param[in, out] TokenData A pointer to the token data being set.
703 @param[in] TokenDataSize The size, in bytes, of the data being set.
710 (EFIAPI
*PCD_PPI_CALLBACK
) (
711 IN CONST EFI_GUID
*CallBackGuid
, OPTIONAL
712 IN UINTN CallBackToken
,
713 IN OUT VOID
*TokenData
,
714 IN UINTN TokenDataSize
720 Specifies a function to be called anytime the value of a designated token is changed.
722 @param[in] TokenNumber The PCD token number.
723 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
724 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
726 @retval EFI_SUCCESS The PCD service has successfully established a call event
727 for the CallBackToken requested.
728 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
733 (EFIAPI
*PCD_PPI_CALLBACK_ONSET
) (
734 IN CONST EFI_GUID
*Guid
, OPTIONAL
735 IN UINTN TokenNumber
,
736 IN PCD_PPI_CALLBACK CallBackFunction
742 Cancels a previously set callback function for a particular PCD token number.
744 @param[in] TokenNumber The PCD token number.
745 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
746 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
748 @retval EFI_SUCCESS The PCD service has successfully established a call event
749 for the CallBackToken requested.
750 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
755 (EFIAPI
*PCD_PPI_CANCEL_CALLBACK
) (
756 IN CONST EFI_GUID
*Guid
, OPTIONAL
757 IN UINTN TokenNumber
,
758 IN PCD_PPI_CALLBACK CallBackFunction
764 Retrieves the next valid PCD token for a given namespace.
766 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
767 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
768 If the input token namespace or token number does not exist on the platform, an error is
769 returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
770 have the pointer reference a TokenNumber value of 0. If the input token number is 0
771 and there is no valid token number for this token namespace, *TokenNumber will be
772 assigned to 0 and the function return EFI_SUCCESS. If the token number is the last valid
773 token number, *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
775 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
776 Or the input token number is already the last valid token number in the PCD database.
777 In the later case, *TokenNumber is updated with the value of 0.
778 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
783 (EFIAPI
*PCD_PPI_GET_NEXT_TOKEN
) (
784 IN CONST EFI_GUID
*Guid
, OPTIONAL
785 IN OUT UINTN
*TokenNumber
791 Retrieves the next valid PCD token namespace for a given namespace.
793 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known
794 token namespace from which the search will start. On output, it designates
795 the next valid token namespace on the platform. If the input token namespace
796 does not exist on the platform, an error is returned and the value of *Guid is
797 undefined. If *Guid is NULL, then the GUID of the first token space of the
798 current platform is assigned to *Guid the function return EFI_SUCCESS.
799 If *Guid is NULL and there is no namespace exist in the platform other than the default
800 (NULL) tokennamespace, *Guid is unchanged and the function return EFI_SUCCESS.
801 If this input token namespace is the last namespace on the platform,
802 *Guid will be assigned to NULL and the function return EFI_SUCCESS.
804 @retval EFI_SUCCESS The PCD service has retrieved the next valid token namespace.
805 Or the input token namespace is already the last valid token
806 number in the PCD database. In the later case, *Guid is updated
807 with the value of NULL. Or the input token name space is NULL and there
808 is no valid token namespace other than the default namespace (NULL).
809 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
814 (EFIAPI
*PCD_PPI_GET_NEXT_TOKENSPACE
) (
815 IN OUT CONST EFI_GUID
**Guid
821 // Interface structure for the PCD PPI
824 PCD_PPI_SET_SKU SetSku
;
830 PCD_PPI_GET_POINTER GetPtr
;
831 PCD_PPI_GET_BOOLEAN GetBool
;
832 PCD_PPI_GET_SIZE GetSize
;
834 PCD_PPI_GET_EX_8 Get8Ex
;
835 PCD_PPI_GET_EX_16 Get16Ex
;
836 PCD_PPI_GET_EX_32 Get32Ex
;
837 PCD_PPI_GET_EX_64 Get64Ex
;
838 PCD_PPI_GET_EX_POINTER GetPtrEx
;
839 PCD_PPI_GET_EX_BOOLEAN GetBoolEx
;
840 PCD_PPI_GET_EX_SIZE GetSizeEx
;
846 PCD_PPI_SET_POINTER SetPtr
;
847 PCD_PPI_SET_BOOLEAN SetBool
;
849 PCD_PPI_SET_EX_8 Set8Ex
;
850 PCD_PPI_SET_EX_16 Set16Ex
;
851 PCD_PPI_SET_EX_32 Set32Ex
;
852 PCD_PPI_SET_EX_64 Set64Ex
;
853 PCD_PPI_SET_EX_POINTER SetPtrEx
;
854 PCD_PPI_SET_EX_BOOLEAN SetBoolEx
;
856 PCD_PPI_CALLBACK_ONSET CallbackOnSet
;
857 PCD_PPI_CANCEL_CALLBACK CancelCallback
;
858 PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
859 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace
;
863 extern EFI_GUID gPcdPpiGuid
;