2 The internal header file declares the private functions used by PeiPcd driver.
4 Copyright (c) 2006 - 2012, 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 <Guid/PcdDataBaseHobGuid.h>
23 #include <Library/DebugLib.h>
24 #include <Library/PeimEntryPoint.h>
25 #include <Library/BaseLib.h>
26 #include <Library/HobLib.h>
27 #include <Library/PeiServicesLib.h>
28 #include <Library/PcdLib.h>
29 #include <Library/BaseMemoryLib.h>
33 // Please make sure the PCD Serivce PEIM Version is consistent with
34 // the version of the generated PEIM PCD Database by build tool.
36 #define PCD_SERVICE_PEIM_VERSION 2
39 // PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.
41 #if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_VERSION)
42 #error "Please make sure the version of PCD PEIM Service and the generated PCD PEI Database match."
46 // PPI Interface Implementation Declaration.
50 Sets the SKU value for subsequent calls to set or get PCD token values.
52 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
53 SetSku() is normally called only once by the system.
55 For each item (token), the database can hold a single value that applies to all SKUs,
56 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
57 SKU-specific values are called SKU enabled.
59 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
60 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
61 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
62 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
63 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
64 set for that Id, the results are unpredictable.
66 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
67 set values associated with a PCD token.
77 Retrieves an 8-bit value for a given PCD token.
79 Retrieves the current byte-sized value for a PCD token number.
80 If the TokenNumber is invalid, the results are unpredictable.
82 @param[in] TokenNumber The PCD token number.
84 @return The UINT8 value.
94 Retrieves an 16-bit value for a given PCD token.
96 Retrieves the current 16-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 UINT16 value.
111 Retrieves an 32-bit value for a given PCD token.
113 Retrieves the current 32-bits value for a PCD token number.
114 If the TokenNumber is invalid, the results are unpredictable.
116 @param[in] TokenNumber The PCD token number.
118 @return The UINT32 value.
128 Retrieves an 64-bit value for a given PCD token.
130 Retrieves the current 64-bits value for a PCD token number.
131 If the TokenNumber is invalid, the results are unpredictable.
133 @param[in] TokenNumber The PCD token number.
135 @return The UINT64 value.
145 Retrieves a pointer to a value for a given PCD token.
147 Retrieves the current pointer to the buffer for a PCD token number.
148 Do not make any assumptions about the alignment of the pointer that
149 is returned by this function call. If the TokenNumber is invalid,
150 the results are unpredictable.
152 @param[in] TokenNumber The PCD token number.
154 @return The pointer to the buffer to be retrived.
164 Retrieves a Boolean value for a given PCD token.
166 Retrieves the current boolean value for a PCD token number.
167 Do not make any assumptions about the alignment of the pointer that
168 is returned by this function call. If the TokenNumber is invalid,
169 the results are unpredictable.
171 @param[in] TokenNumber The PCD token number.
173 @return The Boolean value.
183 Retrieves the size of the value for a given PCD token.
185 Retrieves the current size of a particular PCD token.
186 If the TokenNumber is invalid, the results are unpredictable.
188 @param[in] TokenNumber The PCD token number.
190 @return The size of the value for the PCD token.
200 Retrieves an 8-bit value for a given PCD token.
202 Retrieves the 8-bit value of a particular PCD token.
203 If the TokenNumber is invalid or the token space
204 specified by Guid does not exist, the results are
207 @param[in] Guid The token space for the token number.
208 @param[in] TokenNumber The PCD token number.
210 @return The size 8-bit value for the PCD token.
216 IN CONST EFI_GUID
*Guid
,
221 Retrieves an 16-bit value for a given PCD token.
223 Retrieves the 16-bit value of a particular PCD token.
224 If the TokenNumber is invalid or the token space
225 specified by Guid does not exist, the results are
228 @param[in] Guid The token space for the token number.
229 @param[in] TokenNumber The PCD token number.
231 @return The size 16-bit value for the PCD token.
237 IN CONST EFI_GUID
*Guid
,
242 Retrieves an 32-bit value for a given PCD token.
244 Retrieves the 32-bit value of a particular PCD token.
245 If the TokenNumber is invalid or the token space
246 specified by Guid does not exist, the results are
249 @param[in] Guid The token space for the token number.
250 @param[in] TokenNumber The PCD token number.
252 @return The size 32-bit value for the PCD token.
258 IN CONST EFI_GUID
*Guid
,
263 Retrieves an 64-bit value for a given PCD token.
265 Retrieves the 64-bit value of a particular PCD token.
266 If the TokenNumber is invalid or the token space
267 specified by Guid does not exist, the results are
270 @param[in] Guid The token space for the token number.
271 @param[in] TokenNumber The PCD token number.
273 @return The size 64-bit value for the PCD token.
279 IN CONST EFI_GUID
*Guid
,
284 Retrieves a pointer to a value for a given PCD token.
286 Retrieves the current pointer to the buffer for a PCD token number.
287 Do not make any assumptions about the alignment of the pointer that
288 is returned by this function call. If the TokenNumber is invalid,
289 the results are unpredictable.
291 @param[in] Guid The token space for the token number.
292 @param[in] TokenNumber The PCD token number.
294 @return The pointer to the buffer to be retrived.
300 IN CONST EFI_GUID
*Guid
,
305 Retrieves an Boolean value for a given PCD token.
307 Retrieves the Boolean value of a particular PCD token.
308 If the TokenNumber is invalid or the token space
309 specified by Guid does not exist, the results are
312 @param[in] Guid The token space for the token number.
313 @param[in] TokenNumber The PCD token number.
315 @return The size Boolean value for the PCD token.
321 IN CONST EFI_GUID
*Guid
,
326 Retrieves the size of the value for a given PCD token.
328 Retrieves the current size of a particular PCD token.
329 If the TokenNumber is invalid, the results are unpredictable.
331 @param[in] Guid The token space for the token number.
332 @param[in] TokenNumber The PCD token number.
334 @return The size of the value for the PCD token.
340 IN CONST EFI_GUID
*Guid
,
345 Sets an 8-bit value for a given PCD token.
347 When the PCD service sets a value, it will check to ensure that the
348 size of the value being set is compatible with the Token's existing definition.
349 If it is not, an error will be returned.
351 @param[in] TokenNumber The PCD token number.
352 @param[in] Value The value to set for the PCD token.
354 @retval EFI_SUCCESS Procedure returned successfully.
355 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
356 being set was incompatible with a call to this function.
357 Use GetSize() to retrieve the size of the target data.
358 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
364 IN UINTN TokenNumber
,
369 Sets an 16-bit value for a given PCD token.
371 When the PCD service sets a value, it will check to ensure that the
372 size of the value being set is compatible with the Token's existing definition.
373 If it is not, an error will be returned.
375 @param[in] TokenNumber The PCD token number.
376 @param[in] Value The value to set for the PCD token.
378 @retval EFI_SUCCESS Procedure returned successfully.
379 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
380 being set was incompatible with a call to this function.
381 Use GetSize() to retrieve the size of the target data.
382 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
388 IN UINTN TokenNumber
,
393 Sets an 32-bit value for a given PCD token.
395 When the PCD service sets a value, it will check to ensure that the
396 size of the value being set is compatible with the Token's existing definition.
397 If it is not, an error will be returned.
399 @param[in] TokenNumber The PCD token number.
400 @param[in] Value The value to set for the PCD token.
402 @retval EFI_SUCCESS Procedure returned successfully.
403 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
404 being set was incompatible with a call to this function.
405 Use GetSize() to retrieve the size of the target data.
406 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
412 IN UINTN TokenNumber
,
417 Sets an 64-bit value for a given PCD token.
419 When the PCD service sets a value, it will check to ensure that the
420 size of the value being set is compatible with the Token's existing definition.
421 If it is not, an error will be returned.
423 @param[in] TokenNumber The PCD token number.
424 @param[in] Value The value to set for the PCD token.
426 @retval EFI_SUCCESS Procedure returned successfully.
427 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
428 being set was incompatible with a call to this function.
429 Use GetSize() to retrieve the size of the target data.
430 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
436 IN UINTN TokenNumber
,
441 Sets a value of a specified size for a given PCD token.
443 When the PCD service sets a value, it will check to ensure that the
444 size of the value being set is compatible with the Token's existing definition.
445 If it is not, an error will be returned.
447 @param[in] TokenNumber The PCD token number.
448 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
449 On input, if the SizeOfValue is greater than the maximum size supported
450 for this TokenNumber then the output value of SizeOfValue will reflect
451 the maximum size supported for this TokenNumber.
452 @param[in] Buffer The buffer to set for the PCD token.
454 @retval EFI_SUCCESS Procedure returned successfully.
455 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
456 being set was incompatible with a call to this function.
457 Use GetSize() to retrieve the size of the target data.
458 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
464 IN UINTN TokenNumber
,
465 IN OUT UINTN
*SizeOfBuffer
,
470 Sets an Boolean 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 an 8-bit value 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] Guid The 128-bit unique value that designates the namespace from which to extract the value.
501 @param[in] TokenNumber The PCD token number.
502 @param[in] Value The value to set for the PCD token.
504 @retval EFI_SUCCESS Procedure returned successfully.
505 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
506 being set was incompatible with a call to this function.
507 Use GetSize() to retrieve the size of the target data.
508 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
514 IN CONST EFI_GUID
*Guid
,
515 IN UINTN TokenNumber
,
520 Sets an 16-bit value for a given PCD token.
522 When the PCD service sets a value, it will check to ensure that the
523 size of the value being set is compatible with the Token's existing definition.
524 If it is not, an error will be returned.
526 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
527 @param[in] TokenNumber The PCD token number.
528 @param[in] Value The value to set for the PCD token.
530 @retval EFI_SUCCESS Procedure returned successfully.
531 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
532 being set was incompatible with a call to this function.
533 Use GetSize() to retrieve the size of the target data.
534 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
540 IN CONST EFI_GUID
*Guid
,
541 IN UINTN TokenNumber
,
546 Sets an 32-bit value for a given PCD token.
548 When the PCD service sets a value, it will check to ensure that the
549 size of the value being set is compatible with the Token's existing definition.
550 If it is not, an error will be returned.
552 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
553 @param[in] TokenNumber The PCD token number.
554 @param[in] Value The value to set for the PCD token.
556 @retval EFI_SUCCESS Procedure returned successfully.
557 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
558 being set was incompatible with a call to this function.
559 Use GetSize() to retrieve the size of the target data.
560 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
566 IN CONST EFI_GUID
*Guid
,
567 IN UINTN TokenNumber
,
572 Sets an 64-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[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
579 @param[in] TokenNumber The PCD token number.
580 @param[in] 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.
592 IN CONST EFI_GUID
*Guid
,
593 IN UINTN TokenNumber
,
598 Sets a value of a specified size for a given PCD token.
600 When the PCD service sets a value, it will check to ensure that the
601 size of the value being set is compatible with the Token's existing definition.
602 If it is not, an error will be returned.
604 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
605 @param[in] TokenNumber The PCD token number.
606 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
607 On input, if the SizeOfValue is greater than the maximum size supported
608 for this TokenNumber then the output value of SizeOfValue will reflect
609 the maximum size supported for this TokenNumber.
610 @param[in] Buffer The buffer to set for the PCD token.
612 @retval EFI_SUCCESS Procedure returned successfully.
613 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
614 being set was incompatible with a call to this function.
615 Use GetSize() to retrieve the size of the target data.
616 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
622 IN CONST EFI_GUID
*Guid
,
623 IN UINTN TokenNumber
,
624 IN OUT UINTN
*SizeOfBuffer
,
629 Sets an Boolean value for a given PCD token.
631 When the PCD service sets a value, it will check to ensure that the
632 size of the value being set is compatible with the Token's existing definition.
633 If it is not, an error will be returned.
635 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
636 @param[in] TokenNumber The PCD token number.
637 @param[in] Value The value to set for the PCD token.
639 @retval EFI_SUCCESS Procedure returned successfully.
640 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
641 being set was incompatible with a call to this function.
642 Use GetSize() to retrieve the size of the target data.
643 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
649 IN CONST EFI_GUID
*Guid
,
650 IN UINTN TokenNumber
,
655 Specifies a function to be called anytime the value of a designated token is changed.
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] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
661 @retval EFI_SUCCESS The PCD service has successfully established a call event
662 for the CallBackToken requested.
663 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
668 PeiRegisterCallBackOnSet (
669 IN CONST EFI_GUID
*Guid
, OPTIONAL
670 IN UINTN TokenNumber
,
671 IN PCD_PPI_CALLBACK CallBackFunction
675 Cancels a previously set callback function for a particular PCD token number.
677 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
678 @param [in] TokenNumber The PCD token number.
679 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
681 @retval EFI_SUCCESS The PCD service has successfully established a call event
682 for the CallBackToken requested.
683 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
688 PcdUnRegisterCallBackOnSet (
689 IN CONST EFI_GUID
*Guid
, OPTIONAL
690 IN UINTN TokenNumber
,
691 IN PCD_PPI_CALLBACK CallBackFunction
695 Retrieves the next valid token number in a given namespace.
697 This is useful since the PCD infrastructure contains a sparse list of token numbers,
698 and one cannot a priori know what token numbers are valid in the database.
700 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
701 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
702 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
703 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
704 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
705 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
706 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
707 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
710 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
711 This is an optional parameter that may be NULL. If this parameter is NULL, then a request
712 is being made to retrieve tokens from the default token space.
713 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
715 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
716 Or the input token number is already the last valid token number in the PCD database.
717 In the later case, *TokenNumber is updated with the value of 0.
718 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
724 IN CONST EFI_GUID
*Guid
, OPTIONAL
725 IN OUT UINTN
*TokenNumber
729 Retrieves the next valid PCD token namespace for a given namespace.
731 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
732 a known token namespace from which the search will start. On output,
733 it designates the next valid token namespace on the platform. If the input
734 token namespace does not exist on the platform, an error is returned and
735 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
736 first token space of the current platform is assigned to *Guid the function
737 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
738 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
739 and the function return EFI_SUCCESS. If this input token namespace is the last
740 namespace on the platform, *Guid will be assigned to NULL and the function return
743 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
744 Or the input token space Guid is already the last valid token space Guid
745 in the PCD database. In the later case, *Guid is updated with the value of NULL.
746 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
751 PeiPcdGetNextTokenSpace (
752 IN OUT CONST EFI_GUID
**Guid
756 /* Internal Function definitions */
758 Get PCD database from GUID HOB in PEI phase.
760 @return Pointer to PCD database.
769 Wrapper function for setting non-pointer type value for a PCD entry.
771 @param TokenNumber Pcd token number autogenerated by build tools.
772 @param Data Value want to be set for PCD entry
773 @param Size Size of value.
775 @return status of SetWorker.
780 IN UINTN TokenNumber
,
786 Set value for an PCD entry
788 @param TokenNumber Pcd token number autogenerated by build tools.
789 @param Data Value want to be set for PCD entry
790 @param Size Size of value.
791 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
792 If False, the type of PCD entry's value is not Pointer.
794 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
795 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
796 @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database.
797 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
798 range of UINT8, UINT16, UINT32, UINT64
799 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
803 IN UINTN TokenNumber
,
810 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
812 @param ExTokenNumber Token number for dynamic-ex PCD.
813 @param Guid Token space guid for dynamic-ex PCD.
814 @param Data Value want to be set.
815 @param SetSize The size of value.
817 @return status of ExSetWorker().
822 IN UINTN ExTokenNumber
,
823 IN CONST EFI_GUID
*Guid
,
829 Set value for a dynamic PCD entry.
831 This routine find the local token number according to dynamic-ex PCD's token
832 space guid and token number firstly, and invoke callback function if this PCD
833 entry registered callback function. Finally, invoken general SetWorker to set
836 @param ExTokenNumber Dynamic-ex PCD token number.
837 @param Guid Token space guid for dynamic-ex PCD.
838 @param Data PCD value want to be set
839 @param SetSize Size of value.
840 @param PtrType If TRUE, this PCD entry is pointer type.
841 If FALSE, this PCD entry is not pointer type.
843 @return status of SetWorker().
848 IN UINTN ExTokenNumber
,
849 IN CONST EFI_GUID
*Guid
,
856 Get the PCD entry pointer in PCD database.
858 This routine will visit PCD database to find the PCD entry according to given
859 token number. The given token number is autogened by build tools and it will be
860 translated to local token number. Local token number contains PCD's type and
861 offset of PCD entry in PCD database.
863 @param TokenNumber Token's number, it is autogened by build tools
864 @param GetSize The size of token's value
866 @return PCD entry pointer in PCD database
871 IN UINTN TokenNumber
,
876 Wrapper function for get PCD value for dynamic-ex PCD.
878 @param Guid Token space guid for dynamic-ex PCD.
879 @param ExTokenNumber Token number for dyanmic-ex PCD.
880 @param GetSize The size of dynamic-ex PCD value.
882 @return PCD entry in PCD database.
887 IN CONST EFI_GUID
*Guid
,
888 IN UINTN ExTokenNumber
,
895 UINT32 LocalTokenNumberAlias
;
896 } EX_PCD_ENTRY_ATTRIBUTE
;
899 Get local token number according to dynamic-ex PCD's {token space guid:token number}
901 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
902 in DEC file. PCD database maintain a mapping table that translate pair of {token
903 space guid: token number} to local token number.
905 @param Guid Token space guid for dynamic-ex PCD entry.
906 @param ExTokenNumber Token number for dynamic-ex PCD.
908 @return local token number for dynamic-ex PCD.
912 GetExPcdTokenNumber (
913 IN CONST EFI_GUID
*Guid
,
914 IN UINTN ExTokenNumber
918 The function registers the CallBackOnSet fucntion
919 according to TokenNumber and EFI_GUID space.
921 @param TokenNumber The token number.
922 @param Guid The GUID space.
923 @param CallBackFunction The Callback function to be registered.
924 @param Register To register or unregister the callback function.
926 @retval EFI_SUCCESS If the Callback function is registered.
927 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
928 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
929 slot left in the CallbackFnTable.
932 PeiRegisterCallBackWorker (
933 IN UINTN TokenNumber
,
934 IN CONST EFI_GUID
*Guid
, OPTIONAL
935 IN PCD_PPI_CALLBACK CallBackFunction
,
940 The function builds the PCD database.
948 Get SKU ID tabble from PCD database.
950 @param LocalTokenNumberTableIdx Index of local token number in token number table.
951 @param Database PCD Database in PEI phase
953 @return Pointer to SKU ID array table
958 IN UINTN LocalTokenNumberTableIdx
,
959 IN PEI_PCD_DATABASE
*Database
963 Get index of PCD entry in size table.
965 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
966 @param Database Pointer to PCD database.
968 @return index of PCD entry in size table.
973 IN UINTN LocalTokenNumberTableIdx
,
974 IN PEI_PCD_DATABASE
*Database
978 Get PCD value's size for POINTER type PCD.
980 The POINTER type PCD's value will be stored into a buffer in specificed size.
981 The max size of this PCD's value is described in PCD's definition in DEC file.
983 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
984 @param MaxSize Maxmium size of PCD's value
985 @param Database Pcd database in PEI phase.
987 @return PCD value's size for POINTER type PCD.
992 IN UINTN LocalTokenNumberTableIdx
,
994 IN PEI_PCD_DATABASE
*Database
998 Set PCD value's size for POINTER type PCD.
1000 The POINTER type PCD's value will be stored into a buffer in specificed size.
1001 The max size of this PCD's value is described in PCD's definition in DEC file.
1003 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1004 @param CurrentSize Maxmium size of PCD's value
1005 @param Database Pcd database in PEI phase.
1007 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1008 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1013 IN UINTN LocalTokenNumberTableIdx
,
1014 IN OUT UINTN
*CurrentSize
,
1015 IN PEI_PCD_DATABASE
*Database
1019 // The init Database created by PCD Database generation tool
1021 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;