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 gPcdProtocolGuid
;
22 #define PCD_PROTOCOL_GUID \
23 { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }
25 #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 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_PROTOCOL_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 TokenNumber The PCD token number.
67 @return The UINT8 value.
72 (EFIAPI
*PCD_PROTOCOL_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 TokenNumber The PCD token number.
86 @return The UINT16 value.
91 (EFIAPI
*PCD_PROTOCOL_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 TokenNumber The PCD token number.
105 @return The UINT32 value.
110 (EFIAPI
*PCD_PROTOCOL_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 TokenNumber The PCD token number.
124 @return The UINT64 value.
129 (EFIAPI
*PCD_PROTOCOL_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 TokenNumber The PCD token number.
145 @return The pointer to the buffer to be retrived.
150 (EFIAPI
*PCD_PROTOCOL_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 TokenNumber The PCD token number.
166 @return The Boolean value.
171 (EFIAPI
*PCD_PROTOCOL_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 TokenNumber The PCD token number.
185 @return The size of the value for the PCD token.
190 (EFIAPI
*PCD_PROTOCOL_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 Guid The token space for the token number.
205 @param TokenNumber The PCD token number.
207 @return The size 8-bit value for the PCD token.
212 (EFIAPI
*PCD_PROTOCOL_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 Guid The token space for the token number.
228 @param TokenNumber The PCD token number.
230 @return The size 16-bit value for the PCD token.
235 (EFIAPI
*PCD_PROTOCOL_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 Guid The token space for the token number.
251 @param TokenNumber The PCD token number.
253 @return The size 32-bit value for the PCD token.
257 (EFIAPI
*PCD_PROTOCOL_GET_EX_32
) (
258 IN CONST EFI_GUID
*Guid
,
265 Retrieves an 64-bit value for a given PCD token.
267 Retrieves the 64-bit value of a particular PCD token.
268 If the TokenNumber is invalid or the token space
269 specified by Guid does not exist, the results are
272 @param Guid The token space for the token number.
273 @param TokenNumber The PCD token number.
275 @return The size 64-bit value for the PCD token.
280 (EFIAPI
*PCD_PROTOCOL_GET_EX_64
) (
281 IN CONST EFI_GUID
*Guid
,
288 Retrieves a pointer to a value for a given PCD token.
290 Retrieves the current pointer to the buffer for a PCD token number.
291 Do not make any assumptions about the alignment of the pointer that
292 is returned by this function call. If the TokenNumber is invalid,
293 the results are unpredictable.
295 @param Guid The token space for the token number.
296 @param TokenNumber The PCD token number.
298 @return The pointer to the buffer to be retrived.
303 (EFIAPI
*PCD_PROTOCOL_GET_EX_POINTER
) (
304 IN CONST EFI_GUID
*Guid
,
311 Retrieves an Boolean value for a given PCD token.
313 Retrieves the Boolean value of a particular PCD token.
314 If the TokenNumber is invalid or the token space
315 specified by Guid does not exist, the results are
318 @param Guid The token space for the token number.
319 @param TokenNumber The PCD token number.
321 @return The size Boolean value for the PCD token.
326 (EFIAPI
*PCD_PROTOCOL_GET_EX_BOOLEAN
) (
327 IN CONST EFI_GUID
*Guid
,
334 Retrieves the size of the value for a given PCD token.
336 Retrieves the current size of a particular PCD token.
337 If the TokenNumber is invalid, the results are unpredictable.
339 @param Guid The token space for the token number.
340 @param TokenNumber The PCD token number.
342 @return The size of the value for the PCD token.
347 (EFIAPI
*PCD_PROTOCOL_GET_EX_SIZE
) (
348 IN CONST EFI_GUID
*Guid
,
355 Sets an 8-bit value for a given PCD token.
357 When the PCD service sets a value, it will check to ensure that the
358 size of the value being set is compatible with the Token's existing definition.
359 If it is not, an error will be returned.
361 @param TokenNumber The PCD token number.
362 @param Value The value to set for the PCD token.
364 @retval EFI_SUCCESS Procedure returned successfully.
365 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
366 being set was incompatible with a call to this function.
367 Use GetSize() to retrieve the size of the target data.
368 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
373 (EFIAPI
*PCD_PROTOCOL_SET8
) (
374 IN UINTN TokenNumber
,
381 Sets an 16-bit value for a given PCD token.
383 When the PCD service sets a value, it will check to ensure that the
384 size of the value being set is compatible with the Token's existing definition.
385 If it is not, an error will be returned.
387 @param TokenNumber The PCD token number.
388 @param Value The value to set for the PCD token.
390 @retval EFI_SUCCESS Procedure returned successfully.
391 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
392 being set was incompatible with a call to this function.
393 Use GetSize() to retrieve the size of the target data.
394 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
399 (EFIAPI
*PCD_PROTOCOL_SET16
) (
400 IN UINTN TokenNumber
,
407 Sets an 32-bit value for a given PCD token.
409 When the PCD service sets a value, it will check to ensure that the
410 size of the value being set is compatible with the Token's existing definition.
411 If it is not, an error will be returned.
413 @param TokenNumber The PCD token number.
414 @param Value The value to set for the PCD token.
416 @retval EFI_SUCCESS Procedure returned successfully.
417 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
418 being set was incompatible with a call to this function.
419 Use GetSize() to retrieve the size of the target data.
420 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
425 (EFIAPI
*PCD_PROTOCOL_SET32
) (
426 IN UINTN TokenNumber
,
433 Sets an 64-bit value for a given PCD token.
435 When the PCD service sets a value, it will check to ensure that the
436 size of the value being set is compatible with the Token's existing definition.
437 If it is not, an error will be returned.
439 @param TokenNumber The PCD token number.
440 @param Value The value to set for the PCD token.
442 @retval EFI_SUCCESS Procedure returned successfully.
443 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
444 being set was incompatible with a call to this function.
445 Use GetSize() to retrieve the size of the target data.
446 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
451 (EFIAPI
*PCD_PROTOCOL_SET64
) (
452 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 TokenNumber The PCD token number.
466 @param 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 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_PROTOCOL_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 TokenNumber The PCD token number.
497 @param 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_PROTOCOL_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 Guid The 128-bit unique value that designates the namespace from which to extract the value.
523 @param TokenNumber The PCD token number.
524 @param 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_PROTOCOL_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 Guid The 128-bit unique value that designates the namespace from which to extract the value.
551 @param TokenNumber The PCD token number.
552 @param 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_PROTOCOL_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 Guid The 128-bit unique value that designates the namespace from which to extract the value.
579 @param TokenNumber The PCD token number.
580 @param 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_PROTOCOL_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 Guid The 128-bit unique value that designates the namespace from which to extract the value.
607 @param TokenNumber The PCD token number.
608 @param 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_PROTOCOL_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 Guid The 128-bit unique value that designates the namespace from which to extract the value.
635 @param TokenNumber The PCD token number.
636 @param 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 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_PROTOCOL_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 Guid The 128-bit unique value that designates the namespace from which to extract the value.
668 @param TokenNumber The PCD token number.
669 @param 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_PROTOCOL_SET_EX_BOOLEAN
) (
681 IN CONST EFI_GUID
*Guid
,
682 IN UINTN TokenNumber
,
689 Callback on SET function prototype definition.
691 @param CallBackGuid The PCD token GUID being set.
692 @param CallBackToken The PCD token number being set.
693 @param TokenData A pointer to the token data being set.
694 @param TokenDataSize The size, in bytes, of the data being set.
701 (EFIAPI
*PCD_PROTOCOL_CALLBACK
) (
702 IN CONST EFI_GUID
*CallBackGuid
, OPTIONAL
703 IN UINTN CallBackToken
,
704 IN OUT VOID
*TokenData
,
705 IN UINTN TokenDataSize
711 Specifies a function to be called anytime the value of a designated token is changed.
713 @param TokenNumber The PCD token number.
714 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
715 @param CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
717 @retval EFI_SUCCESS The PCD service has successfully established a call event
718 for the CallBackToken requested.
719 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
724 (EFIAPI
*PCD_PROTOCOL_CALLBACK_ONSET
) (
725 IN UINTN TokenNumber
,
726 IN CONST EFI_GUID
*Guid
, OPTIONAL
727 IN PCD_PROTOCOL_CALLBACK CallBackFunction
733 Cancels a previously set callback function for a particular PCD token number.
735 @param TokenNumber The PCD token number.
736 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
737 @param CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
739 @retval EFI_SUCCESS The PCD service has successfully established a call event
740 for the CallBackToken requested.
741 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
746 (EFIAPI
*PCD_PROTOCOL_CANCEL_CALLBACK
) (
747 IN UINTN TokenNumber
,
748 IN CONST EFI_GUID
*Guid
, OPTIONAL
749 IN PCD_PROTOCOL_CALLBACK CallBackFunction
755 Retrieves the next valid PCD token for a given namespace.
757 @param Guid The 128-bit unique value that designates the namespace from which to extract the value.
758 @param TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
759 To retrieve the "first" token, have the pointer reference a TokenNumber value of 0.
761 @retval EFI_SUCCESS The PCD service retrieved the value requested.
762 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
767 (EFIAPI
*PCD_PROTOCOL_GET_NEXT_TOKEN
) (
768 IN CONST EFI_GUID
*Guid
, OPTIONAL
769 IN OUT UINTN
*TokenNumber
775 Retrieves the next valid PCD token namespace for a given namespace.
777 @param Guid An indirect pointer to EFI_GUID. On input it designates a known
778 token namespace from which the search will start. On output,
779 it designates the next valid token namespace on the platform.
780 If *Guid is NULL, then the GUID of the first token space of the current platform is returned.
781 If this input token namespace is the last tokenspace on the platform,
782 *Guid will be assigned to NULL and the function return EFI_SUCCESS.
783 If the search cannot locate the input token namespace, an error is returned and
784 the value of *Guid is undefined.
786 @retval EFI_SUCCESS The PCD service retrieved the value requested.
787 @retval EFI_NOT_FOUND The PCD service could not find the input token namespace.
792 (EFIAPI
*PCD_PROTOCOL_GET_NEXT_TOKENSPACE
) (
793 IN CONST EFI_GUID
**Guid
799 // Interface structure for the PCD Protocol
802 PCD_PROTOCOL_SET_SKU SetSku
;
804 PCD_PROTOCOL_GET8 Get8
;
805 PCD_PROTOCOL_GET16 Get16
;
806 PCD_PROTOCOL_GET32 Get32
;
807 PCD_PROTOCOL_GET64 Get64
;
808 PCD_PROTOCOL_GET_POINTER GetPtr
;
809 PCD_PROTOCOL_GET_BOOLEAN GetBool
;
810 PCD_PROTOCOL_GET_SIZE GetSize
;
812 PCD_PROTOCOL_GET_EX_8 Get8Ex
;
813 PCD_PROTOCOL_GET_EX_16 Get16Ex
;
814 PCD_PROTOCOL_GET_EX_32 Get32Ex
;
815 PCD_PROTOCOL_GET_EX_64 Get64Ex
;
816 PCD_PROTOCOL_GET_EX_POINTER GetPtrEx
;
817 PCD_PROTOCOL_GET_EX_BOOLEAN GetBoolEx
;
818 PCD_PROTOCOL_GET_EX_SIZE GetSizeEx
;
820 PCD_PROTOCOL_SET8 Set8
;
821 PCD_PROTOCOL_SET16 Set16
;
822 PCD_PROTOCOL_SET32 Set32
;
823 PCD_PROTOCOL_SET64 Set64
;
824 PCD_PROTOCOL_SET_POINTER SetPtr
;
825 PCD_PROTOCOL_SET_BOOLEAN SetBool
;
827 PCD_PROTOCOL_SET_EX_8 Set8Ex
;
828 PCD_PROTOCOL_SET_EX_16 Set16Ex
;
829 PCD_PROTOCOL_SET_EX_32 Set32Ex
;
830 PCD_PROTOCOL_SET_EX_64 Set64Ex
;
831 PCD_PROTOCOL_SET_EX_POINTER SetPtrEx
;
832 PCD_PROTOCOL_SET_EX_BOOLEAN SetBoolEx
;
834 PCD_PROTOCOL_CALLBACK_ONSET CallbackOnSet
;
835 PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback
;
836 PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken
;
837 PCD_PROTOCOL_GET_NEXT_TOKENSPACE GetNextTokenSpace
;