2 The internal header file declares the private functions used by PeiPcd driver.
4 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
5 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.
15 #ifndef _PEI_PCD_SERVICE_H_
16 #define _PEI_PCD_SERVICE_H_
19 #include <Ppi/ReadOnlyVariable2.h>
21 #include <Ppi/PiPcd.h>
22 #include <Ppi/PcdInfo.h>
23 #include <Ppi/PiPcdInfo.h>
24 #include <Guid/PcdDataBaseHobGuid.h>
25 #include <Guid/PcdDataBaseSignatureGuid.h>
26 #include <Library/DebugLib.h>
27 #include <Library/PeimEntryPoint.h>
28 #include <Library/BaseLib.h>
29 #include <Library/HobLib.h>
30 #include <Library/PeiServicesLib.h>
31 #include <Library/PcdLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/MemoryAllocationLib.h>
36 // Please make sure the PCD Serivce PEIM Version is consistent with
37 // the version of the generated PEIM PCD Database by build tool.
39 #define PCD_SERVICE_PEIM_VERSION 5
42 // PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.
44 #if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_VERSION)
45 #error "Please make sure the version of PCD PEIM Service and the generated PCD PEI Database match."
49 Retrieve additional information associated with a PCD token in the default token space.
51 This includes information such as the type of value the TokenNumber is associated with as well as possible
52 human readable name that is associated with the token.
54 @param[in] TokenNumber The PCD token number.
55 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
56 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
58 @retval EFI_SUCCESS The PCD information was returned successfully.
59 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
63 PeiGetPcdInfoGetInfo (
65 OUT EFI_PCD_INFO
*PcdInfo
69 Retrieve additional information associated with a PCD token.
71 This includes information such as the type of value the TokenNumber is associated with as well as possible
72 human readable name that is associated with the token.
74 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
75 @param[in] TokenNumber The PCD token number.
76 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
77 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
79 @retval EFI_SUCCESS The PCD information was returned successfully.
80 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
84 PeiGetPcdInfoGetInfoEx (
85 IN CONST EFI_GUID
*Guid
,
87 OUT EFI_PCD_INFO
*PcdInfo
91 Retrieve the currently set SKU Id.
93 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
94 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
104 // PPI Interface Implementation Declaration.
108 Sets the SKU value for subsequent calls to set or get PCD token values.
110 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
111 SetSku() is normally called only once by the system.
113 For each item (token), the database can hold a single value that applies to all SKUs,
114 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
115 SKU-specific values are called SKU enabled.
117 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
118 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
119 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
120 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
121 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
122 set for that Id, the results are unpredictable.
124 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
125 set values associated with a PCD token.
135 Retrieves an 8-bit value for a given PCD token.
137 Retrieves the current byte-sized value for a PCD token number.
138 If the TokenNumber is invalid, the results are unpredictable.
140 @param[in] TokenNumber The PCD token number.
142 @return The UINT8 value.
152 Retrieves an 16-bit value for a given PCD token.
154 Retrieves the current 16-bits value for a PCD token number.
155 If the TokenNumber is invalid, the results are unpredictable.
157 @param[in] TokenNumber The PCD token number.
159 @return The UINT16 value.
169 Retrieves an 32-bit value for a given PCD token.
171 Retrieves the current 32-bits value for a PCD token number.
172 If the TokenNumber is invalid, the results are unpredictable.
174 @param[in] TokenNumber The PCD token number.
176 @return The UINT32 value.
186 Retrieves an 64-bit value for a given PCD token.
188 Retrieves the current 64-bits value for a PCD token number.
189 If the TokenNumber is invalid, the results are unpredictable.
191 @param[in] TokenNumber The PCD token number.
193 @return The UINT64 value.
203 Retrieves a pointer to a value for a given PCD token.
205 Retrieves the current pointer to the buffer for a PCD token number.
206 Do not make any assumptions about the alignment of the pointer that
207 is returned by this function call. If the TokenNumber is invalid,
208 the results are unpredictable.
210 @param[in] TokenNumber The PCD token number.
212 @return The pointer to the buffer to be retrived.
222 Retrieves a Boolean value for a given PCD token.
224 Retrieves the current boolean value for a PCD token number.
225 Do not make any assumptions about the alignment of the pointer that
226 is returned by this function call. If the TokenNumber is invalid,
227 the results are unpredictable.
229 @param[in] TokenNumber The PCD token number.
231 @return The Boolean value.
241 Retrieves the size of the value for a given PCD token.
243 Retrieves the current size of a particular PCD token.
244 If the TokenNumber is invalid, the results are unpredictable.
246 @param[in] TokenNumber The PCD token number.
248 @return The size of the value for the PCD token.
258 Retrieves an 8-bit value for a given PCD token.
260 Retrieves the 8-bit value of a particular PCD token.
261 If the TokenNumber is invalid or the token space
262 specified by Guid does not exist, the results are
265 @param[in] Guid The token space for the token number.
266 @param[in] TokenNumber The PCD token number.
268 @return The size 8-bit value for the PCD token.
274 IN CONST EFI_GUID
*Guid
,
279 Retrieves an 16-bit value for a given PCD token.
281 Retrieves the 16-bit value of a particular PCD token.
282 If the TokenNumber is invalid or the token space
283 specified by Guid does not exist, the results are
286 @param[in] Guid The token space for the token number.
287 @param[in] TokenNumber The PCD token number.
289 @return The size 16-bit value for the PCD token.
295 IN CONST EFI_GUID
*Guid
,
300 Retrieves an 32-bit value for a given PCD token.
302 Retrieves the 32-bit value of a particular PCD token.
303 If the TokenNumber is invalid or the token space
304 specified by Guid does not exist, the results are
307 @param[in] Guid The token space for the token number.
308 @param[in] TokenNumber The PCD token number.
310 @return The size 32-bit value for the PCD token.
316 IN CONST EFI_GUID
*Guid
,
321 Retrieves an 64-bit value for a given PCD token.
323 Retrieves the 64-bit value of a particular PCD token.
324 If the TokenNumber is invalid or the token space
325 specified by Guid does not exist, the results are
328 @param[in] Guid The token space for the token number.
329 @param[in] TokenNumber The PCD token number.
331 @return The size 64-bit value for the PCD token.
337 IN CONST EFI_GUID
*Guid
,
342 Retrieves a pointer to a value for a given PCD token.
344 Retrieves the current pointer to the buffer for a PCD token number.
345 Do not make any assumptions about the alignment of the pointer that
346 is returned by this function call. If the TokenNumber is invalid,
347 the results are unpredictable.
349 @param[in] Guid The token space for the token number.
350 @param[in] TokenNumber The PCD token number.
352 @return The pointer to the buffer to be retrived.
358 IN CONST EFI_GUID
*Guid
,
363 Retrieves an Boolean value for a given PCD token.
365 Retrieves the Boolean value of a particular PCD token.
366 If the TokenNumber is invalid or the token space
367 specified by Guid does not exist, the results are
370 @param[in] Guid The token space for the token number.
371 @param[in] TokenNumber The PCD token number.
373 @return The size Boolean value for the PCD token.
379 IN CONST EFI_GUID
*Guid
,
384 Retrieves the size of the value for a given PCD token.
386 Retrieves the current size of a particular PCD token.
387 If the TokenNumber is invalid, the results are unpredictable.
389 @param[in] Guid The token space for the token number.
390 @param[in] TokenNumber The PCD token number.
392 @return The size of the value for the PCD token.
398 IN CONST EFI_GUID
*Guid
,
403 Sets an 8-bit value for a given PCD token.
405 When the PCD service sets a value, it will check to ensure that the
406 size of the value being set is compatible with the Token's existing definition.
407 If it is not, an error will be returned.
409 @param[in] TokenNumber The PCD token number.
410 @param[in] Value The value to set for the PCD token.
412 @retval EFI_SUCCESS Procedure returned successfully.
413 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
414 being set was incompatible with a call to this function.
415 Use GetSize() to retrieve the size of the target data.
416 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
422 IN UINTN TokenNumber
,
427 Sets an 16-bit value for a given PCD token.
429 When the PCD service sets a value, it will check to ensure that the
430 size of the value being set is compatible with the Token's existing definition.
431 If it is not, an error will be returned.
433 @param[in] TokenNumber The PCD token number.
434 @param[in] Value The value to set for the PCD token.
436 @retval EFI_SUCCESS Procedure returned successfully.
437 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
438 being set was incompatible with a call to this function.
439 Use GetSize() to retrieve the size of the target data.
440 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
446 IN UINTN TokenNumber
,
451 Sets an 32-bit value for a given PCD token.
453 When the PCD service sets a value, it will check to ensure that the
454 size of the value being set is compatible with the Token's existing definition.
455 If it is not, an error will be returned.
457 @param[in] TokenNumber The PCD token number.
458 @param[in] Value The value to set for the PCD token.
460 @retval EFI_SUCCESS Procedure returned successfully.
461 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
462 being set was incompatible with a call to this function.
463 Use GetSize() to retrieve the size of the target data.
464 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
470 IN UINTN TokenNumber
,
475 Sets an 64-bit value for a given PCD token.
477 When the PCD service sets a value, it will check to ensure that the
478 size of the value being set is compatible with the Token's existing definition.
479 If it is not, an error will be returned.
481 @param[in] TokenNumber The PCD token number.
482 @param[in] Value The value to set for the PCD token.
484 @retval EFI_SUCCESS Procedure returned successfully.
485 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
486 being set was incompatible with a call to this function.
487 Use GetSize() to retrieve the size of the target data.
488 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
494 IN UINTN TokenNumber
,
499 Sets a value of a specified size for a given PCD token.
501 When the PCD service sets a value, it will check to ensure that the
502 size of the value being set is compatible with the Token's existing definition.
503 If it is not, an error will be returned.
505 @param[in] TokenNumber The PCD token number.
506 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
507 On input, if the SizeOfValue is greater than the maximum size supported
508 for this TokenNumber then the output value of SizeOfValue will reflect
509 the maximum size supported for this TokenNumber.
510 @param[in] Buffer The buffer to set for the PCD token.
512 @retval EFI_SUCCESS Procedure returned successfully.
513 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
514 being set was incompatible with a call to this function.
515 Use GetSize() to retrieve the size of the target data.
516 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
522 IN UINTN TokenNumber
,
523 IN OUT UINTN
*SizeOfBuffer
,
528 Sets an Boolean value for a given PCD token.
530 When the PCD service sets a value, it will check to ensure that the
531 size of the value being set is compatible with the Token's existing definition.
532 If it is not, an error will be returned.
534 @param[in] TokenNumber The PCD token number.
535 @param[in] Value The value to set for the PCD token.
537 @retval EFI_SUCCESS Procedure returned successfully.
538 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
539 being set was incompatible with a call to this function.
540 Use GetSize() to retrieve the size of the target data.
541 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
547 IN UINTN TokenNumber
,
552 Sets an 8-bit value for a given PCD token.
554 When the PCD service sets a value, it will check to ensure that the
555 size of the value being set is compatible with the Token's existing definition.
556 If it is not, an error will be returned.
558 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
559 @param[in] TokenNumber The PCD token number.
560 @param[in] Value The value to set for the PCD token.
562 @retval EFI_SUCCESS Procedure returned successfully.
563 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
564 being set was incompatible with a call to this function.
565 Use GetSize() to retrieve the size of the target data.
566 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
572 IN CONST EFI_GUID
*Guid
,
573 IN UINTN TokenNumber
,
578 Sets an 16-bit value for a given PCD token.
580 When the PCD service sets a value, it will check to ensure that the
581 size of the value being set is compatible with the Token's existing definition.
582 If it is not, an error will be returned.
584 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
585 @param[in] TokenNumber The PCD token number.
586 @param[in] Value The value to set for the PCD token.
588 @retval EFI_SUCCESS Procedure returned successfully.
589 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
590 being set was incompatible with a call to this function.
591 Use GetSize() to retrieve the size of the target data.
592 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
598 IN CONST EFI_GUID
*Guid
,
599 IN UINTN TokenNumber
,
604 Sets an 32-bit value for a given PCD token.
606 When the PCD service sets a value, it will check to ensure that the
607 size of the value being set is compatible with the Token's existing definition.
608 If it is not, an error will be returned.
610 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
611 @param[in] TokenNumber The PCD token number.
612 @param[in] Value The value to set for the PCD token.
614 @retval EFI_SUCCESS Procedure returned successfully.
615 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
616 being set was incompatible with a call to this function.
617 Use GetSize() to retrieve the size of the target data.
618 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
624 IN CONST EFI_GUID
*Guid
,
625 IN UINTN TokenNumber
,
630 Sets an 64-bit value for a given PCD token.
632 When the PCD service sets a value, it will check to ensure that the
633 size of the value being set is compatible with the Token's existing definition.
634 If it is not, an error will be returned.
636 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
637 @param[in] TokenNumber The PCD token number.
638 @param[in] Value The value to set for the PCD token.
640 @retval EFI_SUCCESS Procedure returned successfully.
641 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
642 being set was incompatible with a call to this function.
643 Use GetSize() to retrieve the size of the target data.
644 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
650 IN CONST EFI_GUID
*Guid
,
651 IN UINTN TokenNumber
,
656 Sets a value of a specified size for a given PCD token.
658 When the PCD service sets a value, it will check to ensure that the
659 size of the value being set is compatible with the Token's existing definition.
660 If it is not, an error will be returned.
662 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
663 @param[in] TokenNumber The PCD token number.
664 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
665 On input, if the SizeOfValue is greater than the maximum size supported
666 for this TokenNumber then the output value of SizeOfValue will reflect
667 the maximum size supported for this TokenNumber.
668 @param[in] Buffer The buffer to set for the PCD token.
670 @retval EFI_SUCCESS Procedure returned successfully.
671 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
672 being set was incompatible with a call to this function.
673 Use GetSize() to retrieve the size of the target data.
674 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
680 IN CONST EFI_GUID
*Guid
,
681 IN UINTN TokenNumber
,
682 IN OUT UINTN
*SizeOfBuffer
,
687 Sets an Boolean value for a given PCD token.
689 When the PCD service sets a value, it will check to ensure that the
690 size of the value being set is compatible with the Token's existing definition.
691 If it is not, an error will be returned.
693 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
694 @param[in] TokenNumber The PCD token number.
695 @param[in] Value The value to set for the PCD token.
697 @retval EFI_SUCCESS Procedure returned successfully.
698 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
699 being set was incompatible with a call to this function.
700 Use GetSize() to retrieve the size of the target data.
701 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
707 IN CONST EFI_GUID
*Guid
,
708 IN UINTN TokenNumber
,
713 Specifies a function to be called anytime the value of a designated token is changed.
715 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
716 @param[in] TokenNumber The PCD token number.
717 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
719 @retval EFI_SUCCESS The PCD service has successfully established a call event
720 for the CallBackToken requested.
721 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
726 PeiRegisterCallBackOnSet (
727 IN CONST EFI_GUID
*Guid
, OPTIONAL
728 IN UINTN TokenNumber
,
729 IN PCD_PPI_CALLBACK CallBackFunction
733 Cancels a previously set callback function for a particular PCD token number.
735 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
736 @param [in] TokenNumber The PCD token number.
737 @param [in] 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 PcdUnRegisterCallBackOnSet (
747 IN CONST EFI_GUID
*Guid
, OPTIONAL
748 IN UINTN TokenNumber
,
749 IN PCD_PPI_CALLBACK CallBackFunction
753 Retrieves the next valid token number in a given namespace.
755 This is useful since the PCD infrastructure contains a sparse list of token numbers,
756 and one cannot a priori know what token numbers are valid in the database.
758 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
759 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
760 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
761 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
762 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
763 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
764 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
765 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
768 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
769 This is an optional parameter that may be NULL. If this parameter is NULL, then a request
770 is being made to retrieve tokens from the default token space.
771 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
773 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
774 Or the input token number is already the last valid token number in the PCD database.
775 In the later case, *TokenNumber is updated with the value of 0.
776 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
782 IN CONST EFI_GUID
*Guid
, OPTIONAL
783 IN OUT UINTN
*TokenNumber
787 Retrieves the next valid PCD token namespace for a given namespace.
789 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
790 a known token namespace from which the search will start. On output,
791 it designates the next valid token namespace on the platform. If the input
792 token namespace does not exist on the platform, an error is returned and
793 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
794 first token space of the current platform is assigned to *Guid the function
795 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
796 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
797 and the function return EFI_SUCCESS. If this input token namespace is the last
798 namespace on the platform, *Guid will be assigned to NULL and the function return
801 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
802 Or the input token space Guid is already the last valid token space Guid
803 in the PCD database. In the later case, *Guid is updated with the value of NULL.
804 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
809 PeiPcdGetNextTokenSpace (
810 IN OUT CONST EFI_GUID
**Guid
814 Retrieve additional information associated with a PCD token.
816 This includes information such as the type of value the TokenNumber is associated with as well as possible
817 human readable name that is associated with the token.
819 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
820 @param[in] TokenNumber The PCD token number.
821 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
822 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
824 @retval EFI_SUCCESS The PCD information was returned successfully
825 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
829 IN CONST EFI_GUID
*Guid
,
830 IN UINTN TokenNumber
,
831 OUT EFI_PCD_INFO
*PcdInfo
834 /* Internal Function definitions */
836 Get PCD database from GUID HOB in PEI phase.
838 @return Pointer to PCD database.
847 Wrapper function for setting non-pointer type value for a PCD entry.
849 @param TokenNumber Pcd token number autogenerated by build tools.
850 @param Data Value want to be set for PCD entry
851 @param Size Size of value.
853 @return status of SetWorker.
858 IN UINTN TokenNumber
,
864 Set value for an PCD entry
866 @param TokenNumber Pcd token number autogenerated by build tools.
867 @param Data Value want to be set for PCD entry
868 @param Size Size of value.
869 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
870 If False, the type of PCD entry's value is not Pointer.
872 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
873 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
874 @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database.
875 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
876 range of UINT8, UINT16, UINT32, UINT64
877 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
881 IN UINTN TokenNumber
,
888 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
890 @param ExTokenNumber Token number for dynamic-ex PCD.
891 @param Guid Token space guid for dynamic-ex PCD.
892 @param Data Value want to be set.
893 @param SetSize The size of value.
895 @return status of ExSetWorker().
900 IN UINTN ExTokenNumber
,
901 IN CONST EFI_GUID
*Guid
,
907 Set value for a dynamic PCD entry.
909 This routine find the local token number according to dynamic-ex PCD's token
910 space guid and token number firstly, and invoke callback function if this PCD
911 entry registered callback function. Finally, invoken general SetWorker to set
914 @param ExTokenNumber Dynamic-ex PCD token number.
915 @param Guid Token space guid for dynamic-ex PCD.
916 @param Data PCD value want to be set
917 @param SetSize Size of value.
918 @param PtrType If TRUE, this PCD entry is pointer type.
919 If FALSE, this PCD entry is not pointer type.
921 @return status of SetWorker().
926 IN UINTN ExTokenNumber
,
927 IN CONST EFI_GUID
*Guid
,
934 Get the PCD entry pointer in PCD database.
936 This routine will visit PCD database to find the PCD entry according to given
937 token number. The given token number is autogened by build tools and it will be
938 translated to local token number. Local token number contains PCD's type and
939 offset of PCD entry in PCD database.
941 @param TokenNumber Token's number, it is autogened by build tools
942 @param GetSize The size of token's value
944 @return PCD entry pointer in PCD database
949 IN UINTN TokenNumber
,
954 Wrapper function for get PCD value for dynamic-ex PCD.
956 @param Guid Token space guid for dynamic-ex PCD.
957 @param ExTokenNumber Token number for dyanmic-ex PCD.
958 @param GetSize The size of dynamic-ex PCD value.
960 @return PCD entry in PCD database.
965 IN CONST EFI_GUID
*Guid
,
966 IN UINTN ExTokenNumber
,
973 UINT32 LocalTokenNumberAlias
;
974 } EX_PCD_ENTRY_ATTRIBUTE
;
977 Get Token Number according to dynamic-ex PCD's {token space guid:token number}
979 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
980 in DEC file. PCD database maintain a mapping table that translate pair of {token
981 space guid: token number} to Token Number.
983 @param Guid Token space guid for dynamic-ex PCD entry.
984 @param ExTokenNumber Token number for dynamic-ex PCD.
986 @return Token Number for dynamic-ex PCD.
990 GetExPcdTokenNumber (
991 IN CONST EFI_GUID
*Guid
,
992 IN UINTN ExTokenNumber
996 Find the local token number according to system SKU ID.
998 @param LocalTokenNumber PCD token number
999 @param Size The size of PCD entry.
1001 @return Token number according to system SKU ID.
1005 GetSkuEnabledTokenNumber (
1006 UINT32 LocalTokenNumber
,
1011 The function registers the CallBackOnSet fucntion
1012 according to TokenNumber and EFI_GUID space.
1014 @param TokenNumber The token number.
1015 @param Guid The GUID space.
1016 @param CallBackFunction The Callback function to be registered.
1017 @param Register To register or unregister the callback function.
1019 @retval EFI_SUCCESS If the Callback function is registered.
1020 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
1021 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
1022 slot left in the CallbackFnTable.
1025 PeiRegisterCallBackWorker (
1026 IN UINTN TokenNumber
,
1027 IN CONST EFI_GUID
*Guid
, OPTIONAL
1028 IN PCD_PPI_CALLBACK CallBackFunction
,
1033 The function builds the PCD database.
1035 @param FileHandle Handle of the file the external PCD database binary located.
1037 @return Pointer to PCD database.
1042 IN EFI_PEI_FILE_HANDLE FileHandle
1046 Get SKU ID tabble from PCD database.
1048 @param LocalTokenNumberTableIdx Index of local token number in token number table.
1049 @param Database PCD Database in PEI phase
1051 @return Pointer to SKU ID array table
1056 IN UINTN LocalTokenNumberTableIdx
,
1057 IN PEI_PCD_DATABASE
*Database
1061 Get index of PCD entry in size table.
1063 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
1064 @param Database Pointer to PCD database.
1066 @return index of PCD entry in size table.
1071 IN UINTN LocalTokenNumberTableIdx
,
1072 IN PEI_PCD_DATABASE
*Database
1076 Get PCD value's size for POINTER type PCD.
1078 The POINTER type PCD's value will be stored into a buffer in specificed size.
1079 The max size of this PCD's value is described in PCD's definition in DEC file.
1081 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1082 @param MaxSize Maxmium size of PCD's value
1083 @param Database Pcd database in PEI phase.
1085 @return PCD value's size for POINTER type PCD.
1090 IN UINTN LocalTokenNumberTableIdx
,
1092 IN PEI_PCD_DATABASE
*Database
1096 Set PCD value's size for POINTER type PCD.
1098 The POINTER type PCD's value will be stored into a buffer in specificed size.
1099 The max size of this PCD's value is described in PCD's definition in DEC file.
1101 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1102 @param CurrentSize Maxmium size of PCD's value
1103 @param Database Pcd database in PEI phase.
1105 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1106 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1111 IN UINTN LocalTokenNumberTableIdx
,
1112 IN OUT UINTN
*CurrentSize
,
1113 IN PEI_PCD_DATABASE
*Database