2 The internal header file declares the private functions used by PeiPcd driver.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _PEI_PCD_SERVICE_H_
10 #define _PEI_PCD_SERVICE_H_
13 #include <Ppi/ReadOnlyVariable2.h>
15 #include <Ppi/PiPcd.h>
16 #include <Ppi/PcdInfo.h>
17 #include <Ppi/PiPcdInfo.h>
18 #include <Guid/PcdDataBaseHobGuid.h>
19 #include <Guid/PcdDataBaseSignatureGuid.h>
20 #include <Guid/VariableFormat.h>
21 #include <Library/DebugLib.h>
22 #include <Library/PeimEntryPoint.h>
23 #include <Library/BaseLib.h>
24 #include <Library/HobLib.h>
25 #include <Library/PeiServicesLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/MemoryAllocationLib.h>
31 // Please make sure the PCD Serivce PEIM Version is consistent with
32 // the version of the generated PEIM PCD Database by build tool.
34 #define PCD_SERVICE_PEIM_VERSION 7
37 // PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.
39 #if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_VERSION)
40 #error "Please make sure the version of PCD PEIM Service and the generated PCD PEI Database match."
44 Retrieve additional information associated with a PCD token in the default token space.
46 This includes information such as the type of value the TokenNumber is associated with as well as possible
47 human readable name that is associated with the token.
49 @param[in] TokenNumber The PCD token number.
50 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
51 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
53 @retval EFI_SUCCESS The PCD information was returned successfully.
54 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
58 PeiGetPcdInfoGetInfo (
60 OUT EFI_PCD_INFO
*PcdInfo
64 Retrieve additional information associated with a PCD token.
66 This includes information such as the type of value the TokenNumber is associated with as well as possible
67 human readable name that is associated with the token.
69 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
70 @param[in] TokenNumber The PCD token number.
71 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
72 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
74 @retval EFI_SUCCESS The PCD information was returned successfully.
75 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
79 PeiGetPcdInfoGetInfoEx (
80 IN CONST EFI_GUID
*Guid
,
82 OUT EFI_PCD_INFO
*PcdInfo
86 Retrieve the currently set SKU Id.
88 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
89 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
99 // PPI Interface Implementation Declaration.
103 Sets the SKU value for subsequent calls to set or get PCD token values.
105 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
106 SetSku() is normally called only once by the system.
108 For each item (token), the database can hold a single value that applies to all SKUs,
109 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
110 SKU-specific values are called SKU enabled.
112 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
113 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
114 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
115 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
116 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
117 set for that Id, the results are unpredictable.
119 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
120 set values associated with a PCD token.
130 Retrieves an 8-bit value for a given PCD token.
132 Retrieves the current byte-sized value for a PCD token number.
133 If the TokenNumber is invalid, the results are unpredictable.
135 @param[in] TokenNumber The PCD token number.
137 @return The UINT8 value.
147 Retrieves an 16-bit value for a given PCD token.
149 Retrieves the current 16-bits value for a PCD token number.
150 If the TokenNumber is invalid, the results are unpredictable.
152 @param[in] TokenNumber The PCD token number.
154 @return The UINT16 value.
164 Retrieves an 32-bit value for a given PCD token.
166 Retrieves the current 32-bits value for a PCD token number.
167 If the TokenNumber is invalid, the results are unpredictable.
169 @param[in] TokenNumber The PCD token number.
171 @return The UINT32 value.
181 Retrieves an 64-bit value for a given PCD token.
183 Retrieves the current 64-bits value for a PCD token number.
184 If the TokenNumber is invalid, the results are unpredictable.
186 @param[in] TokenNumber The PCD token number.
188 @return The UINT64 value.
198 Retrieves a pointer to a value for a given PCD token.
200 Retrieves the current pointer to the buffer for a PCD token number.
201 Do not make any assumptions about the alignment of the pointer that
202 is returned by this function call. If the TokenNumber is invalid,
203 the results are unpredictable.
205 @param[in] TokenNumber The PCD token number.
207 @return The pointer to the buffer to be retrived.
217 Retrieves a Boolean value for a given PCD token.
219 Retrieves the current boolean value for a PCD token number.
220 Do not make any assumptions about the alignment of the pointer that
221 is returned by this function call. If the TokenNumber is invalid,
222 the results are unpredictable.
224 @param[in] TokenNumber The PCD token number.
226 @return The Boolean value.
236 Retrieves the size of the value for a given PCD token.
238 Retrieves the current size of a particular PCD token.
239 If the TokenNumber is invalid, the results are unpredictable.
241 @param[in] TokenNumber The PCD token number.
243 @return The size of the value for the PCD token.
253 Retrieves an 8-bit value for a given PCD token.
255 Retrieves the 8-bit value of a particular PCD token.
256 If the TokenNumber is invalid or the token space
257 specified by Guid does not exist, the results are
260 @param[in] Guid The token space for the token number.
261 @param[in] TokenNumber The PCD token number.
263 @return The size 8-bit value for the PCD token.
269 IN CONST EFI_GUID
*Guid
,
274 Retrieves an 16-bit value for a given PCD token.
276 Retrieves the 16-bit value of a particular PCD token.
277 If the TokenNumber is invalid or the token space
278 specified by Guid does not exist, the results are
281 @param[in] Guid The token space for the token number.
282 @param[in] TokenNumber The PCD token number.
284 @return The size 16-bit value for the PCD token.
290 IN CONST EFI_GUID
*Guid
,
295 Retrieves an 32-bit value for a given PCD token.
297 Retrieves the 32-bit value of a particular PCD token.
298 If the TokenNumber is invalid or the token space
299 specified by Guid does not exist, the results are
302 @param[in] Guid The token space for the token number.
303 @param[in] TokenNumber The PCD token number.
305 @return The size 32-bit value for the PCD token.
311 IN CONST EFI_GUID
*Guid
,
316 Retrieves an 64-bit value for a given PCD token.
318 Retrieves the 64-bit value of a particular PCD token.
319 If the TokenNumber is invalid or the token space
320 specified by Guid does not exist, the results are
323 @param[in] Guid The token space for the token number.
324 @param[in] TokenNumber The PCD token number.
326 @return The size 64-bit value for the PCD token.
332 IN CONST EFI_GUID
*Guid
,
337 Retrieves a pointer to a value for a given PCD token.
339 Retrieves the current pointer to the buffer for a PCD token number.
340 Do not make any assumptions about the alignment of the pointer that
341 is returned by this function call. If the TokenNumber is invalid,
342 the results are unpredictable.
344 @param[in] Guid The token space for the token number.
345 @param[in] TokenNumber The PCD token number.
347 @return The pointer to the buffer to be retrived.
353 IN CONST EFI_GUID
*Guid
,
358 Retrieves an Boolean value for a given PCD token.
360 Retrieves the Boolean value of a particular PCD token.
361 If the TokenNumber is invalid or the token space
362 specified by Guid does not exist, the results are
365 @param[in] Guid The token space for the token number.
366 @param[in] TokenNumber The PCD token number.
368 @return The size Boolean value for the PCD token.
374 IN CONST EFI_GUID
*Guid
,
379 Retrieves the size of the value for a given PCD token.
381 Retrieves the current size of a particular PCD token.
382 If the TokenNumber is invalid, the results are unpredictable.
384 @param[in] Guid The token space for the token number.
385 @param[in] TokenNumber The PCD token number.
387 @return The size of the value for the PCD token.
393 IN CONST EFI_GUID
*Guid
,
398 Sets an 8-bit value for a given PCD token.
400 When the PCD service sets a value, it will check to ensure that the
401 size of the value being set is compatible with the Token's existing definition.
402 If it is not, an error will be returned.
404 @param[in] TokenNumber The PCD token number.
405 @param[in] Value The value to set for the PCD token.
407 @retval EFI_SUCCESS Procedure returned successfully.
408 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
409 being set was incompatible with a call to this function.
410 Use GetSize() to retrieve the size of the target data.
411 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
417 IN UINTN TokenNumber
,
422 Sets an 16-bit value for a given PCD token.
424 When the PCD service sets a value, it will check to ensure that the
425 size of the value being set is compatible with the Token's existing definition.
426 If it is not, an error will be returned.
428 @param[in] TokenNumber The PCD token number.
429 @param[in] Value The value to set for the PCD token.
431 @retval EFI_SUCCESS Procedure returned successfully.
432 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
433 being set was incompatible with a call to this function.
434 Use GetSize() to retrieve the size of the target data.
435 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
441 IN UINTN TokenNumber
,
446 Sets an 32-bit value for a given PCD token.
448 When the PCD service sets a value, it will check to ensure that the
449 size of the value being set is compatible with the Token's existing definition.
450 If it is not, an error will be returned.
452 @param[in] TokenNumber The PCD token number.
453 @param[in] Value The value to set for the PCD token.
455 @retval EFI_SUCCESS Procedure returned successfully.
456 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
457 being set was incompatible with a call to this function.
458 Use GetSize() to retrieve the size of the target data.
459 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
465 IN UINTN TokenNumber
,
470 Sets an 64-bit value for a given PCD token.
472 When the PCD service sets a value, it will check to ensure that the
473 size of the value being set is compatible with the Token's existing definition.
474 If it is not, an error will be returned.
476 @param[in] TokenNumber The PCD token number.
477 @param[in] Value The value to set for the PCD token.
479 @retval EFI_SUCCESS Procedure returned successfully.
480 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
481 being set was incompatible with a call to this function.
482 Use GetSize() to retrieve the size of the target data.
483 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
489 IN UINTN TokenNumber
,
494 Sets a value of a specified size for a given PCD token.
496 When the PCD service sets a value, it will check to ensure that the
497 size of the value being set is compatible with the Token's existing definition.
498 If it is not, an error will be returned.
500 @param[in] TokenNumber The PCD token number.
501 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
502 On input, if the SizeOfValue is greater than the maximum size supported
503 for this TokenNumber then the output value of SizeOfValue will reflect
504 the maximum size supported for this TokenNumber.
505 @param[in] Buffer The buffer to set for the PCD token.
507 @retval EFI_SUCCESS Procedure returned successfully.
508 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
509 being set was incompatible with a call to this function.
510 Use GetSize() to retrieve the size of the target data.
511 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
517 IN UINTN TokenNumber
,
518 IN OUT UINTN
*SizeOfBuffer
,
523 Sets an Boolean value for a given PCD token.
525 When the PCD service sets a value, it will check to ensure that the
526 size of the value being set is compatible with the Token's existing definition.
527 If it is not, an error will be returned.
529 @param[in] TokenNumber The PCD token number.
530 @param[in] Value The value to set for the PCD token.
532 @retval EFI_SUCCESS Procedure returned successfully.
533 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
534 being set was incompatible with a call to this function.
535 Use GetSize() to retrieve the size of the target data.
536 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
542 IN UINTN TokenNumber
,
547 Sets an 8-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[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
554 @param[in] TokenNumber The PCD token number.
555 @param[in] 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.
567 IN CONST EFI_GUID
*Guid
,
568 IN UINTN TokenNumber
,
573 Sets an 16-bit value for a given PCD token.
575 When the PCD service sets a value, it will check to ensure that the
576 size of the value being set is compatible with the Token's existing definition.
577 If it is not, an error will be returned.
579 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
580 @param[in] TokenNumber The PCD token number.
581 @param[in] Value The value to set for the PCD token.
583 @retval EFI_SUCCESS Procedure returned successfully.
584 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
585 being set was incompatible with a call to this function.
586 Use GetSize() to retrieve the size of the target data.
587 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
593 IN CONST EFI_GUID
*Guid
,
594 IN UINTN TokenNumber
,
599 Sets an 32-bit value for a given PCD token.
601 When the PCD service sets a value, it will check to ensure that the
602 size of the value being set is compatible with the Token's existing definition.
603 If it is not, an error will be returned.
605 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
606 @param[in] TokenNumber The PCD token number.
607 @param[in] Value The value to set for the PCD token.
609 @retval EFI_SUCCESS Procedure returned successfully.
610 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
611 being set was incompatible with a call to this function.
612 Use GetSize() to retrieve the size of the target data.
613 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
619 IN CONST EFI_GUID
*Guid
,
620 IN UINTN TokenNumber
,
625 Sets an 64-bit value for a given PCD token.
627 When the PCD service sets a value, it will check to ensure that the
628 size of the value being set is compatible with the Token's existing definition.
629 If it is not, an error will be returned.
631 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
632 @param[in] TokenNumber The PCD token number.
633 @param[in] Value The value 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.
645 IN CONST EFI_GUID
*Guid
,
646 IN UINTN TokenNumber
,
651 Sets a value of a specified size for a given PCD token.
653 When the PCD service sets a value, it will check to ensure that the
654 size of the value being set is compatible with the Token's existing definition.
655 If it is not, an error will be returned.
657 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
658 @param[in] TokenNumber The PCD token number.
659 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
660 On input, if the SizeOfValue is greater than the maximum size supported
661 for this TokenNumber then the output value of SizeOfValue will reflect
662 the maximum size supported for this TokenNumber.
663 @param[in] Buffer The buffer to set for the PCD token.
665 @retval EFI_SUCCESS Procedure returned successfully.
666 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
667 being set was incompatible with a call to this function.
668 Use GetSize() to retrieve the size of the target data.
669 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
675 IN CONST EFI_GUID
*Guid
,
676 IN UINTN TokenNumber
,
677 IN OUT UINTN
*SizeOfBuffer
,
682 Sets an Boolean value for a given PCD token.
684 When the PCD service sets a value, it will check to ensure that the
685 size of the value being set is compatible with the Token's existing definition.
686 If it is not, an error will be returned.
688 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
689 @param[in] TokenNumber The PCD token number.
690 @param[in] Value The value to set for the PCD token.
692 @retval EFI_SUCCESS Procedure returned successfully.
693 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
694 being set was incompatible with a call to this function.
695 Use GetSize() to retrieve the size of the target data.
696 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
702 IN CONST EFI_GUID
*Guid
,
703 IN UINTN TokenNumber
,
708 Specifies a function to be called anytime the value of a designated token is changed.
710 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
711 @param[in] TokenNumber The PCD token number.
712 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
714 @retval EFI_SUCCESS The PCD service has successfully established a call event
715 for the CallBackToken requested.
716 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
721 PeiRegisterCallBackOnSet (
722 IN CONST EFI_GUID
*Guid
, OPTIONAL
723 IN UINTN TokenNumber
,
724 IN PCD_PPI_CALLBACK CallBackFunction
728 Cancels a previously set callback function for a particular PCD token number.
730 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
731 @param [in] TokenNumber The PCD token number.
732 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
734 @retval EFI_SUCCESS The PCD service has successfully established a call event
735 for the CallBackToken requested.
736 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
741 PcdUnRegisterCallBackOnSet (
742 IN CONST EFI_GUID
*Guid
, OPTIONAL
743 IN UINTN TokenNumber
,
744 IN PCD_PPI_CALLBACK CallBackFunction
748 Retrieves the next valid token number in a given namespace.
750 This is useful since the PCD infrastructure contains a sparse list of token numbers,
751 and one cannot a priori know what token numbers are valid in the database.
753 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
754 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
755 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
756 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
757 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
758 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
759 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
760 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
763 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
764 This is an optional parameter that may be NULL. If this parameter is NULL, then a request
765 is being made to retrieve tokens from the default token space.
766 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
768 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
769 Or the input token number is already the last valid token number in the PCD database.
770 In the later case, *TokenNumber is updated with the value of 0.
771 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
777 IN CONST EFI_GUID
*Guid
, OPTIONAL
778 IN OUT UINTN
*TokenNumber
782 Retrieves the next valid PCD token namespace for a given namespace.
784 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
785 a known token namespace from which the search will start. On output,
786 it designates the next valid token namespace on the platform. If the input
787 token namespace does not exist on the platform, an error is returned and
788 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
789 first token space of the current platform is assigned to *Guid the function
790 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
791 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
792 and the function return EFI_SUCCESS. If this input token namespace is the last
793 namespace on the platform, *Guid will be assigned to NULL and the function return
796 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
797 Or the input token space Guid is already the last valid token space Guid
798 in the PCD database. In the later case, *Guid is updated with the value of NULL.
799 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
804 PeiPcdGetNextTokenSpace (
805 IN OUT CONST EFI_GUID
**Guid
809 Retrieve additional information associated with a PCD token.
811 This includes information such as the type of value the TokenNumber is associated with as well as possible
812 human readable name that is associated with the token.
814 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
815 @param[in] TokenNumber The PCD token number.
816 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
817 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
819 @retval EFI_SUCCESS The PCD information was returned successfully
820 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
824 IN CONST EFI_GUID
*Guid
,
825 IN UINTN TokenNumber
,
826 OUT EFI_PCD_INFO
*PcdInfo
829 /* Internal Function definitions */
831 Get PCD database from GUID HOB in PEI phase.
833 @return Pointer to PCD database.
842 Wrapper function for setting non-pointer type value for a PCD entry.
844 @param TokenNumber Pcd token number autogenerated by build tools.
845 @param Data Value want to be set for PCD entry
846 @param Size Size of value.
848 @return status of SetWorker.
853 IN UINTN TokenNumber
,
859 Set value for an PCD entry
861 @param TokenNumber Pcd token number autogenerated by build tools.
862 @param Data Value want to be set for PCD entry
863 @param Size Size of value.
864 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
865 If False, the type of PCD entry's value is not Pointer.
867 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
868 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
869 @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database.
870 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
871 range of UINT8, UINT16, UINT32, UINT64
872 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
876 IN UINTN TokenNumber
,
883 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
885 @param ExTokenNumber Token number for dynamic-ex PCD.
886 @param Guid Token space guid for dynamic-ex PCD.
887 @param Data Value want to be set.
888 @param SetSize The size of value.
890 @return status of ExSetWorker().
895 IN UINTN ExTokenNumber
,
896 IN CONST EFI_GUID
*Guid
,
902 Set value for a dynamic PCD entry.
904 This routine find the local token number according to dynamic-ex PCD's token
905 space guid and token number firstly, and invoke callback function if this PCD
906 entry registered callback function. Finally, invoken general SetWorker to set
909 @param ExTokenNumber Dynamic-ex PCD token number.
910 @param Guid Token space guid for dynamic-ex PCD.
911 @param Data PCD value want to be set
912 @param SetSize Size of value.
913 @param PtrType If TRUE, this PCD entry is pointer type.
914 If FALSE, this PCD entry is not pointer type.
916 @return status of SetWorker().
921 IN UINTN ExTokenNumber
,
922 IN CONST EFI_GUID
*Guid
,
929 Get the PCD entry pointer in PCD database.
931 This routine will visit PCD database to find the PCD entry according to given
932 token number. The given token number is autogened by build tools and it will be
933 translated to local token number. Local token number contains PCD's type and
934 offset of PCD entry in PCD database.
936 @param TokenNumber Token's number, it is autogened by build tools
937 @param GetSize The size of token's value
939 @return PCD entry pointer in PCD database
944 IN UINTN TokenNumber
,
949 Wrapper function for get PCD value for dynamic-ex PCD.
951 @param Guid Token space guid for dynamic-ex PCD.
952 @param ExTokenNumber Token number for dyanmic-ex PCD.
953 @param GetSize The size of dynamic-ex PCD value.
955 @return PCD entry in PCD database.
960 IN CONST EFI_GUID
*Guid
,
961 IN UINTN ExTokenNumber
,
968 UINT32 LocalTokenNumberAlias
;
969 } EX_PCD_ENTRY_ATTRIBUTE
;
972 Get Token Number according to dynamic-ex PCD's {token space guid:token number}
974 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
975 in DEC file. PCD database maintain a mapping table that translate pair of {token
976 space guid: token number} to Token Number.
978 @param Guid Token space guid for dynamic-ex PCD entry.
979 @param ExTokenNumber Token number for dynamic-ex PCD.
981 @return Token Number for dynamic-ex PCD.
985 GetExPcdTokenNumber (
986 IN CONST EFI_GUID
*Guid
,
987 IN UINTN ExTokenNumber
991 The function registers the CallBackOnSet fucntion
992 according to TokenNumber and EFI_GUID space.
994 @param TokenNumber The token number.
995 @param Guid The GUID space.
996 @param CallBackFunction The Callback function to be registered.
997 @param Register To register or unregister the callback function.
999 @retval EFI_SUCCESS If the Callback function is registered.
1000 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
1001 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
1002 slot left in the CallbackFnTable.
1005 PeiRegisterCallBackWorker (
1006 IN UINTN TokenNumber
,
1007 IN CONST EFI_GUID
*Guid
, OPTIONAL
1008 IN PCD_PPI_CALLBACK CallBackFunction
,
1013 The function builds the PCD database.
1015 @param FileHandle Handle of the file the external PCD database binary located.
1017 @return Pointer to PCD database.
1022 IN EFI_PEI_FILE_HANDLE FileHandle
1026 Get index of PCD entry in size table.
1028 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
1029 @param Database Pointer to PCD database.
1031 @return index of PCD entry in size table.
1036 IN UINTN LocalTokenNumberTableIdx
,
1037 IN PEI_PCD_DATABASE
*Database
1041 Get PCD value's size for POINTER type PCD.
1043 The POINTER type PCD's value will be stored into a buffer in specificed size.
1044 The max size of this PCD's value is described in PCD's definition in DEC file.
1046 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1047 @param MaxSize Maxmium size of PCD's value
1048 @param Database Pcd database in PEI phase.
1050 @return PCD value's size for POINTER type PCD.
1055 IN UINTN LocalTokenNumberTableIdx
,
1057 IN PEI_PCD_DATABASE
*Database
1061 Set PCD value's size for POINTER type PCD.
1063 The POINTER type PCD's value will be stored into a buffer in specificed size.
1064 The max size of this PCD's value is described in PCD's definition in DEC file.
1066 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1067 @param CurrentSize Maxmium size of PCD's value
1068 @param Database Pcd database in PEI phase.
1070 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1071 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1076 IN UINTN LocalTokenNumberTableIdx
,
1077 IN OUT UINTN
*CurrentSize
,
1078 IN PEI_PCD_DATABASE
*Database