2 Platform Configuration Database (PCD) PPI
4 Copyright (c) 2006 - 2008, 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.
18 #define PCD_PPI_GUID \
19 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }
21 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
25 Sets the SKU value for subsequent calls to set or get PCD token values.
27 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
28 SetSku() is normally called only once by the system.
30 For each item (token), the database can hold a single value that applies to all SKUs,
31 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
32 SKU-specific values are called SKU enabled.
34 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
35 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
36 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
37 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
38 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
39 set for that Id, the results are unpredictable.
41 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
42 set values associated with a PCD token.
49 (EFIAPI
*PCD_PPI_SET_SKU
)(
56 Retrieves an 8-bit value for a given PCD token.
58 Retrieves the current byte-sized value for a PCD token number.
59 If the TokenNumber is invalid, the results are unpredictable.
61 @param[in] TokenNumber The PCD token number.
63 @return The UINT8 value.
68 (EFIAPI
*PCD_PPI_GET8
)(
75 Retrieves a 16-bit value for a given PCD token.
77 Retrieves the current 16-bits value for a PCD token number.
78 If the TokenNumber is invalid, the results are unpredictable.
80 @param[in] TokenNumber The PCD token number.
82 @return The UINT16 value.
87 (EFIAPI
*PCD_PPI_GET16
)(
94 Retrieves a 32-bit value for a given PCD token.
96 Retrieves the current 32-bits value for a PCD token number.
97 If the TokenNumber is invalid, the results are unpredictable.
99 @param[in] TokenNumber The PCD token number.
101 @return The UINT32 value.
106 (EFIAPI
*PCD_PPI_GET32
)(
113 Retrieves a 64-bit value for a given PCD token.
115 Retrieves the current 64-bits value for a PCD token number.
116 If the TokenNumber is invalid, the results are unpredictable.
118 @param[in] TokenNumber The PCD token number.
120 @return The UINT64 value.
125 (EFIAPI
*PCD_PPI_GET64
)(
132 Retrieves a pointer to a value for a given PCD token.
134 Retrieves the current pointer to the buffer for a PCD token number.
135 Do not make any assumptions about the alignment of the pointer that
136 is returned by this function call. If the TokenNumber is invalid,
137 the results are unpredictable.
139 @param[in] TokenNumber The PCD token number.
141 @return The pointer to the buffer to be retrived.
146 (EFIAPI
*PCD_PPI_GET_POINTER
)(
153 Retrieves a Boolean value for a given PCD token.
155 Retrieves the current boolean value for a PCD token number.
156 Do not make any assumptions about the alignment of the pointer that
157 is returned by this function call. If the TokenNumber is invalid,
158 the results are unpredictable.
160 @param[in] TokenNumber The PCD token number.
162 @return The Boolean value.
167 (EFIAPI
*PCD_PPI_GET_BOOLEAN
)(
174 Retrieves the size of the value for a given PCD token.
176 Retrieves the current size of a particular PCD token.
177 If the TokenNumber is invalid, the results are unpredictable.
179 @param[in] TokenNumber The PCD token number.
181 @return The size of the value for the PCD token.
186 (EFIAPI
*PCD_PPI_GET_SIZE
)(
193 Retrieves an 8-bit value for a given PCD token and token space.
195 Retrieves the 8-bit value of a particular PCD token.
196 If the TokenNumber is invalid or the token space
197 specified by Guid does not exist, the results are
200 @param[in] Guid The token space for the token number.
201 @param[in] TokenNumber The PCD token number.
203 @return The size 8-bit value for the PCD token.
208 (EFIAPI
*PCD_PPI_GET_EX_8
)(
209 IN CONST EFI_GUID
*Guid
,
216 Retrieves a 16-bit value for a given PCD token and token space.
218 Retrieves the 16-bit value of a particular PCD token.
219 If the TokenNumber is invalid or the token space
220 specified by Guid does not exist, the results are
223 @param[in] Guid The token space for the token number.
224 @param[in] TokenNumber The PCD token number.
226 @return The size 16-bit value for the PCD token.
231 (EFIAPI
*PCD_PPI_GET_EX_16
)(
232 IN CONST EFI_GUID
*Guid
,
239 Retrieves a 32-bit value for a given PCD token and token space.
241 Retrieves the 32-bit value of a particular PCD token.
242 If the TokenNumber is invalid or the token space
243 specified by Guid does not exist, the results are
246 @param[in] Guid The token space for the token number.
247 @param[in] TokenNumber The PCD token number.
249 @return The size 32-bit value for the PCD token.
254 (EFIAPI
*PCD_PPI_GET_EX_32
)(
255 IN CONST EFI_GUID
*Guid
,
262 Retrieves a 64-bit value for a given PCD token and token space.
264 Retrieves the 64-bit value of a particular PCD token.
265 If the TokenNumber is invalid or the token space
266 specified by Guid does not exist, the results are
269 @param[in] Guid The token space for the token number.
270 @param[in] TokenNumber The PCD token number.
272 @return The size 64-bit value for the PCD token.
277 (EFIAPI
*PCD_PPI_GET_EX_64
)(
278 IN CONST EFI_GUID
*Guid
,
285 Retrieves a pointer to a value for a given PCD token and token space.
287 Retrieves the current pointer to the buffer for a PCD token number.
288 Do not make any assumptions about the alignment of the pointer that
289 is returned by this function call. If the TokenNumber is invalid,
290 the results are unpredictable.
292 @param[in] Guid The token space for the token number.
293 @param[in] TokenNumber The PCD token number.
295 @return The pointer to the buffer to be retrived.
300 (EFIAPI
*PCD_PPI_GET_EX_POINTER
)(
301 IN CONST EFI_GUID
*Guid
,
308 Retrieves an Boolean value for a given PCD token and token space.
310 Retrieves the Boolean value of a particular PCD token.
311 If the TokenNumber is invalid or the token space
312 specified by Guid does not exist, the results are
315 @param[in] Guid The token space for the token number.
316 @param[in] TokenNumber The PCD token number.
318 @return The size Boolean value for the PCD token.
323 (EFIAPI
*PCD_PPI_GET_EX_BOOLEAN
)(
324 IN CONST EFI_GUID
*Guid
,
331 Retrieves the size of the value for a given PCD token and token space.
333 Retrieves the current size of a particular PCD token.
334 If the TokenNumber is invalid, the results are unpredictable.
336 @param[in] Guid The token space for the token number.
337 @param[in] TokenNumber The PCD token number.
339 @return The size of the value for the PCD token.
344 (EFIAPI
*PCD_PPI_GET_EX_SIZE
)(
345 IN CONST EFI_GUID
*Guid
,
352 Sets an 8-bit value for a given PCD token.
354 When the PCD service sets a value, it will check to ensure that the
355 size of the value being set is compatible with the Token's existing definition.
356 If it is not, an error will be returned.
358 @param[in] TokenNumber The PCD token number.
359 @param[in] Value The value to set for the PCD token.
361 @retval EFI_SUCCESS Procedure returned successfully.
362 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
363 being set was incompatible with a call to this function.
364 Use GetSize() to retrieve the size of the target data.
365 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
370 (EFIAPI
*PCD_PPI_SET8
)(
371 IN UINTN TokenNumber
,
378 Sets a 16-bit value for a given PCD token.
380 When the PCD service sets a value, it will check to ensure that the
381 size of the value being set is compatible with the Token's existing definition.
382 If it is not, an error will be returned.
384 @param[in] TokenNumber The PCD token number.
385 @param[in] Value The value to set for the PCD token.
387 @retval EFI_SUCCESS Procedure returned successfully.
388 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
389 being set was incompatible with a call to this function.
390 Use GetSize() to retrieve the size of the target data.
391 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
396 (EFIAPI
*PCD_PPI_SET16
)(
397 IN UINTN TokenNumber
,
404 Sets a 32-bit value for a given PCD token.
406 When the PCD service sets a value, it will check to ensure that the
407 size of the value being set is compatible with the Token's existing definition.
408 If it is not, an error will be returned.
410 @param[in] TokenNumber The PCD token number.
411 @param[in] Value The value to set for the PCD token.
413 @retval EFI_SUCCESS Procedure returned successfully.
414 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
415 being set was incompatible with a call to this function.
416 Use GetSize() to retrieve the size of the target data.
417 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
422 (EFIAPI
*PCD_PPI_SET32
)(
423 IN UINTN TokenNumber
,
430 Sets a 64-bit value for a given PCD token.
432 When the PCD service sets a value, it will check to ensure that the
433 size of the value being set is compatible with the Token's existing definition.
434 If it is not, an error will be returned.
436 @param[in] TokenNumber The PCD token number.
437 @param[in] Value The value to set for the PCD token.
439 @retval EFI_SUCCESS Procedure returned successfully.
440 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
441 being set was incompatible with a call to this function.
442 Use GetSize() to retrieve the size of the target data.
443 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
448 (EFIAPI
*PCD_PPI_SET64
)(
449 IN UINTN TokenNumber
,
454 Sets a value of a specified size for a given PCD token.
456 When the PCD service sets a value, it will check to ensure that the
457 size of the value being set is compatible with the Token's existing definition.
458 If it is not, an error will be returned.
460 @param[in] TokenNumber The PCD token number.
461 @param[in, out] SizeOfValue A pointer to the length of the value being set for the PCD token.
462 On input, if the SizeOfValue is greater than the maximum size supported
463 for this TokenNumber then the output value of SizeOfValue will reflect
464 the maximum size supported for this TokenNumber.
465 @param[in] Buffer The buffer to set for the PCD token.
467 @retval EFI_SUCCESS Procedure returned successfully.
468 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
469 being set was incompatible with a call to this function.
470 Use GetSize() to retrieve the size of the target data.
471 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
476 (EFIAPI
*PCD_PPI_SET_POINTER
)(
477 IN UINTN TokenNumber
,
478 IN OUT UINTN
*SizeOfValue
,
483 Sets an Boolean value for a given PCD token.
485 When the PCD service sets a value, it will check to ensure that the
486 size of the value being set is compatible with the Token's existing definition.
487 If it is not, an error will be returned.
489 @param[in] TokenNumber The PCD token number.
490 @param[in] Value The value to set for the PCD token.
492 @retval EFI_SUCCESS Procedure returned successfully.
493 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
494 being set was incompatible with a call to this function.
495 Use GetSize() to retrieve the size of the target data.
496 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
501 (EFIAPI
*PCD_PPI_SET_BOOLEAN
)(
502 IN UINTN TokenNumber
,
509 Sets an 8-bit value for a given PCD token.
511 When the PCD service sets a value, it will check to ensure that the
512 size of the value being set is compatible with the Token's existing definition.
513 If it is not, an error will be returned.
515 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
516 @param[in] TokenNumber The PCD token number.
517 @param[in] Value The value to set for the PCD token.
519 @retval EFI_SUCCESS Procedure returned successfully.
520 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
521 being set was incompatible with a call to this function.
522 Use GetSize() to retrieve the size of the target data.
523 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
528 (EFIAPI
*PCD_PPI_SET_EX_8
)(
529 IN CONST EFI_GUID
*Guid
,
530 IN UINTN TokenNumber
,
537 Sets a 16-bit value for a given PCD token.
539 When the PCD service sets a value, it will check to ensure that the
540 size of the value being set is compatible with the Token's existing definition.
541 If it is not, an error will be returned.
543 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
544 @param[in] TokenNumber The PCD token number.
545 @param[in] Value The value to set for the PCD token.
547 @retval EFI_SUCCESS Procedure returned successfully.
548 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
549 being set was incompatible with a call to this function.
550 Use GetSize() to retrieve the size of the target data.
551 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
556 (EFIAPI
*PCD_PPI_SET_EX_16
)(
557 IN CONST EFI_GUID
*Guid
,
558 IN UINTN TokenNumber
,
565 Sets a 32-bit value for a given PCD token.
567 When the PCD service sets a value, it will check to ensure that the
568 size of the value being set is compatible with the Token's existing definition.
569 If it is not, an error will be returned.
571 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
572 @param[in] TokenNumber The PCD token number.
573 @param[in] Value The value to set for the PCD token.
575 @retval EFI_SUCCESS Procedure returned successfully.
576 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
577 being set was incompatible with a call to this function.
578 Use GetSize() to retrieve the size of the target data.
579 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
584 (EFIAPI
*PCD_PPI_SET_EX_32
)(
585 IN CONST EFI_GUID
*Guid
,
586 IN UINTN TokenNumber
,
593 Sets a 64-bit value for a given PCD token.
595 When the PCD service sets a value, it will check to ensure that the
596 size of the value being set is compatible with the Token's existing definition.
597 If it is not, an error will be returned.
599 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
600 @param[in] TokenNumber The PCD token number.
601 @param[in] Value The value to set for the PCD token.
603 @retval EFI_SUCCESS Procedure returned successfully.
604 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
605 being set was incompatible with a call to this function.
606 Use GetSize() to retrieve the size of the target data.
607 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
612 (EFIAPI
*PCD_PPI_SET_EX_64
)(
613 IN CONST EFI_GUID
*Guid
,
614 IN UINTN TokenNumber
,
621 Sets a value of a specified size for a given PCD token.
623 When the PCD service sets a value, it will check to ensure that the
624 size of the value being set is compatible with the Token's existing definition.
625 If it is not, an error will be returned.
627 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
628 @param[in] TokenNumber The PCD token number.
629 @param[in, out] SizeOfValue A pointer to the length of the value being set for the PCD token.
630 On input, if the SizeOfValue is greater than the maximum size supported
631 for this TokenNumber then the output value of SizeOfValue will reflect
632 the maximum size supported for this TokenNumber.
633 @param[in] Buffer The buffer to set for the PCD token.
635 @retval EFI_SUCCESS Procedure returned successfully.
636 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
637 being set was incompatible with a call to this function.
638 Use GetSize() to retrieve the size of the target data.
639 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
644 (EFIAPI
*PCD_PPI_SET_EX_POINTER
)(
645 IN CONST EFI_GUID
*Guid
,
646 IN UINTN TokenNumber
,
647 IN OUT UINTN
*SizeOfValue
,
652 Sets an Boolean value for a given PCD token.
654 When the PCD service sets a value, it will check to ensure that the
655 size of the value being set is compatible with the Token's existing definition.
656 If it is not, an error will be returned.
658 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
659 @param[in] TokenNumber The PCD token number.
660 @param[in] Value The value to set for the PCD token.
662 @retval EFI_SUCCESS Procedure returned successfully.
663 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
664 being set was incompatible with a call to this function.
665 Use GetSize() to retrieve the size of the target data.
666 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
671 (EFIAPI
*PCD_PPI_SET_EX_BOOLEAN
)(
672 IN CONST EFI_GUID
*Guid
,
673 IN UINTN TokenNumber
,
680 Callback on SET function prototype definition.
682 This notification function serves two purposes. Firstly, it notifies the module
683 which did the registration that the value of this PCD token has been set. Secondly,
684 it provides a mechanism for the module which did the registration to intercept the set
685 operation and override the value been set if necessary. After the invocation of the
686 callback function, TokenData will be used by PCD service PEIM to modify the internal data
689 @param[in] CallBackGuid The PCD token GUID being set.
690 @param[in] CallBackToken The PCD token number being set.
691 @param[in, out] TokenData A pointer to the token data being set.
692 @param[in] TokenDataSize The size, in bytes, of the data being set.
699 (EFIAPI
*PCD_PPI_CALLBACK
)(
700 IN CONST EFI_GUID
*CallBackGuid
, OPTIONAL
701 IN UINTN CallBackToken
,
702 IN OUT VOID
*TokenData
,
703 IN UINTN TokenDataSize
709 Specifies a function to be called anytime the value of a designated token is changed.
711 @param[in] TokenNumber The PCD token number.
712 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
713 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
715 @retval EFI_SUCCESS The PCD service has successfully established a call event
716 for the CallBackToken requested.
717 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
722 (EFIAPI
*PCD_PPI_CALLBACK_ONSET
)(
723 IN CONST EFI_GUID
*Guid
, OPTIONAL
724 IN UINTN TokenNumber
,
725 IN PCD_PPI_CALLBACK CallBackFunction
731 Cancels a previously set callback function for a particular PCD token number.
733 @param[in] TokenNumber The PCD token number.
734 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
735 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
737 @retval EFI_SUCCESS The PCD service has successfully established a call event
738 for the CallBackToken requested.
739 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
744 (EFIAPI
*PCD_PPI_CANCEL_CALLBACK
)(
745 IN CONST EFI_GUID
*Guid
, OPTIONAL
746 IN UINTN TokenNumber
,
747 IN PCD_PPI_CALLBACK CallBackFunction
753 Retrieves the next valid PCD token for a given namespace.
755 If the input token namespace or token number does not exist on the platform, an error is
756 returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
757 have the pointer reference a TokenNumber value of 0.
758 If the input token number is 0 and there is no valid token number for this token namespace,
759 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
760 If the token number is the last valid token number, *TokenNumber will be assigned to 0 and
761 the function return EFI_SUCCESS.
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.
767 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
768 Or the input token number is already the last valid token number in the PCD database.
769 In the later case, *TokenNumber is updated with the value of 0.
770 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
775 (EFIAPI
*PCD_PPI_GET_NEXT_TOKEN
)(
776 IN CONST EFI_GUID
*Guid
, OPTIONAL
777 IN OUT UINTN
*TokenNumber
783 Retrieves the next valid PCD token namespace for a given namespace.
785 If *Guid is NULL, then the GUID of the first token space of the
786 current platform is assigned to *Guid the function return EFI_SUCCESS.
787 If *Guid is NULL and there is no namespace exist in the platform other than the default
788 (NULL) tokennamespace, *Guid is unchanged and the function return EFI_SUCCESS.
789 If this input token namespace is the last namespace on the platform,
790 *Guid will be assigned to NULL and the function return EFI_SUCCESS.
792 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known
793 token namespace from which the search will start. On output, it designates
794 the next valid token namespace on the platform. If the input token namespace
795 does not exist on the platform, an error is returned and the value of *Guid is
798 @retval EFI_SUCCESS The PCD service has retrieved the next valid token namespace.
799 Or the input token namespace is already the last valid token
800 number in the PCD database. In the later case, *Guid is updated
801 with the value of NULL. Or the input token name space is NULL and there
802 is no valid token namespace other than the default namespace (NULL).
803 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
808 (EFIAPI
*PCD_PPI_GET_NEXT_TOKENSPACE
)(
809 IN OUT CONST EFI_GUID
**Guid
815 /// This service abstracts the ability to set/get Platform Configuration Database (PCD).
818 PCD_PPI_SET_SKU SetSku
;
824 PCD_PPI_GET_POINTER GetPtr
;
825 PCD_PPI_GET_BOOLEAN GetBool
;
826 PCD_PPI_GET_SIZE GetSize
;
828 PCD_PPI_GET_EX_8 Get8Ex
;
829 PCD_PPI_GET_EX_16 Get16Ex
;
830 PCD_PPI_GET_EX_32 Get32Ex
;
831 PCD_PPI_GET_EX_64 Get64Ex
;
832 PCD_PPI_GET_EX_POINTER GetPtrEx
;
833 PCD_PPI_GET_EX_BOOLEAN GetBoolEx
;
834 PCD_PPI_GET_EX_SIZE GetSizeEx
;
840 PCD_PPI_SET_POINTER SetPtr
;
841 PCD_PPI_SET_BOOLEAN SetBool
;
843 PCD_PPI_SET_EX_8 Set8Ex
;
844 PCD_PPI_SET_EX_16 Set16Ex
;
845 PCD_PPI_SET_EX_32 Set32Ex
;
846 PCD_PPI_SET_EX_64 Set64Ex
;
847 PCD_PPI_SET_EX_POINTER SetPtrEx
;
848 PCD_PPI_SET_EX_BOOLEAN SetBoolEx
;
850 PCD_PPI_CALLBACK_ONSET CallbackOnSet
;
851 PCD_PPI_CANCEL_CALLBACK CancelCallback
;
852 PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
853 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace
;
857 extern EFI_GUID gPcdPpiGuid
;