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.
81 Retrieves an 8-bit value for a given PCD token.
83 Retrieves the current byte-sized value for a PCD token number.
84 If the TokenNumber is invalid, the results are unpredictable.
86 @param[in] TokenNumber The PCD token number.
88 @return The UINT8 value.
98 Retrieves an 16-bit value for a given PCD token.
100 Retrieves the current 16-bits value for a PCD token number.
101 If the TokenNumber is invalid, the results are unpredictable.
103 @param[in] TokenNumber The PCD token number.
105 @return The UINT16 value.
115 Retrieves an 32-bit value for a given PCD token.
117 Retrieves the current 32-bits value for a PCD token number.
118 If the TokenNumber is invalid, the results are unpredictable.
120 @param[in] TokenNumber The PCD token number.
122 @return The UINT32 value.
132 Retrieves an 64-bit value for a given PCD token.
134 Retrieves the current 64-bits value for a PCD token number.
135 If the TokenNumber is invalid, the results are unpredictable.
137 @param[in] TokenNumber The PCD token number.
139 @return The UINT64 value.
149 Retrieves a pointer to a value for a given PCD token.
151 Retrieves the current pointer to the buffer for a PCD token number.
152 Do not make any assumptions about the alignment of the pointer that
153 is returned by this function call. If the TokenNumber is invalid,
154 the results are unpredictable.
156 @param[in] TokenNumber The PCD token number.
158 @return The pointer to the buffer to be retrived.
168 Retrieves a Boolean value for a given PCD token.
170 Retrieves the current boolean value for a PCD token number.
171 Do not make any assumptions about the alignment of the pointer that
172 is returned by this function call. If the TokenNumber is invalid,
173 the results are unpredictable.
175 @param[in] TokenNumber The PCD token number.
177 @return The Boolean value.
187 Retrieves the size of the value for a given PCD token.
189 Retrieves the current size of a particular PCD token.
190 If the TokenNumber is invalid, the results are unpredictable.
192 @param[in] TokenNumber The PCD token number.
194 @return The size of the value for the PCD token.
204 Retrieves an 8-bit value for a given PCD token.
206 Retrieves the 8-bit value of a particular PCD token.
207 If the TokenNumber is invalid or the token space
208 specified by Guid does not exist, the results are
211 @param[in] Guid The token space for the token number.
212 @param[in] TokenNumber The PCD token number.
214 @return The size 8-bit value for the PCD token.
220 IN CONST EFI_GUID
*Guid
,
225 Retrieves an 16-bit value for a given PCD token.
227 Retrieves the 16-bit value of a particular PCD token.
228 If the TokenNumber is invalid or the token space
229 specified by Guid does not exist, the results are
232 @param[in] Guid The token space for the token number.
233 @param[in] TokenNumber The PCD token number.
235 @return The size 16-bit value for the PCD token.
241 IN CONST EFI_GUID
*Guid
,
246 Retrieves an 32-bit value for a given PCD token.
248 Retrieves the 32-bit value of a particular PCD token.
249 If the TokenNumber is invalid or the token space
250 specified by Guid does not exist, the results are
253 @param[in] Guid The token space for the token number.
254 @param[in] TokenNumber The PCD token number.
256 @return The size 32-bit value for the PCD token.
262 IN CONST EFI_GUID
*Guid
,
267 Retrieves an 64-bit value for a given PCD token.
269 Retrieves the 64-bit value of a particular PCD token.
270 If the TokenNumber is invalid or the token space
271 specified by Guid does not exist, the results are
274 @param[in] Guid The token space for the token number.
275 @param[in] TokenNumber The PCD token number.
277 @return The size 64-bit value for the PCD token.
283 IN CONST EFI_GUID
*Guid
,
288 Retrieves a pointer to a value for a given PCD token.
290 Retrieves the current pointer to the buffer for a PCD token number.
291 Do not make any assumptions about the alignment of the pointer that
292 is returned by this function call. If the TokenNumber is invalid,
293 the results are unpredictable.
295 @param[in] Guid The token space for the token number.
296 @param[in] TokenNumber The PCD token number.
298 @return The pointer to the buffer to be retrived.
304 IN CONST EFI_GUID
*Guid
,
309 Retrieves an Boolean value for a given PCD token.
311 Retrieves the Boolean value of a particular PCD token.
312 If the TokenNumber is invalid or the token space
313 specified by Guid does not exist, the results are
316 @param[in] Guid The token space for the token number.
317 @param[in] TokenNumber The PCD token number.
319 @return The size Boolean value for the PCD token.
325 IN CONST EFI_GUID
*Guid
,
330 Retrieves the size of the value for a given PCD token.
332 Retrieves the current size of a particular PCD token.
333 If the TokenNumber is invalid, the results are unpredictable.
335 @param[in] Guid The token space for the token number.
336 @param[in] TokenNumber The PCD token number.
338 @return The size of the value for the PCD token.
344 IN CONST EFI_GUID
*Guid
,
349 Sets an 8-bit value for a given PCD token.
351 When the PCD service sets a value, it will check to ensure that the
352 size of the value being set is compatible with the Token's existing definition.
353 If it is not, an error will be returned.
355 @param[in] TokenNumber The PCD token number.
356 @param[in] Value The value to set for the PCD token.
358 @retval EFI_SUCCESS Procedure returned successfully.
359 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
360 being set was incompatible with a call to this function.
361 Use GetSize() to retrieve the size of the target data.
362 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
368 IN UINTN TokenNumber
,
373 Sets an 16-bit value for a given PCD token.
375 When the PCD service sets a value, it will check to ensure that the
376 size of the value being set is compatible with the Token's existing definition.
377 If it is not, an error will be returned.
379 @param[in] TokenNumber The PCD token number.
380 @param[in] Value The value to set for the PCD token.
382 @retval EFI_SUCCESS Procedure returned successfully.
383 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
384 being set was incompatible with a call to this function.
385 Use GetSize() to retrieve the size of the target data.
386 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
392 IN UINTN TokenNumber
,
397 Sets an 32-bit value for a given PCD token.
399 When the PCD service sets a value, it will check to ensure that the
400 size of the value being set is compatible with the Token's existing definition.
401 If it is not, an error will be returned.
403 @param[in] TokenNumber The PCD token number.
404 @param[in] Value The value to set for the PCD token.
406 @retval EFI_SUCCESS Procedure returned successfully.
407 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
408 being set was incompatible with a call to this function.
409 Use GetSize() to retrieve the size of the target data.
410 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
416 IN UINTN TokenNumber
,
421 Sets an 64-bit value for a given PCD token.
423 When the PCD service sets a value, it will check to ensure that the
424 size of the value being set is compatible with the Token's existing definition.
425 If it is not, an error will be returned.
427 @param[in] TokenNumber The PCD token number.
428 @param[in] Value The value to set for the PCD token.
430 @retval EFI_SUCCESS Procedure returned successfully.
431 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
432 being set was incompatible with a call to this function.
433 Use GetSize() to retrieve the size of the target data.
434 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
440 IN UINTN TokenNumber
,
445 Sets a value of a specified size for a given PCD token.
447 When the PCD service sets a value, it will check to ensure that the
448 size of the value being set is compatible with the Token's existing definition.
449 If it is not, an error will be returned.
451 @param[in] TokenNumber The PCD token number.
452 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
453 On input, if the SizeOfValue is greater than the maximum size supported
454 for this TokenNumber then the output value of SizeOfValue will reflect
455 the maximum size supported for this TokenNumber.
456 @param[in] Buffer The buffer to set for the PCD token.
458 @retval EFI_SUCCESS Procedure returned successfully.
459 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
460 being set was incompatible with a call to this function.
461 Use GetSize() to retrieve the size of the target data.
462 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
468 IN UINTN TokenNumber
,
469 IN OUT UINTN
*SizeOfBuffer
,
474 Sets an Boolean value for a given PCD token.
476 When the PCD service sets a value, it will check to ensure that the
477 size of the value being set is compatible with the Token's existing definition.
478 If it is not, an error will be returned.
480 @param[in] TokenNumber The PCD token number.
481 @param[in] Value The value to set for the PCD token.
483 @retval EFI_SUCCESS Procedure returned successfully.
484 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
485 being set was incompatible with a call to this function.
486 Use GetSize() to retrieve the size of the target data.
487 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
493 IN UINTN TokenNumber
,
498 Sets an 8-bit value for a given PCD token.
500 When the PCD service sets a value, it will check to ensure that the
501 size of the value being set is compatible with the Token's existing definition.
502 If it is not, an error will be returned.
504 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
505 @param[in] TokenNumber The PCD token number.
506 @param[in] Value The value to set for the PCD token.
508 @retval EFI_SUCCESS Procedure returned successfully.
509 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
510 being set was incompatible with a call to this function.
511 Use GetSize() to retrieve the size of the target data.
512 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
518 IN CONST EFI_GUID
*Guid
,
519 IN UINTN TokenNumber
,
524 Sets an 16-bit value for a given PCD token.
526 When the PCD service sets a value, it will check to ensure that the
527 size of the value being set is compatible with the Token's existing definition.
528 If it is not, an error will be returned.
530 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
531 @param[in] TokenNumber The PCD token number.
532 @param[in] Value The value to set for the PCD token.
534 @retval EFI_SUCCESS Procedure returned successfully.
535 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
536 being set was incompatible with a call to this function.
537 Use GetSize() to retrieve the size of the target data.
538 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
544 IN CONST EFI_GUID
*Guid
,
545 IN UINTN TokenNumber
,
550 Sets an 32-bit value for a given PCD token.
552 When the PCD service sets a value, it will check to ensure that the
553 size of the value being set is compatible with the Token's existing definition.
554 If it is not, an error will be returned.
556 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
557 @param[in] TokenNumber The PCD token number.
558 @param[in] Value The value to set for the PCD token.
560 @retval EFI_SUCCESS Procedure returned successfully.
561 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
562 being set was incompatible with a call to this function.
563 Use GetSize() to retrieve the size of the target data.
564 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
570 IN CONST EFI_GUID
*Guid
,
571 IN UINTN TokenNumber
,
576 Sets an 64-bit value for a given PCD token.
578 When the PCD service sets a value, it will check to ensure that the
579 size of the value being set is compatible with the Token's existing definition.
580 If it is not, an error will be returned.
582 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
583 @param[in] TokenNumber The PCD token number.
584 @param[in] Value The value to set for the PCD token.
586 @retval EFI_SUCCESS Procedure returned successfully.
587 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
588 being set was incompatible with a call to this function.
589 Use GetSize() to retrieve the size of the target data.
590 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
596 IN CONST EFI_GUID
*Guid
,
597 IN UINTN TokenNumber
,
602 Sets a value of a specified size for a given PCD token.
604 When the PCD service sets a value, it will check to ensure that the
605 size of the value being set is compatible with the Token's existing definition.
606 If it is not, an error will be returned.
608 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
609 @param[in] TokenNumber The PCD token number.
610 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
611 On input, if the SizeOfValue is greater than the maximum size supported
612 for this TokenNumber then the output value of SizeOfValue will reflect
613 the maximum size supported for this TokenNumber.
614 @param[in] Buffer The buffer to set for the PCD token.
616 @retval EFI_SUCCESS Procedure returned successfully.
617 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
618 being set was incompatible with a call to this function.
619 Use GetSize() to retrieve the size of the target data.
620 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
626 IN CONST EFI_GUID
*Guid
,
627 IN UINTN TokenNumber
,
628 IN OUT UINTN
*SizeOfBuffer
,
633 Sets an Boolean value for a given PCD token.
635 When the PCD service sets a value, it will check to ensure that the
636 size of the value being set is compatible with the Token's existing definition.
637 If it is not, an error will be returned.
639 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
640 @param[in] TokenNumber The PCD token number.
641 @param[in] Value The value to set for the PCD token.
643 @retval EFI_SUCCESS Procedure returned successfully.
644 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
645 being set was incompatible with a call to this function.
646 Use GetSize() to retrieve the size of the target data.
647 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
653 IN CONST EFI_GUID
*Guid
,
654 IN UINTN TokenNumber
,
659 Specifies a function to be called anytime the value of a designated token is changed.
661 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
662 @param[in] TokenNumber The PCD token number.
663 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
665 @retval EFI_SUCCESS The PCD service has successfully established a call event
666 for the CallBackToken requested.
667 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
672 PeiRegisterCallBackOnSet (
673 IN CONST EFI_GUID
*Guid
, OPTIONAL
674 IN UINTN TokenNumber
,
675 IN PCD_PPI_CALLBACK CallBackFunction
679 Cancels a previously set callback function for a particular PCD token number.
681 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
682 @param [in] TokenNumber The PCD token number.
683 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
685 @retval EFI_SUCCESS The PCD service has successfully established a call event
686 for the CallBackToken requested.
687 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
692 PcdUnRegisterCallBackOnSet (
693 IN CONST EFI_GUID
*Guid
, OPTIONAL
694 IN UINTN TokenNumber
,
695 IN PCD_PPI_CALLBACK CallBackFunction
699 Retrieves the next valid PCD token for a given namespace.
701 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
702 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
703 If the input token namespace or token number does not exist on the platform,
704 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
705 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
706 there is no valid token number for this token namespace, *TokenNumber will be assigned to
707 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
708 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
710 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
711 is already the last valid token number in the PCD database.
712 In the later case, *TokenNumber is updated with the value of 0.
713 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
719 IN CONST EFI_GUID
*Guid
, OPTIONAL
720 IN OUT UINTN
*TokenNumber
724 Retrieves the next valid PCD token namespace for a given namespace.
726 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
727 a known token namespace from which the search will start. On output,
728 it designates the next valid token namespace on the platform. If the input
729 token namespace does not exist on the platform, an error is returned and
730 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
731 first token space of the current platform is assigned to *Guid the function
732 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
733 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
734 and the function return EFI_SUCCESS. If this input token namespace is the last
735 namespace on the platform, *Guid will be assigned to NULL and the function return
738 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
739 Or the input token space Guid is already the last valid token space Guid
740 in the PCD database. In the later case, *Guid is updated with the value of NULL.
741 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
746 PeiPcdGetNextTokenSpace (
747 IN OUT CONST EFI_GUID
**Guid
751 /* Internal Function definitions */
753 Get PCD database from GUID HOB in PEI phase.
755 @return Pointer to PCD database.
764 Wrapper function for setting non-pointer type value for a PCD entry.
766 @param TokenNumber Pcd token number autogenerated by build tools.
767 @param Data Value want to be set for PCD entry
768 @param Size Size of value.
770 @return status of SetWorker.
775 IN UINTN TokenNumber
,
781 Set value for an PCD entry
783 @param TokenNumber Pcd token number autogenerated by build tools.
784 @param Data Value want to be set for PCD entry
785 @param Size Size of value.
786 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
787 If False, the type of PCD entry's value is not Pointer.
789 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
790 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
791 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
792 range of UINT8, UINT16, UINT32, UINT64
793 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
797 IN UINTN TokenNumber
,
804 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
806 @param ExTokenNumber Token number for dynamic-ex PCD.
807 @param Guid Token space guid for dynamic-ex PCD.
808 @param Data Value want to be set.
809 @param SetSize The size of value.
811 @return status of ExSetWorker().
816 IN UINTN ExTokenNumber
,
817 IN CONST EFI_GUID
*Guid
,
823 Set value for a dynamic PCD entry.
825 This routine find the local token number according to dynamic-ex PCD's token
826 space guid and token number firstly, and invoke callback function if this PCD
827 entry registered callback function. Finally, invoken general SetWorker to set
830 @param ExTokenNumber Dynamic-ex PCD token number.
831 @param Guid Token space guid for dynamic-ex PCD.
832 @param Data PCD value want to be set
833 @param SetSize Size of value.
834 @param PtrType If TRUE, this PCD entry is pointer type.
835 If FALSE, this PCD entry is not pointer type.
837 @return status of SetWorker().
842 IN UINTN ExTokenNumber
,
843 IN CONST EFI_GUID
*Guid
,
850 Get the PCD entry pointer in PCD database.
852 This routine will visit PCD database to find the PCD entry according to given
853 token number. The given token number is autogened by build tools and it will be
854 translated to local token number. Local token number contains PCD's type and
855 offset of PCD entry in PCD database.
857 @param TokenNumber Token's number, it is autogened by build tools
858 @param GetSize The size of token's value
860 @return PCD entry pointer in PCD database
865 IN UINTN TokenNumber
,
870 Wrapper function for get PCD value for dynamic-ex PCD.
872 @param Guid Token space guid for dynamic-ex PCD.
873 @param ExTokenNumber Token number for dyanmic-ex PCD.
874 @param GetSize The size of dynamic-ex PCD value.
876 @return PCD entry in PCD database.
881 IN CONST EFI_GUID
*Guid
,
882 IN UINTN ExTokenNumber
,
889 UINT32 LocalTokenNumberAlias
;
890 } EX_PCD_ENTRY_ATTRIBUTE
;
893 Get local token number according to dynamic-ex PCD's {token space guid:token number}
895 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
896 in DEC file. PCD database maintain a mapping table that translate pair of {token
897 space guid: token number} to local token number.
899 @param Guid Token space guid for dynamic-ex PCD entry.
900 @param ExTokenNumber EDES_TODO: Add parameter description
902 @return local token number for dynamic-ex PCD.
906 GetExPcdTokenNumber (
907 IN CONST EFI_GUID
*Guid
,
908 IN UINTN ExTokenNumber
912 The function registers the CallBackOnSet fucntion
913 according to TokenNumber and EFI_GUID space.
915 @param TokenNumber The token number.
916 @param Guid The GUID space.
917 @param CallBackFunction The Callback function to be registered.
918 @param Register To register or unregister the callback function.
920 @retval EFI_SUCCESS If the Callback function is registered.
921 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
922 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
923 slot left in the CallbackFnTable.
926 PeiRegisterCallBackWorker (
927 IN UINTN TokenNumber
,
928 IN CONST EFI_GUID
*Guid
, OPTIONAL
929 IN PCD_PPI_CALLBACK CallBackFunction
,
934 The function builds the PCD database.
942 Get SKU ID tabble from PCD database.
944 @param LocalTokenNumberTableIdx Index of local token number in token number table.
945 @param Database PCD Database in PEI phase
947 @return Pointer to SKU ID array table
952 IN UINTN LocalTokenNumberTableIdx
,
953 IN PEI_PCD_DATABASE
*Database
957 Get index of PCD entry in size table.
959 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
960 @param Database Pointer to PCD database.
962 @return index of PCD entry in size table.
967 IN UINTN LocalTokenNumberTableIdx
,
968 IN PEI_PCD_DATABASE
*Database
972 Get PCD value's size for POINTER type PCD.
974 The POINTER type PCD's value will be stored into a buffer in specificed size.
975 The max size of this PCD's value is described in PCD's definition in DEC file.
977 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
978 @param MaxSize Maxmium size of PCD's value
979 @param Database Pcd database in PEI phase.
981 @return PCD value's size for POINTER type PCD.
986 IN UINTN LocalTokenNumberTableIdx
,
988 IN PEI_PCD_DATABASE
*Database
992 Set PCD value's size for POINTER type PCD.
994 The POINTER type PCD's value will be stored into a buffer in specificed size.
995 The max size of this PCD's value is described in PCD's definition in DEC file.
997 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
998 @param CurrentSize Maxmium size of PCD's value
999 @param Database Pcd database in PEI phase.
1001 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1002 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1007 IN UINTN LocalTokenNumberTableIdx
,
1008 IN OUT UINTN
*CurrentSize
,
1009 IN PEI_PCD_DATABASE
*Database
1013 extern EFI_GUID gPcdDataBaseHobGuid
;
1015 extern EFI_GUID gPcdPeiCallbackFnTableHobGuid
;
1017 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;