2 Platform Configuration Database (PCD) Protocol
4 Copyright (c) 2006, 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.
20 extern EFI_GUID gPcdPpiGuid
;
22 #define PCD_PPI_GUID \
23 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }
25 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
30 Sets the SKU value for subsequent calls to set or get PCD token values.
32 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
33 SetSku() is normally called only once by the system.
35 For each item (token), the database can hold a single value that applies to all SKUs,
36 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
37 SKU-specific values are called SKU enabled.
39 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
40 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
41 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
42 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
43 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
44 set for that Id, the results are unpredictable.
46 @param SkuId The SKU value that will be used when the PCD service will retrieve and
47 set values associated with a PCD token.
54 (EFIAPI
*PCD_PPI_SET_SKU
) (
61 Retrieves an 8-bit value for a given PCD token.
63 Retrieves the current byte-sized value for a PCD token number.
64 If the TokenNumber is invalid, the results are unpredictable.
66 @param TokenNumber The PCD token number.
68 @return The UINT8 value.
73 (EFIAPI
*PCD_PPI_GET8
) (
80 Retrieves an 16-bit value for a given PCD token.
82 Retrieves the current 16-bits value for a PCD token number.
83 If the TokenNumber is invalid, the results are unpredictable.
85 @param TokenNumber The PCD token number.
87 @return The UINT16 value.
92 (EFIAPI
*PCD_PPI_GET16
) (
99 Retrieves an 32-bit value for a given PCD token.
101 Retrieves the current 32-bits value for a PCD token number.
102 If the TokenNumber is invalid, the results are unpredictable.
104 @param TokenNumber The PCD token number.
106 @return The UINT32 value.
111 (EFIAPI
*PCD_PPI_GET32
) (
118 Retrieves an 64-bit value for a given PCD token.
120 Retrieves the current 64-bits value for a PCD token number.
121 If the TokenNumber is invalid, the results are unpredictable.
123 @param TokenNumber The PCD token number.
125 @return The UINT64 value.
130 (EFIAPI
*PCD_PPI_GET64
) (
137 Retrieves a pointer to a value for a given PCD token.
139 Retrieves the current pointer to the buffer for a PCD token number.
140 Do not make any assumptions about the alignment of the pointer that
141 is returned by this function call. If the TokenNumber is invalid,
142 the results are unpredictable.
144 @param TokenNumber The PCD token number.
146 @return The pointer to the buffer to be retrived.
151 (EFIAPI
*PCD_PPI_GET_POINTER
) (
158 Retrieves a Boolean value for a given PCD token.
160 Retrieves the current boolean value for a PCD token number.
161 Do not make any assumptions about the alignment of the pointer that
162 is returned by this function call. If the TokenNumber is invalid,
163 the results are unpredictable.
165 @param TokenNumber The PCD token number.
167 @return The Boolean value.
172 (EFIAPI
*PCD_PPI_GET_BOOLEAN
) (
179 Retrieves the size of the value for a given PCD token.
181 Retrieves the current size of a particular PCD token.
182 If the TokenNumber is invalid, the results are unpredictable.
184 @param TokenNumber The PCD token number.
186 @return The size of the value for the PCD token.
191 (EFIAPI
*PCD_PPI_GET_SIZE
) (
198 Retrieves an 8-bit value for a given PCD token.
200 Retrieves the 8-bit value of a particular PCD token.
201 If the TokenNumber is invalid or the token space
202 specified by Guid does not exist, the results are
205 @param Guid The token space for the token number.
206 @param TokenNumber The PCD token number.
208 @return The size 8-bit value for the PCD token.
213 (EFIAPI
*PCD_PPI_GET_EX_8
) (
214 IN CONST EFI_GUID
*Guid
,
221 Retrieves an 16-bit value for a given PCD token.
223 Retrieves the 16-bit value of a particular PCD token.
224 If the TokenNumber is invalid or the token space
225 specified by Guid does not exist, the results are
228 @param Guid The token space for the token number.
229 @param TokenNumber The PCD token number.
231 @return The size 16-bit value for the PCD token.
236 (EFIAPI
*PCD_PPI_GET_EX_16
) (
237 IN CONST EFI_GUID
*Guid
,
244 Retrieves an 32-bit value for a given PCD token.
246 Retrieves the 32-bit value of a particular PCD token.
247 If the TokenNumber is invalid or the token space
248 specified by Guid does not exist, the results are
251 @param Guid The token space for the token number.
252 @param TokenNumber The PCD token number.
254 @return The size 32-bit value for the PCD token.
259 (EFIAPI
*PCD_PPI_GET_EX_32
) (
260 IN CONST EFI_GUID
*Guid
,
267 Retrieves an 64-bit value for a given PCD token.
269 Retrieves the 64-bit value of a particular PCD token.
270 If the TokenNumber is invalid or the token space
271 specified by Guid does not exist, the results are
274 @param Guid The token space for the token number.
275 @param TokenNumber The PCD token number.
277 @return The size 64-bit value for the PCD token.
282 (EFIAPI
*PCD_PPI_GET_EX_64
) (
283 IN CONST EFI_GUID
*Guid
,
290 Retrieves a pointer to a value for a given PCD token.
292 Retrieves the current pointer to the buffer for a PCD token number.
293 Do not make any assumptions about the alignment of the pointer that
294 is returned by this function call. If the TokenNumber is invalid,
295 the results are unpredictable.
297 @param Guid The token space for the token number.
298 @param TokenNumber The PCD token number.
300 @return The pointer to the buffer to be retrived.
305 (EFIAPI
*PCD_PPI_GET_EX_POINTER
) (
306 IN CONST EFI_GUID
*Guid
,
313 Retrieves an Boolean value for a given PCD token.
315 Retrieves the Boolean value of a particular PCD token.
316 If the TokenNumber is invalid or the token space
317 specified by Guid does not exist, the results are
320 @param Guid The token space for the token number.
321 @param TokenNumber The PCD token number.
323 @return The size Boolean value for the PCD token.
328 (EFIAPI
*PCD_PPI_GET_EX_BOOLEAN
) (
329 IN CONST EFI_GUID
*Guid
,
336 Retrieves the size of the value for a given PCD token.
338 Retrieves the current size of a particular PCD token.
339 If the TokenNumber is invalid, the results are unpredictable.
341 @param Guid The token space for the token number.
342 @param TokenNumber The PCD token number.
344 @return The size of the value for the PCD token.
349 (EFIAPI
*PCD_PPI_GET_EX_SIZE
) (
350 IN CONST EFI_GUID
*Guid
,
357 Sets an 8-bit value for a given PCD token.
359 When the PCD service sets a value, it will check to ensure that the
360 size of the value being set is compatible with the Token's existing definition.
361 If it is not, an error will be returned.
363 @param TokenNumber The PCD token number.
364 @param Value The value to set for the PCD token.
366 @retval EFI_SUCCESS Procedure returned successfully.
367 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
368 being set was incompatible with a call to this function.
369 Use GetSize() to retrieve the size of the target data.
370 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
375 (EFIAPI
*PCD_PPI_SET8
) (
376 IN UINTN TokenNumber
,
383 Sets an 16-bit value for a given PCD token.
385 When the PCD service sets a value, it will check to ensure that the
386 size of the value being set is compatible with the Token's existing definition.
387 If it is not, an error will be returned.
389 @param TokenNumber The PCD token number.
390 @param Value The value to set for the PCD token.
392 @retval EFI_SUCCESS Procedure returned successfully.
393 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
394 being set was incompatible with a call to this function.
395 Use GetSize() to retrieve the size of the target data.
396 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
401 (EFIAPI
*PCD_PPI_SET16
) (
402 IN UINTN TokenNumber
,
409 Sets an 32-bit value for a given PCD token.
411 When the PCD service sets a value, it will check to ensure that the
412 size of the value being set is compatible with the Token's existing definition.
413 If it is not, an error will be returned.
415 @param TokenNumber The PCD token number.
416 @param Value The value to set for the PCD token.
418 @retval EFI_SUCCESS Procedure returned successfully.
419 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
420 being set was incompatible with a call to this function.
421 Use GetSize() to retrieve the size of the target data.
422 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
427 (EFIAPI
*PCD_PPI_SET32
) (
428 IN UINTN TokenNumber
,
435 Sets an 64-bit value for a given PCD token.
437 When the PCD service sets a value, it will check to ensure that the
438 size of the value being set is compatible with the Token's existing definition.
439 If it is not, an error will be returned.
441 @param TokenNumber The PCD token number.
442 @param Value The value to set for the PCD token.
444 @retval EFI_SUCCESS Procedure returned successfully.
445 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
446 being set was incompatible with a call to this function.
447 Use GetSize() to retrieve the size of the target data.
448 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
453 (EFIAPI
*PCD_PPI_SET64
) (
454 IN UINTN TokenNumber
,
462 Sets a value of a specified size for a given PCD token.
464 When the PCD service sets a value, it will check to ensure that the
465 size of the value being set is compatible with the Token's existing definition.
466 If it is not, an error will be returned.
468 @param TokenNumber The PCD token number.
469 @param SizeOfBuffer A pointer to the length of the value being set for the PCD token.
470 On input, if the SizeOfValue is greater than the maximum size supported
471 for this TokenNumber then the output value of SizeOfValue will reflect
472 the maximum size supported for this TokenNumber.
473 @param Buffer The buffer to set for the PCD token.
475 @retval EFI_SUCCESS Procedure returned successfully.
476 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
477 being set was incompatible with a call to this function.
478 Use GetSize() to retrieve the size of the target data.
479 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
484 (EFIAPI
*PCD_PPI_SET_POINTER
) (
485 IN UINTN TokenNumber
,
486 IN OUT UINTN
*SizeOfBuffer
,
493 Sets an Boolean value for a given PCD token.
495 When the PCD service sets a value, it will check to ensure that the
496 size of the value being set is compatible with the Token's existing definition.
497 If it is not, an error will be returned.
499 @param TokenNumber The PCD token number.
500 @param Value The value to set for the PCD token.
502 @retval EFI_SUCCESS Procedure returned successfully.
503 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
504 being set was incompatible with a call to this function.
505 Use GetSize() to retrieve the size of the target data.
506 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
511 (EFIAPI
*PCD_PPI_SET_BOOLEAN
) (
512 IN UINTN TokenNumber
,
519 Sets an 8-bit value for a given PCD token.
521 When the PCD service sets a value, it will check to ensure that the
522 size of the value being set is compatible with the Token's existing definition.
523 If it is not, an error will be returned.
525 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
526 @param TokenNumber The PCD token number.
527 @param Value The value to set for the PCD token.
529 @retval EFI_SUCCESS Procedure returned successfully.
530 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
531 being set was incompatible with a call to this function.
532 Use GetSize() to retrieve the size of the target data.
533 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
538 (EFIAPI
*PCD_PPI_SET_EX_8
) (
539 IN CONST EFI_GUID
*Guid
,
540 IN UINTN TokenNumber
,
547 Sets an 16-bit value for a given PCD token.
549 When the PCD service sets a value, it will check to ensure that the
550 size of the value being set is compatible with the Token's existing definition.
551 If it is not, an error will be returned.
553 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
554 @param TokenNumber The PCD token number.
555 @param Value The value to set for the PCD token.
557 @retval EFI_SUCCESS Procedure returned successfully.
558 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
559 being set was incompatible with a call to this function.
560 Use GetSize() to retrieve the size of the target data.
561 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
566 (EFIAPI
*PCD_PPI_SET_EX_16
) (
567 IN CONST EFI_GUID
*Guid
,
568 IN UINTN TokenNumber
,
575 Sets an 32-bit value for a given PCD token.
577 When the PCD service sets a value, it will check to ensure that the
578 size of the value being set is compatible with the Token's existing definition.
579 If it is not, an error will be returned.
581 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
582 @param TokenNumber The PCD token number.
583 @param Value The value to set for the PCD token.
585 @retval EFI_SUCCESS Procedure returned successfully.
586 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
587 being set was incompatible with a call to this function.
588 Use GetSize() to retrieve the size of the target data.
589 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
594 (EFIAPI
*PCD_PPI_SET_EX_32
) (
595 IN CONST EFI_GUID
*Guid
,
596 IN UINTN TokenNumber
,
603 Sets an 64-bit value for a given PCD token.
605 When the PCD service sets a value, it will check to ensure that the
606 size of the value being set is compatible with the Token's existing definition.
607 If it is not, an error will be returned.
609 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
610 @param TokenNumber The PCD token number.
611 @param Value The value to set for the PCD token.
613 @retval EFI_SUCCESS Procedure returned successfully.
614 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
615 being set was incompatible with a call to this function.
616 Use GetSize() to retrieve the size of the target data.
617 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
622 (EFIAPI
*PCD_PPI_SET_EX_64
) (
623 IN CONST EFI_GUID
*Guid
,
624 IN UINTN TokenNumber
,
631 Sets a value of a specified size for a given PCD token.
633 When the PCD service sets a value, it will check to ensure that the
634 size of the value being set is compatible with the Token's existing definition.
635 If it is not, an error will be returned.
637 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
638 @param TokenNumber The PCD token number.
639 @param SizeOfBuffer A pointer to the length of the value being set for the PCD token.
640 On input, if the SizeOfValue is greater than the maximum size supported
641 for this TokenNumber then the output value of SizeOfValue will reflect
642 the maximum size supported for this TokenNumber.
643 @param Buffer The buffer to set for the PCD token.
645 @retval EFI_SUCCESS Procedure returned successfully.
646 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
647 being set was incompatible with a call to this function.
648 Use GetSize() to retrieve the size of the target data.
649 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
654 (EFIAPI
*PCD_PPI_SET_EX_POINTER
) (
655 IN CONST EFI_GUID
*Guid
,
656 IN UINTN TokenNumber
,
657 IN OUT UINTN
*SizeOfBuffer
,
664 Sets an Boolean value for a given PCD token.
666 When the PCD service sets a value, it will check to ensure that the
667 size of the value being set is compatible with the Token's existing definition.
668 If it is not, an error will be returned.
670 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
671 @param TokenNumber The PCD token number.
672 @param Value The value to set for the PCD token.
674 @retval EFI_SUCCESS Procedure returned successfully.
675 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
676 being set was incompatible with a call to this function.
677 Use GetSize() to retrieve the size of the target data.
678 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
683 (EFIAPI
*PCD_PPI_SET_EX_BOOLEAN
) (
684 IN CONST EFI_GUID
*Guid
,
685 IN UINTN TokenNumber
,
692 Callback on SET function prototype definition.
694 @param CallBackGuid The PCD token GUID being set.
695 @param CallBackToken The PCD token number being set.
696 @param TokenData A pointer to the token data being set.
697 @param TokenDataSize The size, in bytes, of the data being set.
704 (EFIAPI
*PCD_PPI_CALLBACK
) (
705 IN CONST EFI_GUID
*CallBackGuid
, OPTIONAL
706 IN UINTN CallBackToken
,
707 IN OUT VOID
*TokenData
,
708 IN UINTN TokenDataSize
714 Specifies a function to be called anytime the value of a designated token is changed.
716 @param TokenNumber The PCD token number.
717 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
718 @param CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
720 @retval EFI_SUCCESS The PCD service has successfully established a call event
721 for the CallBackToken requested.
722 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
727 (EFIAPI
*PCD_PPI_CALLBACK_ONSET
) (
728 IN UINTN TokenNumber
,
729 IN CONST EFI_GUID
*Guid
, OPTIONAL
730 IN PCD_PPI_CALLBACK CallBackFunction
736 Cancels a previously set callback function for a particular PCD token number.
738 @param TokenNumber The PCD token number.
739 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
740 @param CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
742 @retval EFI_SUCCESS The PCD service has successfully established a call event
743 for the CallBackToken requested.
744 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
749 (EFIAPI
*PCD_PPI_CANCEL_CALLBACK
) (
750 IN UINTN TokenNumber
,
751 IN CONST EFI_GUID
*Guid
, OPTIONAL
752 IN PCD_PPI_CALLBACK CallBackFunction
758 Retrieves the next valid PCD token for a given namespace.
760 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
761 @param TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
762 To retrieve the "first" token, have the pointer reference a TokenNumber value of 0.
764 @retval EFI_SUCCESS The PCD service retrieved the value requested.
765 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
770 (EFIAPI
*PCD_PPI_GET_NEXT_TOKEN
) (
771 IN CONST EFI_GUID
*Guid
, OPTIONAL
772 IN OUT UINTN
*TokenNumber
778 Retrieves the next valid PCD token namespace for a given namespace.
780 @param Guid An indirect pointer to EFI_GUID. On input it designates a known
781 token namespace from which the search will start. On output,
782 it designates the next valid token namespace on the platform.
783 If *Guid is NULL, then the GUID of the first token space of the current platform is returned.
784 If this input token namespace is the last tokenspace on the platform,
785 *Guid will be assigned to NULL and the function return EFI_SUCCESS.
786 If the search cannot locate the input token namespace, an error is returned and
787 the value of *Guid is undefined.
789 @retval EFI_SUCCESS The PCD service retrieved the value requested.
790 @retval EFI_NOT_FOUND The PCD service could not find the input token namespace.
795 (EFIAPI
*PCD_PPI_GET_NEXT_TOKENSPACE
) (
796 IN OUT CONST EFI_GUID
**Guid
802 // Interface structure for the PCD PPI
805 PCD_PPI_SET_SKU SetSku
;
811 PCD_PPI_GET_POINTER GetPtr
;
812 PCD_PPI_GET_BOOLEAN GetBool
;
813 PCD_PPI_GET_SIZE GetSize
;
815 PCD_PPI_GET_EX_8 Get8Ex
;
816 PCD_PPI_GET_EX_16 Get16Ex
;
817 PCD_PPI_GET_EX_32 Get32Ex
;
818 PCD_PPI_GET_EX_64 Get64Ex
;
819 PCD_PPI_GET_EX_POINTER GetPtrEx
;
820 PCD_PPI_GET_EX_BOOLEAN GetBoolEx
;
821 PCD_PPI_GET_EX_SIZE GetSizeEx
;
827 PCD_PPI_SET_POINTER SetPtr
;
828 PCD_PPI_SET_BOOLEAN SetBool
;
830 PCD_PPI_SET_EX_8 Set8Ex
;
831 PCD_PPI_SET_EX_16 Set16Ex
;
832 PCD_PPI_SET_EX_32 Set32Ex
;
833 PCD_PPI_SET_EX_64 Set64Ex
;
834 PCD_PPI_SET_EX_POINTER SetPtrEx
;
835 PCD_PPI_SET_EX_BOOLEAN SetBoolEx
;
837 PCD_PPI_CALLBACK_ONSET CallbackOnSet
;
838 PCD_PPI_CANCEL_CALLBACK CancelCallback
;
839 PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
840 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace
;