2 The internal header file declares the private functions used by PeiPcd driver.
4 Copyright (c) 2006 - 2008, 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.
15 #ifndef _PEI_PCD_SERVICE_H_
16 #define _PEI_PCD_SERVICE_H_
19 #include <Ppi/ReadOnlyVariable2.h>
21 #include <Library/DebugLib.h>
22 #include <Library/PeimEntryPoint.h>
23 #include <Library/BaseLib.h>
24 #include <Library/HobLib.h>
25 #include <Library/PeiServicesLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/BaseMemoryLib.h>
31 // Please make sure the PCD Serivce PEIM Version is consistent with
32 // the version of PCD Database generation tool
34 #define PCD_SERVICE_PEIM_VERSION 2
37 // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h
38 // and generated by PCD Database generation tool.
40 //#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )
41 // #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"
45 // PPI Interface Implementation Declaration.
49 Sets the SKU value for subsequent calls to set or get PCD token values.
51 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
52 SetSku() is normally called only once by the system.
54 For each item (token), the database can hold a single value that applies to all SKUs,
55 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
56 SKU-specific values are called SKU enabled.
58 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
59 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
60 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
61 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
62 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
63 set for that Id, the results are unpredictable.
65 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
66 set values associated with a PCD token.
76 Retrieves an 8-bit value for a given PCD token.
78 Retrieves the current byte-sized value for a PCD token number.
79 If the TokenNumber is invalid, the results are unpredictable.
81 @param[in] TokenNumber The PCD token number.
83 @return The UINT8 value.
93 Retrieves an 16-bit value for a given PCD token.
95 Retrieves the current 16-bits value for a PCD token number.
96 If the TokenNumber is invalid, the results are unpredictable.
98 @param[in] TokenNumber The PCD token number.
100 @return The UINT16 value.
110 Retrieves an 32-bit value for a given PCD token.
112 Retrieves the current 32-bits value for a PCD token number.
113 If the TokenNumber is invalid, the results are unpredictable.
115 @param[in] TokenNumber The PCD token number.
117 @return The UINT32 value.
127 Retrieves an 64-bit value for a given PCD token.
129 Retrieves the current 64-bits value for a PCD token number.
130 If the TokenNumber is invalid, the results are unpredictable.
132 @param[in] TokenNumber The PCD token number.
134 @return The UINT64 value.
144 Retrieves a pointer to a value for a given PCD token.
146 Retrieves the current pointer to the buffer for a PCD token number.
147 Do not make any assumptions about the alignment of the pointer that
148 is returned by this function call. If the TokenNumber is invalid,
149 the results are unpredictable.
151 @param[in] TokenNumber The PCD token number.
153 @return The pointer to the buffer to be retrived.
163 Retrieves a Boolean value for a given PCD token.
165 Retrieves the current boolean value for a PCD token number.
166 Do not make any assumptions about the alignment of the pointer that
167 is returned by this function call. If the TokenNumber is invalid,
168 the results are unpredictable.
170 @param[in] TokenNumber The PCD token number.
172 @return The Boolean value.
182 Retrieves the size of the value for a given PCD token.
184 Retrieves the current size of a particular PCD token.
185 If the TokenNumber is invalid, the results are unpredictable.
187 @param[in] TokenNumber The PCD token number.
189 @return The size of the value for the PCD token.
199 Retrieves an 8-bit value for a given PCD token.
201 Retrieves the 8-bit value of a particular PCD token.
202 If the TokenNumber is invalid or the token space
203 specified by Guid does not exist, the results are
206 @param[in] Guid The token space for the token number.
207 @param[in] TokenNumber The PCD token number.
209 @return The size 8-bit value for the PCD token.
215 IN CONST EFI_GUID
*Guid
,
220 Retrieves an 16-bit value for a given PCD token.
222 Retrieves the 16-bit value of a particular PCD token.
223 If the TokenNumber is invalid or the token space
224 specified by Guid does not exist, the results are
227 @param[in] Guid The token space for the token number.
228 @param[in] TokenNumber The PCD token number.
230 @return The size 16-bit value for the PCD token.
236 IN CONST EFI_GUID
*Guid
,
241 Retrieves an 32-bit value for a given PCD token.
243 Retrieves the 32-bit value of a particular PCD token.
244 If the TokenNumber is invalid or the token space
245 specified by Guid does not exist, the results are
248 @param[in] Guid The token space for the token number.
249 @param[in] TokenNumber The PCD token number.
251 @return The size 32-bit value for the PCD token.
257 IN CONST EFI_GUID
*Guid
,
262 Retrieves an 64-bit value for a given PCD token.
264 Retrieves the 64-bit value of a particular PCD token.
265 If the TokenNumber is invalid or the token space
266 specified by Guid does not exist, the results are
269 @param[in] Guid The token space for the token number.
270 @param[in] TokenNumber The PCD token number.
272 @return The size 64-bit value for the PCD token.
278 IN CONST EFI_GUID
*Guid
,
283 Retrieves a pointer to a value for a given PCD token.
285 Retrieves the current pointer to the buffer for a PCD token number.
286 Do not make any assumptions about the alignment of the pointer that
287 is returned by this function call. If the TokenNumber is invalid,
288 the results are unpredictable.
290 @param[in] Guid The token space for the token number.
291 @param[in] TokenNumber The PCD token number.
293 @return The pointer to the buffer to be retrived.
299 IN CONST EFI_GUID
*Guid
,
304 Retrieves an Boolean value for a given PCD token.
306 Retrieves the Boolean value of a particular PCD token.
307 If the TokenNumber is invalid or the token space
308 specified by Guid does not exist, the results are
311 @param[in] Guid The token space for the token number.
312 @param[in] TokenNumber The PCD token number.
314 @return The size Boolean value for the PCD token.
320 IN CONST EFI_GUID
*Guid
,
325 Retrieves the size of the value for a given PCD token.
327 Retrieves the current size of a particular PCD token.
328 If the TokenNumber is invalid, the results are unpredictable.
330 @param[in] Guid The token space for the token number.
331 @param[in] TokenNumber The PCD token number.
333 @return The size of the value for the PCD token.
339 IN CONST EFI_GUID
*Guid
,
344 Sets an 8-bit value for a given PCD token.
346 When the PCD service sets a value, it will check to ensure that the
347 size of the value being set is compatible with the Token's existing definition.
348 If it is not, an error will be returned.
350 @param[in] TokenNumber The PCD token number.
351 @param[in] Value The value to set for the PCD token.
353 @retval EFI_SUCCESS Procedure returned successfully.
354 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
355 being set was incompatible with a call to this function.
356 Use GetSize() to retrieve the size of the target data.
357 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
363 IN UINTN TokenNumber
,
368 Sets an 16-bit value for a given PCD token.
370 When the PCD service sets a value, it will check to ensure that the
371 size of the value being set is compatible with the Token's existing definition.
372 If it is not, an error will be returned.
374 @param[in] TokenNumber The PCD token number.
375 @param[in] Value The value to set for the PCD token.
377 @retval EFI_SUCCESS Procedure returned successfully.
378 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
379 being set was incompatible with a call to this function.
380 Use GetSize() to retrieve the size of the target data.
381 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
387 IN UINTN TokenNumber
,
392 Sets an 32-bit value for a given PCD token.
394 When the PCD service sets a value, it will check to ensure that the
395 size of the value being set is compatible with the Token's existing definition.
396 If it is not, an error will be returned.
398 @param[in] TokenNumber The PCD token number.
399 @param[in] Value The value to set for the PCD token.
401 @retval EFI_SUCCESS Procedure returned successfully.
402 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
403 being set was incompatible with a call to this function.
404 Use GetSize() to retrieve the size of the target data.
405 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
411 IN UINTN TokenNumber
,
416 Sets an 64-bit value for a given PCD token.
418 When the PCD service sets a value, it will check to ensure that the
419 size of the value being set is compatible with the Token's existing definition.
420 If it is not, an error will be returned.
422 @param[in] TokenNumber The PCD token number.
423 @param[in] Value The value to set for the PCD token.
425 @retval EFI_SUCCESS Procedure returned successfully.
426 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
427 being set was incompatible with a call to this function.
428 Use GetSize() to retrieve the size of the target data.
429 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
435 IN UINTN TokenNumber
,
440 Sets a value of a specified size 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, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
448 On input, if the SizeOfValue is greater than the maximum size supported
449 for this TokenNumber then the output value of SizeOfValue will reflect
450 the maximum size supported for this TokenNumber.
451 @param[in] Buffer The buffer to set for the PCD token.
453 @retval EFI_SUCCESS Procedure returned successfully.
454 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
455 being set was incompatible with a call to this function.
456 Use GetSize() to retrieve the size of the target data.
457 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
463 IN UINTN TokenNumber
,
464 IN OUT UINTN
*SizeOfBuffer
,
469 Sets an Boolean value for a given PCD token.
471 When the PCD service sets a value, it will check to ensure that the
472 size of the value being set is compatible with the Token's existing definition.
473 If it is not, an error will be returned.
475 @param[in] TokenNumber The PCD token number.
476 @param[in] Value The value 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
,
493 Sets an 8-bit value for a given PCD token.
495 When the PCD service sets a value, it will check to ensure that the
496 size of the value being set is compatible with the Token's existing definition.
497 If it is not, an error will be returned.
499 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
500 @param[in] TokenNumber The PCD token number.
501 @param[in] Value The value to set for the PCD token.
503 @retval EFI_SUCCESS Procedure returned successfully.
504 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
505 being set was incompatible with a call to this function.
506 Use GetSize() to retrieve the size of the target data.
507 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
513 IN CONST EFI_GUID
*Guid
,
514 IN UINTN TokenNumber
,
519 Sets an 16-bit value for a given PCD token.
521 When the PCD service sets a value, it will check to ensure that the
522 size of the value being set is compatible with the Token's existing definition.
523 If it is not, an error will be returned.
525 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
526 @param[in] TokenNumber The PCD token number.
527 @param[in] Value The value to set for the PCD token.
529 @retval EFI_SUCCESS Procedure returned successfully.
530 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
531 being set was incompatible with a call to this function.
532 Use GetSize() to retrieve the size of the target data.
533 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
539 IN CONST EFI_GUID
*Guid
,
540 IN UINTN TokenNumber
,
545 Sets an 32-bit value for a given PCD token.
547 When the PCD service sets a value, it will check to ensure that the
548 size of the value being set is compatible with the Token's existing definition.
549 If it is not, an error will be returned.
551 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
552 @param[in] TokenNumber The PCD token number.
553 @param[in] Value The value to set for the PCD token.
555 @retval EFI_SUCCESS Procedure returned successfully.
556 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
557 being set was incompatible with a call to this function.
558 Use GetSize() to retrieve the size of the target data.
559 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
565 IN CONST EFI_GUID
*Guid
,
566 IN UINTN TokenNumber
,
571 Sets an 64-bit value for a given PCD token.
573 When the PCD service sets a value, it will check to ensure that the
574 size of the value being set is compatible with the Token's existing definition.
575 If it is not, an error will be returned.
577 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
578 @param[in] TokenNumber The PCD token number.
579 @param[in] Value The value to set for the PCD token.
581 @retval EFI_SUCCESS Procedure returned successfully.
582 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
583 being set was incompatible with a call to this function.
584 Use GetSize() to retrieve the size of the target data.
585 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
591 IN CONST EFI_GUID
*Guid
,
592 IN UINTN TokenNumber
,
597 Sets a value of a specified size for a given PCD token.
599 When the PCD service sets a value, it will check to ensure that the
600 size of the value being set is compatible with the Token's existing definition.
601 If it is not, an error will be returned.
603 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
604 @param[in] TokenNumber The PCD token number.
605 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
606 On input, if the SizeOfValue is greater than the maximum size supported
607 for this TokenNumber then the output value of SizeOfValue will reflect
608 the maximum size supported for this TokenNumber.
609 @param[in] Buffer The buffer 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
,
623 IN OUT UINTN
*SizeOfBuffer
,
628 Sets an Boolean value 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] Value The value to set for the PCD token.
638 @retval EFI_SUCCESS Procedure returned successfully.
639 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
640 being set was incompatible with a call to this function.
641 Use GetSize() to retrieve the size of the target data.
642 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
648 IN CONST EFI_GUID
*Guid
,
649 IN UINTN TokenNumber
,
654 Specifies a function to be called anytime the value of a designated token is changed.
656 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
657 @param[in] TokenNumber The PCD token number.
658 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
660 @retval EFI_SUCCESS The PCD service has successfully established a call event
661 for the CallBackToken requested.
662 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
667 PeiRegisterCallBackOnSet (
668 IN CONST EFI_GUID
*Guid
, OPTIONAL
669 IN UINTN TokenNumber
,
670 IN PCD_PPI_CALLBACK CallBackFunction
674 Cancels a previously set callback function for a particular PCD token number.
676 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
677 @param [in] TokenNumber The PCD token number.
678 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
680 @retval EFI_SUCCESS The PCD service has successfully established a call event
681 for the CallBackToken requested.
682 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
687 PcdUnRegisterCallBackOnSet (
688 IN CONST EFI_GUID
*Guid
, OPTIONAL
689 IN UINTN TokenNumber
,
690 IN PCD_PPI_CALLBACK CallBackFunction
694 Retrieves the next valid PCD token for a given namespace.
696 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
697 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
698 If the input token namespace or token number does not exist on the platform,
699 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
700 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
701 there is no valid token number for this token namespace, *TokenNumber will be assigned to
702 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
703 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
705 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
706 is already the last valid token number in the PCD database.
707 In the later case, *TokenNumber is updated with the value of 0.
708 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
714 IN CONST EFI_GUID
*Guid
, OPTIONAL
715 IN OUT UINTN
*TokenNumber
719 Retrieves the next valid PCD token namespace for a given namespace.
721 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
722 a known token namespace from which the search will start. On output,
723 it designates the next valid token namespace on the platform. If the input
724 token namespace does not exist on the platform, an error is returned and
725 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
726 first token space of the current platform is assigned to *Guid the function
727 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
728 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
729 and the function return EFI_SUCCESS. If this input token namespace is the last
730 namespace on the platform, *Guid will be assigned to NULL and the function return
733 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
734 Or the input token space Guid is already the last valid token space Guid
735 in the PCD database. In the later case, *Guid is updated with the value of NULL.
736 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
741 PeiPcdGetNextTokenSpace (
742 IN OUT CONST EFI_GUID
**Guid
746 /* Internal Function definitions */
748 Get PCD database from GUID HOB in PEI phase.
750 @return Pointer to PCD database.
759 Wrapper function for setting non-pointer type value for a PCD entry.
761 @param TokenNumber Pcd token number autogenerated by build tools.
762 @param Data Value want to be set for PCD entry
763 @param Size Size of value.
765 @return status of SetWorker.
770 IN UINTN TokenNumber
,
776 Set value for an PCD entry
778 @param TokenNumber Pcd token number autogenerated by build tools.
779 @param Data Value want to be set for PCD entry
780 @param Size Size of value.
781 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
782 If False, the type of PCD entry's value is not Pointer.
784 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
785 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
786 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
787 range of UINT8, UINT16, UINT32, UINT64
788 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
792 IN UINTN TokenNumber
,
799 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
801 @param ExTokenNumber Token number for dynamic-ex PCD.
802 @param Guid Token space guid for dynamic-ex PCD.
803 @param Data Value want to be set.
804 @param SetSize The size of value.
806 @return status of ExSetWorker().
811 IN UINTN ExTokenNumber
,
812 IN CONST EFI_GUID
*Guid
,
818 Set value for a dynamic PCD entry.
820 This routine find the local token number according to dynamic-ex PCD's token
821 space guid and token number firstly, and invoke callback function if this PCD
822 entry registered callback function. Finally, invoken general SetWorker to set
825 @param ExTokenNumber Dynamic-ex PCD token number.
826 @param Guid Token space guid for dynamic-ex PCD.
827 @param Data PCD value want to be set
828 @param SetSize Size of value.
829 @param PtrType If TRUE, this PCD entry is pointer type.
830 If FALSE, this PCD entry is not pointer type.
832 @return status of SetWorker().
837 IN UINTN ExTokenNumber
,
838 IN CONST EFI_GUID
*Guid
,
845 Get the PCD entry pointer in PCD database.
847 This routine will visit PCD database to find the PCD entry according to given
848 token number. The given token number is autogened by build tools and it will be
849 translated to local token number. Local token number contains PCD's type and
850 offset of PCD entry in PCD database.
852 @param TokenNumber Token's number, it is autogened by build tools
853 @param GetSize The size of token's value
855 @return PCD entry pointer in PCD database
860 IN UINTN TokenNumber
,
865 Wrapper function for get PCD value for dynamic-ex PCD.
867 @param Guid Token space guid for dynamic-ex PCD.
868 @param ExTokenNumber Token number for dyanmic-ex PCD.
869 @param GetSize The size of dynamic-ex PCD value.
871 @return PCD entry in PCD database.
876 IN CONST EFI_GUID
*Guid
,
877 IN UINTN ExTokenNumber
,
884 UINT32 LocalTokenNumberAlias
;
885 } EX_PCD_ENTRY_ATTRIBUTE
;
888 Get local token number according to dynamic-ex PCD's {token space guid:token number}
890 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
891 in DEC file. PCD database maintain a mapping table that translate pair of {token
892 space guid: token number} to local token number.
894 @param Guid Token space guid for dynamic-ex PCD entry.
895 @param ExTokenNumber EDES_TODO: Add parameter description
897 @return local token number for dynamic-ex PCD.
901 GetExPcdTokenNumber (
902 IN CONST EFI_GUID
*Guid
,
903 IN UINTN ExTokenNumber
907 The function registers the CallBackOnSet fucntion
908 according to TokenNumber and EFI_GUID space.
910 @param TokenNumber The token number.
911 @param Guid The GUID space.
912 @param CallBackFunction The Callback function to be registered.
913 @param Register To register or unregister the callback function.
915 @retval EFI_SUCCESS If the Callback function is registered.
916 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
917 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
918 slot left in the CallbackFnTable.
921 PeiRegisterCallBackWorker (
922 IN UINTN TokenNumber
,
923 IN CONST EFI_GUID
*Guid
, OPTIONAL
924 IN PCD_PPI_CALLBACK CallBackFunction
,
929 The function builds the PCD database.
937 Get SKU ID tabble from PCD database.
939 @param LocalTokenNumberTableIdx Index of local token number in token number table.
940 @param Database PCD Database in PEI phase
942 @return Pointer to SKU ID array table
947 IN UINTN LocalTokenNumberTableIdx
,
948 IN PEI_PCD_DATABASE
*Database
952 Get index of PCD entry in size table.
954 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
955 @param Database Pointer to PCD database.
957 @return index of PCD entry in size table.
962 IN UINTN LocalTokenNumberTableIdx
,
963 IN PEI_PCD_DATABASE
*Database
967 Get PCD value's size for POINTER type PCD.
969 The POINTER type PCD's value will be stored into a buffer in specificed size.
970 The max size of this PCD's value is described in PCD's definition in DEC file.
972 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
973 @param MaxSize Maxmium size of PCD's value
974 @param Database Pcd database in PEI phase.
976 @return PCD value's size for POINTER type PCD.
981 IN UINTN LocalTokenNumberTableIdx
,
983 IN PEI_PCD_DATABASE
*Database
987 Set PCD value's size for POINTER type PCD.
989 The POINTER type PCD's value will be stored into a buffer in specificed size.
990 The max size of this PCD's value is described in PCD's definition in DEC file.
992 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
993 @param CurrentSize Maxmium size of PCD's value
994 @param Database Pcd database in PEI phase.
996 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
997 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1002 IN UINTN LocalTokenNumberTableIdx
,
1003 IN OUT UINTN
*CurrentSize
,
1004 IN PEI_PCD_DATABASE
*Database
1007 extern EFI_GUID gPcdDataBaseHobGuid
;
1009 extern EFI_GUID gPcdPeiCallbackFnTableHobGuid
;
1012 // The init Database created by PCD Database generation tool
1014 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;