2 Private functions used by PCD PEIM.
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.
14 Module Name: Service.h
18 #ifndef _PEI_PCD_SERVICE_H_
19 #define _PEI_PCD_SERVICE_H_
22 #include <Ppi/ReadOnlyVariable2.h>
24 #include <Library/DebugLib.h>
25 #include <Library/PeimEntryPoint.h>
26 #include <Library/BaseLib.h>
27 #include <Library/HobLib.h>
28 #include <Library/PeiServicesLib.h>
29 #include <Library/PcdLib.h>
30 #include <Library/PeiServicesTablePointerLib.h>
31 #include <Library/BaseMemoryLib.h>
35 // Please make sure the PCD Serivce PEIM Version is consistent with
36 // the version of PCD Database generation tool
38 #define PCD_SERVICE_PEIM_VERSION 2
41 // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h
42 // and generated by PCD Database generation tool.
44 //#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )
45 // #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"
49 // PPI Interface Implementation Declaration.
53 Sets the SKU value for subsequent calls to set or get PCD token values.
55 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
56 SetSku() is normally called only once by the system.
58 For each item (token), the database can hold a single value that applies to all SKUs,
59 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
60 SKU-specific values are called SKU enabled.
62 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
63 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
64 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
65 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
66 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
67 set for that Id, the results are unpredictable.
69 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
70 set values associated with a PCD token.
83 Retrieves an 8-bit value for a given PCD token.
85 Retrieves the current byte-sized value for a PCD token number.
86 If the TokenNumber is invalid, the results are unpredictable.
88 @param[in] TokenNumber The PCD token number.
90 @return The UINT8 value.
101 Retrieves an 16-bit value for a given PCD token.
103 Retrieves the current 16-bits value for a PCD token number.
104 If the TokenNumber is invalid, the results are unpredictable.
106 @param[in] TokenNumber The PCD token number.
108 @return The UINT16 value.
119 Retrieves an 32-bit value for a given PCD token.
121 Retrieves the current 32-bits value for a PCD token number.
122 If the TokenNumber is invalid, the results are unpredictable.
124 @param[in] TokenNumber The PCD token number.
126 @return The UINT32 value.
137 Retrieves an 64-bit value for a given PCD token.
139 Retrieves the current 64-bits value for a PCD token number.
140 If the TokenNumber is invalid, the results are unpredictable.
142 @param[in] TokenNumber The PCD token number.
144 @return The UINT64 value.
155 Retrieves a pointer to a value for a given PCD token.
157 Retrieves the current pointer to the buffer for a PCD token number.
158 Do not make any assumptions about the alignment of the pointer that
159 is returned by this function call. If the TokenNumber is invalid,
160 the results are unpredictable.
162 @param[in] TokenNumber The PCD token number.
164 @return The pointer to the buffer to be retrived.
175 Retrieves a Boolean value for a given PCD token.
177 Retrieves the current boolean value for a PCD token number.
178 Do not make any assumptions about the alignment of the pointer that
179 is returned by this function call. If the TokenNumber is invalid,
180 the results are unpredictable.
182 @param[in] TokenNumber The PCD token number.
184 @return The Boolean value.
195 Retrieves the size of the value for a given PCD token.
197 Retrieves the current size of a particular PCD token.
198 If the TokenNumber is invalid, the results are unpredictable.
200 @param[in] TokenNumber The PCD token number.
202 @return The size of the value for the PCD token.
213 Retrieves an 8-bit value for a given PCD token.
215 Retrieves the 8-bit value of a particular PCD token.
216 If the TokenNumber is invalid or the token space
217 specified by Guid does not exist, the results are
220 @param[in] Guid The token space for the token number.
221 @param[in] TokenNumber The PCD token number.
223 @return The size 8-bit value for the PCD token.
229 IN CONST EFI_GUID
*Guid
,
235 Retrieves an 16-bit value for a given PCD token.
237 Retrieves the 16-bit value of a particular PCD token.
238 If the TokenNumber is invalid or the token space
239 specified by Guid does not exist, the results are
242 @param[in] Guid The token space for the token number.
243 @param[in] TokenNumber The PCD token number.
245 @return The size 16-bit value for the PCD token.
251 IN CONST EFI_GUID
*Guid
,
257 Retrieves an 32-bit value for a given PCD token.
259 Retrieves the 32-bit value of a particular PCD token.
260 If the TokenNumber is invalid or the token space
261 specified by Guid does not exist, the results are
264 @param[in] Guid The token space for the token number.
265 @param[in] TokenNumber The PCD token number.
267 @return The size 32-bit value for the PCD token.
273 IN CONST EFI_GUID
*Guid
,
279 Retrieves an 64-bit value for a given PCD token.
281 Retrieves the 64-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 64-bit value for the PCD token.
295 IN CONST EFI_GUID
*Guid
,
301 Retrieves a pointer to a value for a given PCD token.
303 Retrieves the current pointer to the buffer for a PCD token number.
304 Do not make any assumptions about the alignment of the pointer that
305 is returned by this function call. If the TokenNumber is invalid,
306 the results are unpredictable.
308 @param[in] Guid The token space for the token number.
309 @param[in] TokenNumber The PCD token number.
311 @return The pointer to the buffer to be retrived.
317 IN CONST EFI_GUID
*Guid
,
323 Retrieves an Boolean value for a given PCD token.
325 Retrieves the Boolean value of a particular PCD token.
326 If the TokenNumber is invalid or the token space
327 specified by Guid does not exist, the results are
330 @param[in] Guid The token space for the token number.
331 @param[in] TokenNumber The PCD token number.
333 @return The size Boolean value for the PCD token.
339 IN CONST EFI_GUID
*Guid
,
345 Retrieves the size of the value for a given PCD token.
347 Retrieves the current size of a particular PCD token.
348 If the TokenNumber is invalid, the results are unpredictable.
350 @param[in] Guid The token space for the token number.
351 @param[in] TokenNumber The PCD token number.
353 @return The size of the value for the PCD token.
359 IN CONST EFI_GUID
*Guid
,
365 Sets an 8-bit value for a given PCD token.
367 When the PCD service sets a value, it will check to ensure that the
368 size of the value being set is compatible with the Token's existing definition.
369 If it is not, an error will be returned.
371 @param[in] TokenNumber The PCD token number.
372 @param[in] Value The value to set for the PCD token.
374 @retval EFI_SUCCESS Procedure returned successfully.
375 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
376 being set was incompatible with a call to this function.
377 Use GetSize() to retrieve the size of the target data.
378 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
384 IN UINTN TokenNumber
,
390 Sets an 16-bit value for a given PCD token.
392 When the PCD service sets a value, it will check to ensure that the
393 size of the value being set is compatible with the Token's existing definition.
394 If it is not, an error will be returned.
396 @param[in] TokenNumber The PCD token number.
397 @param[in] Value The value to set for the PCD token.
399 @retval EFI_SUCCESS Procedure returned successfully.
400 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
401 being set was incompatible with a call to this function.
402 Use GetSize() to retrieve the size of the target data.
403 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
409 IN UINTN TokenNumber
,
415 Sets an 32-bit value for a given PCD token.
417 When the PCD service sets a value, it will check to ensure that the
418 size of the value being set is compatible with the Token's existing definition.
419 If it is not, an error will be returned.
421 @param[in] TokenNumber The PCD token number.
422 @param[in] Value The value to set for the PCD token.
424 @retval EFI_SUCCESS Procedure returned successfully.
425 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
426 being set was incompatible with a call to this function.
427 Use GetSize() to retrieve the size of the target data.
428 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
434 IN UINTN TokenNumber
,
440 Sets an 64-bit value for a given PCD token.
442 When the PCD service sets a value, it will check to ensure that the
443 size of the value being set is compatible with the Token's existing definition.
444 If it is not, an error will be returned.
446 @param[in] TokenNumber The PCD token number.
447 @param[in] Value The value to set for the PCD token.
449 @retval EFI_SUCCESS Procedure returned successfully.
450 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
451 being set was incompatible with a call to this function.
452 Use GetSize() to retrieve the size of the target data.
453 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
459 IN UINTN TokenNumber
,
465 Sets a value of a specified size for a given PCD token.
467 When the PCD service sets a value, it will check to ensure that the
468 size of the value being set is compatible with the Token's existing definition.
469 If it is not, an error will be returned.
471 @param[in] TokenNumber The PCD token number.
472 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
473 On input, if the SizeOfValue is greater than the maximum size supported
474 for this TokenNumber then the output value of SizeOfValue will reflect
475 the maximum size supported for this TokenNumber.
476 @param[in] Buffer The buffer to set for the PCD token.
478 @retval EFI_SUCCESS Procedure returned successfully.
479 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
480 being set was incompatible with a call to this function.
481 Use GetSize() to retrieve the size of the target data.
482 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
488 IN UINTN TokenNumber
,
489 IN OUT UINTN
*SizeOfBuffer
,
495 Sets an Boolean value for a given PCD token.
497 When the PCD service sets a value, it will check to ensure that the
498 size of the value being set is compatible with the Token's existing definition.
499 If it is not, an error will be returned.
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 UINTN TokenNumber
,
520 Sets an 8-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
,
547 Sets an 16-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
,
574 Sets an 32-bit value for a given PCD token.
576 When the PCD service sets a value, it will check to ensure that the
577 size of the value being set is compatible with the Token's existing definition.
578 If it is not, an error will be returned.
580 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
581 @param[in] TokenNumber The PCD token number.
582 @param[in] Value The value to set for the PCD token.
584 @retval EFI_SUCCESS Procedure returned successfully.
585 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
586 being set was incompatible with a call to this function.
587 Use GetSize() to retrieve the size of the target data.
588 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
594 IN CONST EFI_GUID
*Guid
,
595 IN UINTN TokenNumber
,
601 Sets an 64-bit value for a given PCD token.
603 When the PCD service sets a value, it will check to ensure that the
604 size of the value being set is compatible with the Token's existing definition.
605 If it is not, an error will be returned.
607 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
608 @param[in] TokenNumber The PCD token number.
609 @param[in] Value The value to set for the PCD token.
611 @retval EFI_SUCCESS Procedure returned successfully.
612 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
613 being set was incompatible with a call to this function.
614 Use GetSize() to retrieve the size of the target data.
615 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
621 IN CONST EFI_GUID
*Guid
,
622 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[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
635 @param[in] TokenNumber The PCD token number.
636 @param[in, out] 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[in] 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.
652 IN CONST EFI_GUID
*Guid
,
653 IN UINTN TokenNumber
,
654 IN OUT UINTN
*SizeOfBuffer
,
660 Sets an Boolean value for a given PCD token.
662 When the PCD service sets a value, it will check to ensure that the
663 size of the value being set is compatible with the Token's existing definition.
664 If it is not, an error will be returned.
666 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
667 @param[in] TokenNumber The PCD token number.
668 @param[in] Value The value 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
,
687 Specifies a function to be called anytime the value of a designated token is changed.
689 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
690 @param[in] TokenNumber The PCD token number.
691 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
693 @retval EFI_SUCCESS The PCD service has successfully established a call event
694 for the CallBackToken requested.
695 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
700 PeiRegisterCallBackOnSet (
701 IN CONST EFI_GUID
*Guid
, OPTIONAL
702 IN UINTN TokenNumber
,
703 IN PCD_PPI_CALLBACK CallBackFunction
708 Cancels a previously set callback function for a particular PCD token number.
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 PcdUnRegisterCallBackOnSet (
722 IN CONST EFI_GUID
*Guid
, OPTIONAL
723 IN UINTN TokenNumber
,
724 IN PCD_PPI_CALLBACK CallBackFunction
729 Retrieves the next valid PCD token for a given namespace.
731 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
732 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
733 If the input token namespace or token number does not exist on the platform,
734 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
735 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
736 there is no valid token number for this token namespace, *TokenNumber will be assigned to
737 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
738 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
740 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
741 is already the last valid token number in the PCD database.
742 In the later case, *TokenNumber is updated with the value of 0.
743 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
749 IN CONST EFI_GUID
*Guid
, OPTIONAL
750 IN OUT UINTN
*TokenNumber
755 Retrieves the next valid PCD token namespace for a given namespace.
757 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
758 a known token namespace from which the search will start. On output,
759 it designates the next valid token namespace on the platform. If the input
760 token namespace does not exist on the platform, an error is returned and
761 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
762 first token space of the current platform is assigned to *Guid the function
763 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
764 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
765 and the function return EFI_SUCCESS. If this input token namespace is the last
766 namespace on the platform, *Guid will be assigned to NULL and the function return
769 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
770 Or the input token space Guid is already the last valid token space Guid
771 in the PCD database. In the later case, *Guid is updated with the value of NULL.
772 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
777 PeiPcdGetNextTokenSpace (
778 IN OUT CONST EFI_GUID
**Guid
783 /* Internal Function definitions */
785 Get PCD database from GUID HOB in PEI phase.
787 @return Pointer to PCD database.
797 Wrapper function for setting non-pointer type value for a PCD entry.
799 @param TokenNumber Pcd token number autogenerated by build tools.
800 @param Data Value want to be set for PCD entry
801 @param Size Size of value.
803 @return status of SetWorker.
808 IN UINTN TokenNumber
,
815 Set value for an PCD entry
817 @param TokenNumber Pcd token number autogenerated by build tools.
818 @param Data Value want to be set for PCD entry
819 @param Size Size of value.
820 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
821 If False, the type of PCD entry's value is not Pointer.
823 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
824 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
825 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
826 range of UINT8, UINT16, UINT32, UINT64
827 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
831 IN UINTN TokenNumber
,
839 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
841 @param ExTokenNumber Token number for dynamic-ex PCD.
842 @param Guid Token space guid for dynamic-ex PCD.
843 @param Data Value want to be set.
844 @param SetSize The size of value.
846 @return status of ExSetWorker().
851 IN UINTN ExTokenNumber
,
852 IN CONST EFI_GUID
*Guid
,
859 Set value for a dynamic PCD entry.
861 This routine find the local token number according to dynamic-ex PCD's token
862 space guid and token number firstly, and invoke callback function if this PCD
863 entry registered callback function. Finally, invoken general SetWorker to set
866 @param ExTokenNumber Dynamic-ex PCD token number.
867 @param Guid Token space guid for dynamic-ex PCD.
868 @param Data PCD value want to be set
869 @param SetSize Size of value.
870 @param PtrType If TRUE, this PCD entry is pointer type.
871 If FALSE, this PCD entry is not pointer type.
873 @return status of SetWorker().
878 IN UINTN ExTokenNumber
,
879 IN CONST EFI_GUID
*Guid
,
887 Get the PCD entry pointer in PCD database.
889 This routine will visit PCD database to find the PCD entry according to given
890 token number. The given token number is autogened by build tools and it will be
891 translated to local token number. Local token number contains PCD's type and
892 offset of PCD entry in PCD database.
894 @param TokenNumber Token's number, it is autogened by build tools
895 @param GetSize The size of token's value
897 @return PCD entry pointer in PCD database
902 IN UINTN TokenNumber
,
908 Wrapper function for get PCD value for dynamic-ex PCD.
910 @param Guid Token space guid for dynamic-ex PCD.
911 @param ExTokenNumber Token number for dyanmic-ex PCD.
912 @param GetSize The size of dynamic-ex PCD value.
914 @return PCD entry in PCD database.
919 IN CONST EFI_GUID
*Guid
,
920 IN UINTN ExTokenNumber
,
928 UINT32 LocalTokenNumberAlias
;
929 } EX_PCD_ENTRY_ATTRIBUTE
;
932 Get local token number according to dynamic-ex PCD's {token space guid:token number}
934 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
935 in DEC file. PCD database maintain a mapping table that translate pair of {token
936 space guid: token number} to local token number.
938 @param Guid Token space guid for dynamic-ex PCD entry.
939 @param ExTokenNumber EDES_TODO: Add parameter description
941 @return local token number for dynamic-ex PCD.
945 GetExPcdTokenNumber (
946 IN CONST EFI_GUID
*Guid
,
947 IN UINTN ExTokenNumber
952 The function registers the CallBackOnSet fucntion
953 according to TokenNumber and EFI_GUID space.
955 @param TokenNumber The token number.
956 @param Guid The GUID space.
957 @param CallBackFunction The Callback function to be registered.
958 @param Register To register or unregister the callback function.
960 @retval EFI_SUCCESS If the Callback function is registered.
961 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
962 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
963 slot left in the CallbackFnTable.
966 PeiRegisterCallBackWorker (
967 IN UINTN TokenNumber
,
968 IN CONST EFI_GUID
*Guid
, OPTIONAL
969 IN PCD_PPI_CALLBACK CallBackFunction
,
974 The function builds the PCD database.
983 Get SKU ID tabble from PCD database.
985 @param LocalTokenNumberTableIdx Index of local token number in token number table.
986 @param Database PCD Database in PEI phase
988 @return Pointer to SKU ID array table
993 IN UINTN LocalTokenNumberTableIdx
,
994 IN PEI_PCD_DATABASE
*Database
999 Get index of PCD entry in size table.
1001 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
1002 @param Database Pointer to PCD database.
1004 @return index of PCD entry in size table.
1009 IN UINTN LocalTokenNumberTableIdx
,
1010 IN PEI_PCD_DATABASE
*Database
1015 Get PCD value's size for POINTER type PCD.
1017 The POINTER type PCD's value will be stored into a buffer in specificed size.
1018 The max size of this PCD's value is described in PCD's definition in DEC file.
1020 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1021 @param MaxSize Maxmium size of PCD's value
1022 @param Database Pcd database in PEI phase.
1024 @return PCD value's size for POINTER type PCD.
1029 IN UINTN LocalTokenNumberTableIdx
,
1031 IN PEI_PCD_DATABASE
*Database
1036 Set PCD value's size for POINTER type PCD.
1038 The POINTER type PCD's value will be stored into a buffer in specificed size.
1039 The max size of this PCD's value is described in PCD's definition in DEC file.
1041 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1042 @param CurrentSize Maxmium size of PCD's value
1043 @param Database Pcd database in PEI phase.
1045 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1046 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1051 IN UINTN LocalTokenNumberTableIdx
,
1052 IN OUT UINTN
*CurrentSize
,
1053 IN PEI_PCD_DATABASE
*Database
1058 extern EFI_GUID gPcdDataBaseHobGuid
;
1060 extern EFI_GUID gPcdPeiCallbackFnTableHobGuid
;
1062 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;