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/BaseMemoryLib.h>
34 // Please make sure the PCD Serivce PEIM Version is consistent with
35 // the version of PCD Database generation tool
37 #define PCD_SERVICE_PEIM_VERSION 2
40 // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h
41 // and generated by PCD Database generation tool.
43 //#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )
44 // #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"
48 // PPI Interface Implementation Declaration.
52 Sets the SKU value for subsequent calls to set or get PCD token values.
54 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
55 SetSku() is normally called only once by the system.
57 For each item (token), the database can hold a single value that applies to all SKUs,
58 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
59 SKU-specific values are called SKU enabled.
61 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
62 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
63 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
64 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
65 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
66 set for that Id, the results are unpredictable.
68 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
69 set values associated with a PCD token.
79 Retrieves an 8-bit value for a given PCD token.
81 Retrieves the current byte-sized value for a PCD token number.
82 If the TokenNumber is invalid, the results are unpredictable.
84 @param[in] TokenNumber The PCD token number.
86 @return The UINT8 value.
96 Retrieves an 16-bit value for a given PCD token.
98 Retrieves the current 16-bits value for a PCD token number.
99 If the TokenNumber is invalid, the results are unpredictable.
101 @param[in] TokenNumber The PCD token number.
103 @return The UINT16 value.
113 Retrieves an 32-bit value for a given PCD token.
115 Retrieves the current 32-bits value for a PCD token number.
116 If the TokenNumber is invalid, the results are unpredictable.
118 @param[in] TokenNumber The PCD token number.
120 @return The UINT32 value.
130 Retrieves an 64-bit value for a given PCD token.
132 Retrieves the current 64-bits value for a PCD token number.
133 If the TokenNumber is invalid, the results are unpredictable.
135 @param[in] TokenNumber The PCD token number.
137 @return The UINT64 value.
147 Retrieves a pointer to a value for a given PCD token.
149 Retrieves the current pointer to the buffer for a PCD token number.
150 Do not make any assumptions about the alignment of the pointer that
151 is returned by this function call. If the TokenNumber is invalid,
152 the results are unpredictable.
154 @param[in] TokenNumber The PCD token number.
156 @return The pointer to the buffer to be retrived.
166 Retrieves a Boolean value for a given PCD token.
168 Retrieves the current boolean value for a PCD token number.
169 Do not make any assumptions about the alignment of the pointer that
170 is returned by this function call. If the TokenNumber is invalid,
171 the results are unpredictable.
173 @param[in] TokenNumber The PCD token number.
175 @return The Boolean value.
185 Retrieves the size of the value for a given PCD token.
187 Retrieves the current size of a particular PCD token.
188 If the TokenNumber is invalid, the results are unpredictable.
190 @param[in] TokenNumber The PCD token number.
192 @return The size of the value for the PCD token.
202 Retrieves an 8-bit value for a given PCD token.
204 Retrieves the 8-bit value of a particular PCD token.
205 If the TokenNumber is invalid or the token space
206 specified by Guid does not exist, the results are
209 @param[in] Guid The token space for the token number.
210 @param[in] TokenNumber The PCD token number.
212 @return The size 8-bit value for the PCD token.
218 IN CONST EFI_GUID
*Guid
,
223 Retrieves an 16-bit value for a given PCD token.
225 Retrieves the 16-bit value of a particular PCD token.
226 If the TokenNumber is invalid or the token space
227 specified by Guid does not exist, the results are
230 @param[in] Guid The token space for the token number.
231 @param[in] TokenNumber The PCD token number.
233 @return The size 16-bit value for the PCD token.
239 IN CONST EFI_GUID
*Guid
,
244 Retrieves an 32-bit value for a given PCD token.
246 Retrieves the 32-bit value of a particular PCD token.
247 If the TokenNumber is invalid or the token space
248 specified by Guid does not exist, the results are
251 @param[in] Guid The token space for the token number.
252 @param[in] TokenNumber The PCD token number.
254 @return The size 32-bit value for the PCD token.
260 IN CONST EFI_GUID
*Guid
,
265 Retrieves an 64-bit value for a given PCD token.
267 Retrieves the 64-bit value of a particular PCD token.
268 If the TokenNumber is invalid or the token space
269 specified by Guid does not exist, the results are
272 @param[in] Guid The token space for the token number.
273 @param[in] TokenNumber The PCD token number.
275 @return The size 64-bit value for the PCD token.
281 IN CONST EFI_GUID
*Guid
,
286 Retrieves a pointer to a value for a given PCD token.
288 Retrieves the current pointer to the buffer for a PCD token number.
289 Do not make any assumptions about the alignment of the pointer that
290 is returned by this function call. If the TokenNumber is invalid,
291 the results are unpredictable.
293 @param[in] Guid The token space for the token number.
294 @param[in] TokenNumber The PCD token number.
296 @return The pointer to the buffer to be retrived.
302 IN CONST EFI_GUID
*Guid
,
307 Retrieves an Boolean value for a given PCD token.
309 Retrieves the Boolean value of a particular PCD token.
310 If the TokenNumber is invalid or the token space
311 specified by Guid does not exist, the results are
314 @param[in] Guid The token space for the token number.
315 @param[in] TokenNumber The PCD token number.
317 @return The size Boolean value for the PCD token.
323 IN CONST EFI_GUID
*Guid
,
328 Retrieves the size of the value for a given PCD token.
330 Retrieves the current size of a particular PCD token.
331 If the TokenNumber is invalid, the results are unpredictable.
333 @param[in] Guid The token space for the token number.
334 @param[in] TokenNumber The PCD token number.
336 @return The size of the value for the PCD token.
342 IN CONST EFI_GUID
*Guid
,
347 Sets an 8-bit value for a given PCD token.
349 When the PCD service sets a value, it will check to ensure that the
350 size of the value being set is compatible with the Token's existing definition.
351 If it is not, an error will be returned.
353 @param[in] TokenNumber The PCD token number.
354 @param[in] Value The value to set for the PCD token.
356 @retval EFI_SUCCESS Procedure returned successfully.
357 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
358 being set was incompatible with a call to this function.
359 Use GetSize() to retrieve the size of the target data.
360 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
366 IN UINTN TokenNumber
,
371 Sets an 16-bit value for a given PCD token.
373 When the PCD service sets a value, it will check to ensure that the
374 size of the value being set is compatible with the Token's existing definition.
375 If it is not, an error will be returned.
377 @param[in] TokenNumber The PCD token number.
378 @param[in] Value The value to set for the PCD token.
380 @retval EFI_SUCCESS Procedure returned successfully.
381 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
382 being set was incompatible with a call to this function.
383 Use GetSize() to retrieve the size of the target data.
384 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
390 IN UINTN TokenNumber
,
395 Sets an 32-bit value for a given PCD token.
397 When the PCD service sets a value, it will check to ensure that the
398 size of the value being set is compatible with the Token's existing definition.
399 If it is not, an error will be returned.
401 @param[in] TokenNumber The PCD token number.
402 @param[in] Value The value to set for the PCD token.
404 @retval EFI_SUCCESS Procedure returned successfully.
405 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
406 being set was incompatible with a call to this function.
407 Use GetSize() to retrieve the size of the target data.
408 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
414 IN UINTN TokenNumber
,
419 Sets an 64-bit value for a given PCD token.
421 When the PCD service sets a value, it will check to ensure that the
422 size of the value being set is compatible with the Token's existing definition.
423 If it is not, an error will be returned.
425 @param[in] TokenNumber The PCD token number.
426 @param[in] Value The value to set for the PCD token.
428 @retval EFI_SUCCESS Procedure returned successfully.
429 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
430 being set was incompatible with a call to this function.
431 Use GetSize() to retrieve the size of the target data.
432 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
438 IN UINTN TokenNumber
,
443 Sets a value of a specified size for a given PCD token.
445 When the PCD service sets a value, it will check to ensure that the
446 size of the value being set is compatible with the Token's existing definition.
447 If it is not, an error will be returned.
449 @param[in] TokenNumber The PCD token number.
450 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
451 On input, if the SizeOfValue is greater than the maximum size supported
452 for this TokenNumber then the output value of SizeOfValue will reflect
453 the maximum size supported for this TokenNumber.
454 @param[in] Buffer The buffer to set for the PCD token.
456 @retval EFI_SUCCESS Procedure returned successfully.
457 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
458 being set was incompatible with a call to this function.
459 Use GetSize() to retrieve the size of the target data.
460 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
466 IN UINTN TokenNumber
,
467 IN OUT UINTN
*SizeOfBuffer
,
472 Sets an Boolean value for a given PCD token.
474 When the PCD service sets a value, it will check to ensure that the
475 size of the value being set is compatible with the Token's existing definition.
476 If it is not, an error will be returned.
478 @param[in] TokenNumber The PCD token number.
479 @param[in] Value The value to set for the PCD token.
481 @retval EFI_SUCCESS Procedure returned successfully.
482 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
483 being set was incompatible with a call to this function.
484 Use GetSize() to retrieve the size of the target data.
485 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
491 IN UINTN TokenNumber
,
496 Sets an 8-bit value for a given PCD token.
498 When the PCD service sets a value, it will check to ensure that the
499 size of the value being set is compatible with the Token's existing definition.
500 If it is not, an error will be returned.
502 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
503 @param[in] TokenNumber The PCD token number.
504 @param[in] Value The value to set for the PCD token.
506 @retval EFI_SUCCESS Procedure returned successfully.
507 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
508 being set was incompatible with a call to this function.
509 Use GetSize() to retrieve the size of the target data.
510 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
516 IN CONST EFI_GUID
*Guid
,
517 IN UINTN TokenNumber
,
522 Sets an 16-bit value for a given PCD token.
524 When the PCD service sets a value, it will check to ensure that the
525 size of the value being set is compatible with the Token's existing definition.
526 If it is not, an error will be returned.
528 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
529 @param[in] TokenNumber The PCD token number.
530 @param[in] Value The value to set for the PCD token.
532 @retval EFI_SUCCESS Procedure returned successfully.
533 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
534 being set was incompatible with a call to this function.
535 Use GetSize() to retrieve the size of the target data.
536 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
542 IN CONST EFI_GUID
*Guid
,
543 IN UINTN TokenNumber
,
548 Sets an 32-bit value for a given PCD token.
550 When the PCD service sets a value, it will check to ensure that the
551 size of the value being set is compatible with the Token's existing definition.
552 If it is not, an error will be returned.
554 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
555 @param[in] TokenNumber The PCD token number.
556 @param[in] Value The value to set for the PCD token.
558 @retval EFI_SUCCESS Procedure returned successfully.
559 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
560 being set was incompatible with a call to this function.
561 Use GetSize() to retrieve the size of the target data.
562 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
568 IN CONST EFI_GUID
*Guid
,
569 IN UINTN TokenNumber
,
574 Sets an 64-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
,
600 Sets a value of a specified size for a given PCD token.
602 When the PCD service sets a value, it will check to ensure that the
603 size of the value being set is compatible with the Token's existing definition.
604 If it is not, an error will be returned.
606 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
607 @param[in] TokenNumber The PCD token number.
608 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
609 On input, if the SizeOfValue is greater than the maximum size supported
610 for this TokenNumber then the output value of SizeOfValue will reflect
611 the maximum size supported for this TokenNumber.
612 @param[in] Buffer The buffer 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
,
626 IN OUT UINTN
*SizeOfBuffer
,
631 Sets an Boolean value for a given PCD token.
633 When the PCD service sets a value, it will check to ensure that the
634 size of the value being set is compatible with the Token's existing definition.
635 If it is not, an error will be returned.
637 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
638 @param[in] TokenNumber The PCD token number.
639 @param[in] Value The value to set for the PCD token.
641 @retval EFI_SUCCESS Procedure returned successfully.
642 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
643 being set was incompatible with a call to this function.
644 Use GetSize() to retrieve the size of the target data.
645 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
651 IN CONST EFI_GUID
*Guid
,
652 IN UINTN TokenNumber
,
657 Specifies a function to be called anytime the value of a designated token is changed.
659 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
660 @param[in] TokenNumber The PCD token number.
661 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
663 @retval EFI_SUCCESS The PCD service has successfully established a call event
664 for the CallBackToken requested.
665 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
670 PeiRegisterCallBackOnSet (
671 IN CONST EFI_GUID
*Guid
, OPTIONAL
672 IN UINTN TokenNumber
,
673 IN PCD_PPI_CALLBACK CallBackFunction
677 Cancels a previously set callback function for a particular PCD token number.
679 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
680 @param [in] TokenNumber The PCD token number.
681 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
683 @retval EFI_SUCCESS The PCD service has successfully established a call event
684 for the CallBackToken requested.
685 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
690 PcdUnRegisterCallBackOnSet (
691 IN CONST EFI_GUID
*Guid
, OPTIONAL
692 IN UINTN TokenNumber
,
693 IN PCD_PPI_CALLBACK CallBackFunction
697 Retrieves the next valid PCD token for a given namespace.
699 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
700 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
701 If the input token namespace or token number does not exist on the platform,
702 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
703 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
704 there is no valid token number for this token namespace, *TokenNumber will be assigned to
705 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
706 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
708 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
709 is already the last valid token number in the PCD database.
710 In the later case, *TokenNumber is updated with the value of 0.
711 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
717 IN CONST EFI_GUID
*Guid
, OPTIONAL
718 IN OUT UINTN
*TokenNumber
722 Retrieves the next valid PCD token namespace for a given namespace.
724 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
725 a known token namespace from which the search will start. On output,
726 it designates the next valid token namespace on the platform. If the input
727 token namespace does not exist on the platform, an error is returned and
728 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
729 first token space of the current platform is assigned to *Guid the function
730 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
731 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
732 and the function return EFI_SUCCESS. If this input token namespace is the last
733 namespace on the platform, *Guid will be assigned to NULL and the function return
736 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
737 Or the input token space Guid is already the last valid token space Guid
738 in the PCD database. In the later case, *Guid is updated with the value of NULL.
739 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
744 PeiPcdGetNextTokenSpace (
745 IN OUT CONST EFI_GUID
**Guid
749 /* Internal Function definitions */
751 Get PCD database from GUID HOB in PEI phase.
753 @return Pointer to PCD database.
762 Wrapper function for setting non-pointer type value for a PCD entry.
764 @param TokenNumber Pcd token number autogenerated by build tools.
765 @param Data Value want to be set for PCD entry
766 @param Size Size of value.
768 @return status of SetWorker.
773 IN UINTN TokenNumber
,
779 Set value for an PCD entry
781 @param TokenNumber Pcd token number autogenerated by build tools.
782 @param Data Value want to be set for PCD entry
783 @param Size Size of value.
784 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
785 If False, the type of PCD entry's value is not Pointer.
787 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
788 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
789 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
790 range of UINT8, UINT16, UINT32, UINT64
791 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
795 IN UINTN TokenNumber
,
802 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
804 @param ExTokenNumber Token number for dynamic-ex PCD.
805 @param Guid Token space guid for dynamic-ex PCD.
806 @param Data Value want to be set.
807 @param SetSize The size of value.
809 @return status of ExSetWorker().
814 IN UINTN ExTokenNumber
,
815 IN CONST EFI_GUID
*Guid
,
821 Set value for a dynamic PCD entry.
823 This routine find the local token number according to dynamic-ex PCD's token
824 space guid and token number firstly, and invoke callback function if this PCD
825 entry registered callback function. Finally, invoken general SetWorker to set
828 @param ExTokenNumber Dynamic-ex PCD token number.
829 @param Guid Token space guid for dynamic-ex PCD.
830 @param Data PCD value want to be set
831 @param SetSize Size of value.
832 @param PtrType If TRUE, this PCD entry is pointer type.
833 If FALSE, this PCD entry is not pointer type.
835 @return status of SetWorker().
840 IN UINTN ExTokenNumber
,
841 IN CONST EFI_GUID
*Guid
,
848 Get the PCD entry pointer in PCD database.
850 This routine will visit PCD database to find the PCD entry according to given
851 token number. The given token number is autogened by build tools and it will be
852 translated to local token number. Local token number contains PCD's type and
853 offset of PCD entry in PCD database.
855 @param TokenNumber Token's number, it is autogened by build tools
856 @param GetSize The size of token's value
858 @return PCD entry pointer in PCD database
863 IN UINTN TokenNumber
,
868 Wrapper function for get PCD value for dynamic-ex PCD.
870 @param Guid Token space guid for dynamic-ex PCD.
871 @param ExTokenNumber Token number for dyanmic-ex PCD.
872 @param GetSize The size of dynamic-ex PCD value.
874 @return PCD entry in PCD database.
879 IN CONST EFI_GUID
*Guid
,
880 IN UINTN ExTokenNumber
,
887 UINT32 LocalTokenNumberAlias
;
888 } EX_PCD_ENTRY_ATTRIBUTE
;
891 Get local token number according to dynamic-ex PCD's {token space guid:token number}
893 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
894 in DEC file. PCD database maintain a mapping table that translate pair of {token
895 space guid: token number} to local token number.
897 @param Guid Token space guid for dynamic-ex PCD entry.
898 @param ExTokenNumber EDES_TODO: Add parameter description
900 @return local token number for dynamic-ex PCD.
904 GetExPcdTokenNumber (
905 IN CONST EFI_GUID
*Guid
,
906 IN UINTN ExTokenNumber
910 The function registers the CallBackOnSet fucntion
911 according to TokenNumber and EFI_GUID space.
913 @param TokenNumber The token number.
914 @param Guid The GUID space.
915 @param CallBackFunction The Callback function to be registered.
916 @param Register To register or unregister the callback function.
918 @retval EFI_SUCCESS If the Callback function is registered.
919 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
920 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
921 slot left in the CallbackFnTable.
924 PeiRegisterCallBackWorker (
925 IN UINTN TokenNumber
,
926 IN CONST EFI_GUID
*Guid
, OPTIONAL
927 IN PCD_PPI_CALLBACK CallBackFunction
,
932 The function builds the PCD database.
940 Get SKU ID tabble from PCD database.
942 @param LocalTokenNumberTableIdx Index of local token number in token number table.
943 @param Database PCD Database in PEI phase
945 @return Pointer to SKU ID array table
950 IN UINTN LocalTokenNumberTableIdx
,
951 IN PEI_PCD_DATABASE
*Database
955 Get index of PCD entry in size table.
957 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
958 @param Database Pointer to PCD database.
960 @return index of PCD entry in size table.
965 IN UINTN LocalTokenNumberTableIdx
,
966 IN PEI_PCD_DATABASE
*Database
970 Get PCD value's size for POINTER type PCD.
972 The POINTER type PCD's value will be stored into a buffer in specificed size.
973 The max size of this PCD's value is described in PCD's definition in DEC file.
975 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
976 @param MaxSize Maxmium size of PCD's value
977 @param Database Pcd database in PEI phase.
979 @return PCD value's size for POINTER type PCD.
984 IN UINTN LocalTokenNumberTableIdx
,
986 IN PEI_PCD_DATABASE
*Database
990 Set PCD value's size for POINTER type PCD.
992 The POINTER type PCD's value will be stored into a buffer in specificed size.
993 The max size of this PCD's value is described in PCD's definition in DEC file.
995 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
996 @param CurrentSize Maxmium size of PCD's value
997 @param Database Pcd database in PEI phase.
999 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1000 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1005 IN UINTN LocalTokenNumberTableIdx
,
1006 IN OUT UINTN
*CurrentSize
,
1007 IN PEI_PCD_DATABASE
*Database
1011 extern EFI_GUID gPcdDataBaseHobGuid
;
1013 extern EFI_GUID gPcdPeiCallbackFnTableHobGuid
;
1015 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;