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.
82 Retrieves an 8-bit value for a given PCD token.
84 Retrieves the current byte-sized value for a PCD token number.
85 If the TokenNumber is invalid, the results are unpredictable.
87 @param[in] TokenNumber The PCD token number.
89 @return The UINT8 value.
99 Retrieves an 16-bit value for a given PCD token.
101 Retrieves the current 16-bits value for a PCD token number.
102 If the TokenNumber is invalid, the results are unpredictable.
104 @param[in] TokenNumber The PCD token number.
106 @return The UINT16 value.
116 Retrieves an 32-bit value for a given PCD token.
118 Retrieves the current 32-bits value for a PCD token number.
119 If the TokenNumber is invalid, the results are unpredictable.
121 @param[in] TokenNumber The PCD token number.
123 @return The UINT32 value.
133 Retrieves an 64-bit value for a given PCD token.
135 Retrieves the current 64-bits value for a PCD token number.
136 If the TokenNumber is invalid, the results are unpredictable.
138 @param[in] TokenNumber The PCD token number.
140 @return The UINT64 value.
150 Retrieves a pointer to a value for a given PCD token.
152 Retrieves the current pointer to the buffer for a PCD token number.
153 Do not make any assumptions about the alignment of the pointer that
154 is returned by this function call. If the TokenNumber is invalid,
155 the results are unpredictable.
157 @param[in] TokenNumber The PCD token number.
159 @return The pointer to the buffer to be retrived.
169 Retrieves a Boolean value for a given PCD token.
171 Retrieves the current boolean value for a PCD token number.
172 Do not make any assumptions about the alignment of the pointer that
173 is returned by this function call. If the TokenNumber is invalid,
174 the results are unpredictable.
176 @param[in] TokenNumber The PCD token number.
178 @return The Boolean value.
188 Retrieves the size of the value for a given PCD token.
190 Retrieves the current size of a particular PCD token.
191 If the TokenNumber is invalid, the results are unpredictable.
193 @param[in] TokenNumber The PCD token number.
195 @return The size of the value for the PCD token.
205 Retrieves an 8-bit value for a given PCD token.
207 Retrieves the 8-bit value of a particular PCD token.
208 If the TokenNumber is invalid or the token space
209 specified by Guid does not exist, the results are
212 @param[in] Guid The token space for the token number.
213 @param[in] TokenNumber The PCD token number.
215 @return The size 8-bit value for the PCD token.
221 IN CONST EFI_GUID
*Guid
,
226 Retrieves an 16-bit value for a given PCD token.
228 Retrieves the 16-bit value of a particular PCD token.
229 If the TokenNumber is invalid or the token space
230 specified by Guid does not exist, the results are
233 @param[in] Guid The token space for the token number.
234 @param[in] TokenNumber The PCD token number.
236 @return The size 16-bit value for the PCD token.
242 IN CONST EFI_GUID
*Guid
,
247 Retrieves an 32-bit value for a given PCD token.
249 Retrieves the 32-bit value of a particular PCD token.
250 If the TokenNumber is invalid or the token space
251 specified by Guid does not exist, the results are
254 @param[in] Guid The token space for the token number.
255 @param[in] TokenNumber The PCD token number.
257 @return The size 32-bit value for the PCD token.
263 IN CONST EFI_GUID
*Guid
,
268 Retrieves an 64-bit value for a given PCD token.
270 Retrieves the 64-bit value of a particular PCD token.
271 If the TokenNumber is invalid or the token space
272 specified by Guid does not exist, the results are
275 @param[in] Guid The token space for the token number.
276 @param[in] TokenNumber The PCD token number.
278 @return The size 64-bit value for the PCD token.
284 IN CONST EFI_GUID
*Guid
,
289 Retrieves a pointer to a value for a given PCD token.
291 Retrieves the current pointer to the buffer for a PCD token number.
292 Do not make any assumptions about the alignment of the pointer that
293 is returned by this function call. If the TokenNumber is invalid,
294 the results are unpredictable.
296 @param[in] Guid The token space for the token number.
297 @param[in] TokenNumber The PCD token number.
299 @return The pointer to the buffer to be retrived.
305 IN CONST EFI_GUID
*Guid
,
310 Retrieves an Boolean value for a given PCD token.
312 Retrieves the Boolean value of a particular PCD token.
313 If the TokenNumber is invalid or the token space
314 specified by Guid does not exist, the results are
317 @param[in] Guid The token space for the token number.
318 @param[in] TokenNumber The PCD token number.
320 @return The size Boolean value for the PCD token.
326 IN CONST EFI_GUID
*Guid
,
331 Retrieves the size of the value for a given PCD token.
333 Retrieves the current size of a particular PCD token.
334 If the TokenNumber is invalid, the results are unpredictable.
336 @param[in] Guid The token space for the token number.
337 @param[in] TokenNumber The PCD token number.
339 @return The size of the value for the PCD token.
345 IN CONST EFI_GUID
*Guid
,
350 Sets an 8-bit value for a given PCD token.
352 When the PCD service sets a value, it will check to ensure that the
353 size of the value being set is compatible with the Token's existing definition.
354 If it is not, an error will be returned.
356 @param[in] TokenNumber The PCD token number.
357 @param[in] Value The value to set for the PCD token.
359 @retval EFI_SUCCESS Procedure returned successfully.
360 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
361 being set was incompatible with a call to this function.
362 Use GetSize() to retrieve the size of the target data.
363 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
369 IN UINTN TokenNumber
,
374 Sets an 16-bit value for a given PCD token.
376 When the PCD service sets a value, it will check to ensure that the
377 size of the value being set is compatible with the Token's existing definition.
378 If it is not, an error will be returned.
380 @param[in] TokenNumber The PCD token number.
381 @param[in] Value The value to set for the PCD token.
383 @retval EFI_SUCCESS Procedure returned successfully.
384 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
385 being set was incompatible with a call to this function.
386 Use GetSize() to retrieve the size of the target data.
387 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
393 IN UINTN TokenNumber
,
398 Sets an 32-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 64-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 a value of a specified size 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, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
454 On input, if the SizeOfValue is greater than the maximum size supported
455 for this TokenNumber then the output value of SizeOfValue will reflect
456 the maximum size supported for this TokenNumber.
457 @param[in] Buffer The buffer to set for the PCD token.
459 @retval EFI_SUCCESS Procedure returned successfully.
460 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
461 being set was incompatible with a call to this function.
462 Use GetSize() to retrieve the size of the target data.
463 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
469 IN UINTN TokenNumber
,
470 IN OUT UINTN
*SizeOfBuffer
,
475 Sets an Boolean 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 an 8-bit value 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] Guid The 128-bit unique value that designates the namespace from which to extract the value.
506 @param[in] TokenNumber The PCD token number.
507 @param[in] Value The value to set for the PCD token.
509 @retval EFI_SUCCESS Procedure returned successfully.
510 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
511 being set was incompatible with a call to this function.
512 Use GetSize() to retrieve the size of the target data.
513 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
519 IN CONST EFI_GUID
*Guid
,
520 IN UINTN TokenNumber
,
525 Sets an 16-bit value for a given PCD token.
527 When the PCD service sets a value, it will check to ensure that the
528 size of the value being set is compatible with the Token's existing definition.
529 If it is not, an error will be returned.
531 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
532 @param[in] TokenNumber The PCD token number.
533 @param[in] Value The value to set for the PCD token.
535 @retval EFI_SUCCESS Procedure returned successfully.
536 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
537 being set was incompatible with a call to this function.
538 Use GetSize() to retrieve the size of the target data.
539 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
545 IN CONST EFI_GUID
*Guid
,
546 IN UINTN TokenNumber
,
551 Sets an 32-bit value for a given PCD token.
553 When the PCD service sets a value, it will check to ensure that the
554 size of the value being set is compatible with the Token's existing definition.
555 If it is not, an error will be returned.
557 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
558 @param[in] TokenNumber The PCD token number.
559 @param[in] Value The value to set for the PCD token.
561 @retval EFI_SUCCESS Procedure returned successfully.
562 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
563 being set was incompatible with a call to this function.
564 Use GetSize() to retrieve the size of the target data.
565 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
571 IN CONST EFI_GUID
*Guid
,
572 IN UINTN TokenNumber
,
577 Sets an 64-bit value for a given PCD token.
579 When the PCD service sets a value, it will check to ensure that the
580 size of the value being set is compatible with the Token's existing definition.
581 If it is not, an error will be returned.
583 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
584 @param[in] TokenNumber The PCD token number.
585 @param[in] Value The value to set for the PCD token.
587 @retval EFI_SUCCESS Procedure returned successfully.
588 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
589 being set was incompatible with a call to this function.
590 Use GetSize() to retrieve the size of the target data.
591 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
597 IN CONST EFI_GUID
*Guid
,
598 IN UINTN TokenNumber
,
603 Sets a value of a specified size for a given PCD token.
605 When the PCD service sets a value, it will check to ensure that the
606 size of the value being set is compatible with the Token's existing definition.
607 If it is not, an error will be returned.
609 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
610 @param[in] TokenNumber The PCD token number.
611 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
612 On input, if the SizeOfValue is greater than the maximum size supported
613 for this TokenNumber then the output value of SizeOfValue will reflect
614 the maximum size supported for this TokenNumber.
615 @param[in] Buffer The buffer to set for the PCD token.
617 @retval EFI_SUCCESS Procedure returned successfully.
618 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
619 being set was incompatible with a call to this function.
620 Use GetSize() to retrieve the size of the target data.
621 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
627 IN CONST EFI_GUID
*Guid
,
628 IN UINTN TokenNumber
,
629 IN OUT UINTN
*SizeOfBuffer
,
634 Sets an Boolean value for a given PCD token.
636 When the PCD service sets a value, it will check to ensure that the
637 size of the value being set is compatible with the Token's existing definition.
638 If it is not, an error will be returned.
640 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
641 @param[in] TokenNumber The PCD token number.
642 @param[in] Value The value to set for the PCD token.
644 @retval EFI_SUCCESS Procedure returned successfully.
645 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
646 being set was incompatible with a call to this function.
647 Use GetSize() to retrieve the size of the target data.
648 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
654 IN CONST EFI_GUID
*Guid
,
655 IN UINTN TokenNumber
,
660 Specifies a function to be called anytime the value of a designated token is changed.
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] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
666 @retval EFI_SUCCESS The PCD service has successfully established a call event
667 for the CallBackToken requested.
668 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
673 PeiRegisterCallBackOnSet (
674 IN CONST EFI_GUID
*Guid
, OPTIONAL
675 IN UINTN TokenNumber
,
676 IN PCD_PPI_CALLBACK CallBackFunction
680 Cancels a previously set callback function for a particular PCD token number.
682 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
683 @param [in] TokenNumber The PCD token number.
684 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
686 @retval EFI_SUCCESS The PCD service has successfully established a call event
687 for the CallBackToken requested.
688 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
693 PcdUnRegisterCallBackOnSet (
694 IN CONST EFI_GUID
*Guid
, OPTIONAL
695 IN UINTN TokenNumber
,
696 IN PCD_PPI_CALLBACK CallBackFunction
700 Retrieves the next valid PCD token for a given namespace.
702 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
703 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
704 If the input token namespace or token number does not exist on the platform,
705 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
706 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
707 there is no valid token number for this token namespace, *TokenNumber will be assigned to
708 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
709 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
711 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
712 is already the last valid token number in the PCD database.
713 In the later case, *TokenNumber is updated with the value of 0.
714 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
720 IN CONST EFI_GUID
*Guid
, OPTIONAL
721 IN OUT UINTN
*TokenNumber
725 Retrieves the next valid PCD token namespace for a given namespace.
727 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
728 a known token namespace from which the search will start. On output,
729 it designates the next valid token namespace on the platform. If the input
730 token namespace does not exist on the platform, an error is returned and
731 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
732 first token space of the current platform is assigned to *Guid the function
733 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
734 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
735 and the function return EFI_SUCCESS. If this input token namespace is the last
736 namespace on the platform, *Guid will be assigned to NULL and the function return
739 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
740 Or the input token space Guid is already the last valid token space Guid
741 in the PCD database. In the later case, *Guid is updated with the value of NULL.
742 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
747 PeiPcdGetNextTokenSpace (
748 IN OUT CONST EFI_GUID
**Guid
752 /* Internal Function definitions */
754 Get PCD database from GUID HOB in PEI phase.
756 @return Pointer to PCD database.
765 Wrapper function for setting non-pointer type value for a PCD entry.
767 @param TokenNumber Pcd token number autogenerated by build tools.
768 @param Data Value want to be set for PCD entry
769 @param Size Size of value.
771 @return status of SetWorker.
776 IN UINTN TokenNumber
,
782 Set value for an PCD entry
784 @param TokenNumber Pcd token number autogenerated by build tools.
785 @param Data Value want to be set for PCD entry
786 @param Size Size of value.
787 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
788 If False, the type of PCD entry's value is not Pointer.
790 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
791 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
792 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
793 range of UINT8, UINT16, UINT32, UINT64
794 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
798 IN UINTN TokenNumber
,
805 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
807 @param ExTokenNumber Token number for dynamic-ex PCD.
808 @param Guid Token space guid for dynamic-ex PCD.
809 @param Data Value want to be set.
810 @param SetSize The size of value.
812 @return status of ExSetWorker().
817 IN UINTN ExTokenNumber
,
818 IN CONST EFI_GUID
*Guid
,
824 Set value for a dynamic PCD entry.
826 This routine find the local token number according to dynamic-ex PCD's token
827 space guid and token number firstly, and invoke callback function if this PCD
828 entry registered callback function. Finally, invoken general SetWorker to set
831 @param ExTokenNumber Dynamic-ex PCD token number.
832 @param Guid Token space guid for dynamic-ex PCD.
833 @param Data PCD value want to be set
834 @param SetSize Size of value.
835 @param PtrType If TRUE, this PCD entry is pointer type.
836 If FALSE, this PCD entry is not pointer type.
838 @return status of SetWorker().
843 IN UINTN ExTokenNumber
,
844 IN CONST EFI_GUID
*Guid
,
851 Get the PCD entry pointer in PCD database.
853 This routine will visit PCD database to find the PCD entry according to given
854 token number. The given token number is autogened by build tools and it will be
855 translated to local token number. Local token number contains PCD's type and
856 offset of PCD entry in PCD database.
858 @param TokenNumber Token's number, it is autogened by build tools
859 @param GetSize The size of token's value
861 @return PCD entry pointer in PCD database
866 IN UINTN TokenNumber
,
871 Wrapper function for get PCD value for dynamic-ex PCD.
873 @param Guid Token space guid for dynamic-ex PCD.
874 @param ExTokenNumber Token number for dyanmic-ex PCD.
875 @param GetSize The size of dynamic-ex PCD value.
877 @return PCD entry in PCD database.
882 IN CONST EFI_GUID
*Guid
,
883 IN UINTN ExTokenNumber
,
890 UINT32 LocalTokenNumberAlias
;
891 } EX_PCD_ENTRY_ATTRIBUTE
;
894 Get local token number according to dynamic-ex PCD's {token space guid:token number}
896 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
897 in DEC file. PCD database maintain a mapping table that translate pair of {token
898 space guid: token number} to local token number.
900 @param Guid Token space guid for dynamic-ex PCD entry.
901 @param ExTokenNumber EDES_TODO: Add parameter description
903 @return local token number for dynamic-ex PCD.
907 GetExPcdTokenNumber (
908 IN CONST EFI_GUID
*Guid
,
909 IN UINTN ExTokenNumber
913 The function registers the CallBackOnSet fucntion
914 according to TokenNumber and EFI_GUID space.
916 @param TokenNumber The token number.
917 @param Guid The GUID space.
918 @param CallBackFunction The Callback function to be registered.
919 @param Register To register or unregister the callback function.
921 @retval EFI_SUCCESS If the Callback function is registered.
922 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
923 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
924 slot left in the CallbackFnTable.
927 PeiRegisterCallBackWorker (
928 IN UINTN TokenNumber
,
929 IN CONST EFI_GUID
*Guid
, OPTIONAL
930 IN PCD_PPI_CALLBACK CallBackFunction
,
935 The function builds the PCD database.
943 Get SKU ID tabble from PCD database.
945 @param LocalTokenNumberTableIdx Index of local token number in token number table.
946 @param Database PCD Database in PEI phase
948 @return Pointer to SKU ID array table
953 IN UINTN LocalTokenNumberTableIdx
,
954 IN PEI_PCD_DATABASE
*Database
958 Get index of PCD entry in size table.
960 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
961 @param Database Pointer to PCD database.
963 @return index of PCD entry in size table.
968 IN UINTN LocalTokenNumberTableIdx
,
969 IN PEI_PCD_DATABASE
*Database
973 Get PCD value's size for POINTER type PCD.
975 The POINTER type PCD's value will be stored into a buffer in specificed size.
976 The max size of this PCD's value is described in PCD's definition in DEC file.
978 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
979 @param MaxSize Maxmium size of PCD's value
980 @param Database Pcd database in PEI phase.
982 @return PCD value's size for POINTER type PCD.
987 IN UINTN LocalTokenNumberTableIdx
,
989 IN PEI_PCD_DATABASE
*Database
993 Set PCD value's size for POINTER type PCD.
995 The POINTER type PCD's value will be stored into a buffer in specificed size.
996 The max size of this PCD's value is described in PCD's definition in DEC file.
998 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
999 @param CurrentSize Maxmium size of PCD's value
1000 @param Database Pcd database in PEI phase.
1002 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1003 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1008 IN UINTN LocalTokenNumberTableIdx
,
1009 IN OUT UINTN
*CurrentSize
,
1010 IN PEI_PCD_DATABASE
*Database
1014 extern EFI_GUID gPcdDataBaseHobGuid
;
1016 extern EFI_GUID gPcdPeiCallbackFnTableHobGuid
;
1018 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;