2 The internal header file declares the private functions used by PeiPcd driver.
4 Copyright (c) 2006 - 2010, 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 <Ppi/PiPcd.h>
22 #include <Guid/PcdDataBaseHobGuid.h>
23 #include <Library/DebugLib.h>
24 #include <Library/PeimEntryPoint.h>
25 #include <Library/BaseLib.h>
26 #include <Library/HobLib.h>
27 #include <Library/PeiServicesLib.h>
28 #include <Library/PcdLib.h>
29 #include <Library/BaseMemoryLib.h>
33 // Please make sure the PCD Serivce PEIM Version is consistent with
34 // the version of PCD Database generation tool
36 #define PCD_SERVICE_PEIM_VERSION 2
39 // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h
40 // and generated by PCD Database generation tool.
42 //#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )
43 // #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"
47 // PPI Interface Implementation Declaration.
51 Sets the SKU value for subsequent calls to set or get PCD token values.
53 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
54 SetSku() is normally called only once by the system.
56 For each item (token), the database can hold a single value that applies to all SKUs,
57 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
58 SKU-specific values are called SKU enabled.
60 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
61 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
62 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
63 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
64 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
65 set for that Id, the results are unpredictable.
67 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
68 set values associated with a PCD token.
78 Retrieves an 8-bit value for a given PCD token.
80 Retrieves the current byte-sized value for a PCD token number.
81 If the TokenNumber is invalid, the results are unpredictable.
83 @param[in] TokenNumber The PCD token number.
85 @return The UINT8 value.
95 Retrieves an 16-bit value for a given PCD token.
97 Retrieves the current 16-bits value for a PCD token number.
98 If the TokenNumber is invalid, the results are unpredictable.
100 @param[in] TokenNumber The PCD token number.
102 @return The UINT16 value.
112 Retrieves an 32-bit value for a given PCD token.
114 Retrieves the current 32-bits value for a PCD token number.
115 If the TokenNumber is invalid, the results are unpredictable.
117 @param[in] TokenNumber The PCD token number.
119 @return The UINT32 value.
129 Retrieves an 64-bit value for a given PCD token.
131 Retrieves the current 64-bits value for a PCD token number.
132 If the TokenNumber is invalid, the results are unpredictable.
134 @param[in] TokenNumber The PCD token number.
136 @return The UINT64 value.
146 Retrieves a pointer to a value for a given PCD token.
148 Retrieves the current pointer to the buffer for a PCD token number.
149 Do not make any assumptions about the alignment of the pointer that
150 is returned by this function call. If the TokenNumber is invalid,
151 the results are unpredictable.
153 @param[in] TokenNumber The PCD token number.
155 @return The pointer to the buffer to be retrived.
165 Retrieves a Boolean value for a given PCD token.
167 Retrieves the current boolean value for a PCD token number.
168 Do not make any assumptions about the alignment of the pointer that
169 is returned by this function call. If the TokenNumber is invalid,
170 the results are unpredictable.
172 @param[in] TokenNumber The PCD token number.
174 @return The Boolean value.
184 Retrieves the size of the value for a given PCD token.
186 Retrieves the current size of a particular PCD token.
187 If the TokenNumber is invalid, the results are unpredictable.
189 @param[in] TokenNumber The PCD token number.
191 @return The size of the value for the PCD token.
201 Retrieves an 8-bit value for a given PCD token.
203 Retrieves the 8-bit value of a particular PCD token.
204 If the TokenNumber is invalid or the token space
205 specified by Guid does not exist, the results are
208 @param[in] Guid The token space for the token number.
209 @param[in] TokenNumber The PCD token number.
211 @return The size 8-bit value for the PCD token.
217 IN CONST EFI_GUID
*Guid
,
222 Retrieves an 16-bit value for a given PCD token.
224 Retrieves the 16-bit value of a particular PCD token.
225 If the TokenNumber is invalid or the token space
226 specified by Guid does not exist, the results are
229 @param[in] Guid The token space for the token number.
230 @param[in] TokenNumber The PCD token number.
232 @return The size 16-bit value for the PCD token.
238 IN CONST EFI_GUID
*Guid
,
243 Retrieves an 32-bit value for a given PCD token.
245 Retrieves the 32-bit value of a particular PCD token.
246 If the TokenNumber is invalid or the token space
247 specified by Guid does not exist, the results are
250 @param[in] Guid The token space for the token number.
251 @param[in] TokenNumber The PCD token number.
253 @return The size 32-bit value for the PCD token.
259 IN CONST EFI_GUID
*Guid
,
264 Retrieves an 64-bit value for a given PCD token.
266 Retrieves the 64-bit value of a particular PCD token.
267 If the TokenNumber is invalid or the token space
268 specified by Guid does not exist, the results are
271 @param[in] Guid The token space for the token number.
272 @param[in] TokenNumber The PCD token number.
274 @return The size 64-bit value for the PCD token.
280 IN CONST EFI_GUID
*Guid
,
285 Retrieves a pointer to a value for a given PCD token.
287 Retrieves the current pointer to the buffer for a PCD token number.
288 Do not make any assumptions about the alignment of the pointer that
289 is returned by this function call. If the TokenNumber is invalid,
290 the results are unpredictable.
292 @param[in] Guid The token space for the token number.
293 @param[in] TokenNumber The PCD token number.
295 @return The pointer to the buffer to be retrived.
301 IN CONST EFI_GUID
*Guid
,
306 Retrieves an Boolean value for a given PCD token.
308 Retrieves the Boolean value of a particular PCD token.
309 If the TokenNumber is invalid or the token space
310 specified by Guid does not exist, the results are
313 @param[in] Guid The token space for the token number.
314 @param[in] TokenNumber The PCD token number.
316 @return The size Boolean value for the PCD token.
322 IN CONST EFI_GUID
*Guid
,
327 Retrieves the size of the value for a given PCD token.
329 Retrieves the current size of a particular PCD token.
330 If the TokenNumber is invalid, the results are unpredictable.
332 @param[in] Guid The token space for the token number.
333 @param[in] TokenNumber The PCD token number.
335 @return The size of the value for the PCD token.
341 IN CONST EFI_GUID
*Guid
,
346 Sets an 8-bit value for a given PCD token.
348 When the PCD service sets a value, it will check to ensure that the
349 size of the value being set is compatible with the Token's existing definition.
350 If it is not, an error will be returned.
352 @param[in] TokenNumber The PCD token number.
353 @param[in] Value The value to set for the PCD token.
355 @retval EFI_SUCCESS Procedure returned successfully.
356 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
357 being set was incompatible with a call to this function.
358 Use GetSize() to retrieve the size of the target data.
359 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
365 IN UINTN TokenNumber
,
370 Sets an 16-bit value for a given PCD token.
372 When the PCD service sets a value, it will check to ensure that the
373 size of the value being set is compatible with the Token's existing definition.
374 If it is not, an error will be returned.
376 @param[in] TokenNumber The PCD token number.
377 @param[in] Value The value to set for the PCD token.
379 @retval EFI_SUCCESS Procedure returned successfully.
380 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
381 being set was incompatible with a call to this function.
382 Use GetSize() to retrieve the size of the target data.
383 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
389 IN UINTN TokenNumber
,
394 Sets an 32-bit value for a given PCD token.
396 When the PCD service sets a value, it will check to ensure that the
397 size of the value being set is compatible with the Token's existing definition.
398 If it is not, an error will be returned.
400 @param[in] TokenNumber The PCD token number.
401 @param[in] Value The value to set for the PCD token.
403 @retval EFI_SUCCESS Procedure returned successfully.
404 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
405 being set was incompatible with a call to this function.
406 Use GetSize() to retrieve the size of the target data.
407 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
413 IN UINTN TokenNumber
,
418 Sets an 64-bit value for a given PCD token.
420 When the PCD service sets a value, it will check to ensure that the
421 size of the value being set is compatible with the Token's existing definition.
422 If it is not, an error will be returned.
424 @param[in] TokenNumber The PCD token number.
425 @param[in] Value The value to set for the PCD token.
427 @retval EFI_SUCCESS Procedure returned successfully.
428 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
429 being set was incompatible with a call to this function.
430 Use GetSize() to retrieve the size of the target data.
431 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
437 IN UINTN TokenNumber
,
442 Sets a value of a specified size for a given PCD token.
444 When the PCD service sets a value, it will check to ensure that the
445 size of the value being set is compatible with the Token's existing definition.
446 If it is not, an error will be returned.
448 @param[in] TokenNumber The PCD token number.
449 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
450 On input, if the SizeOfValue is greater than the maximum size supported
451 for this TokenNumber then the output value of SizeOfValue will reflect
452 the maximum size supported for this TokenNumber.
453 @param[in] Buffer The buffer to set for the PCD token.
455 @retval EFI_SUCCESS Procedure returned successfully.
456 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
457 being set was incompatible with a call to this function.
458 Use GetSize() to retrieve the size of the target data.
459 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
465 IN UINTN TokenNumber
,
466 IN OUT UINTN
*SizeOfBuffer
,
471 Sets an Boolean value for a given PCD token.
473 When the PCD service sets a value, it will check to ensure that the
474 size of the value being set is compatible with the Token's existing definition.
475 If it is not, an error will be returned.
477 @param[in] TokenNumber The PCD token number.
478 @param[in] Value The value to set for the PCD token.
480 @retval EFI_SUCCESS Procedure returned successfully.
481 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
482 being set was incompatible with a call to this function.
483 Use GetSize() to retrieve the size of the target data.
484 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
490 IN UINTN TokenNumber
,
495 Sets an 8-bit value for a given PCD token.
497 When the PCD service sets a value, it will check to ensure that the
498 size of the value being set is compatible with the Token's existing definition.
499 If it is not, an error will be returned.
501 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
502 @param[in] TokenNumber The PCD token number.
503 @param[in] Value The value to set for the PCD token.
505 @retval EFI_SUCCESS Procedure returned successfully.
506 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
507 being set was incompatible with a call to this function.
508 Use GetSize() to retrieve the size of the target data.
509 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
515 IN CONST EFI_GUID
*Guid
,
516 IN UINTN TokenNumber
,
521 Sets an 16-bit value for a given PCD token.
523 When the PCD service sets a value, it will check to ensure that the
524 size of the value being set is compatible with the Token's existing definition.
525 If it is not, an error will be returned.
527 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
528 @param[in] TokenNumber The PCD token number.
529 @param[in] Value The value to set for the PCD token.
531 @retval EFI_SUCCESS Procedure returned successfully.
532 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
533 being set was incompatible with a call to this function.
534 Use GetSize() to retrieve the size of the target data.
535 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
541 IN CONST EFI_GUID
*Guid
,
542 IN UINTN TokenNumber
,
547 Sets an 32-bit value for a given PCD token.
549 When the PCD service sets a value, it will check to ensure that the
550 size of the value being set is compatible with the Token's existing definition.
551 If it is not, an error will be returned.
553 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
554 @param[in] TokenNumber The PCD token number.
555 @param[in] Value The value to set for the PCD token.
557 @retval EFI_SUCCESS Procedure returned successfully.
558 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
559 being set was incompatible with a call to this function.
560 Use GetSize() to retrieve the size of the target data.
561 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
567 IN CONST EFI_GUID
*Guid
,
568 IN UINTN TokenNumber
,
573 Sets an 64-bit value for a given PCD token.
575 When the PCD service sets a value, it will check to ensure that the
576 size of the value being set is compatible with the Token's existing definition.
577 If it is not, an error will be returned.
579 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
580 @param[in] TokenNumber The PCD token number.
581 @param[in] Value The value to set for the PCD token.
583 @retval EFI_SUCCESS Procedure returned successfully.
584 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
585 being set was incompatible with a call to this function.
586 Use GetSize() to retrieve the size of the target data.
587 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
593 IN CONST EFI_GUID
*Guid
,
594 IN UINTN TokenNumber
,
599 Sets a value of a specified size for a given PCD token.
601 When the PCD service sets a value, it will check to ensure that the
602 size of the value being set is compatible with the Token's existing definition.
603 If it is not, an error will be returned.
605 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
606 @param[in] TokenNumber The PCD token number.
607 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
608 On input, if the SizeOfValue is greater than the maximum size supported
609 for this TokenNumber then the output value of SizeOfValue will reflect
610 the maximum size supported for this TokenNumber.
611 @param[in] Buffer The buffer to set for the PCD token.
613 @retval EFI_SUCCESS Procedure returned successfully.
614 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
615 being set was incompatible with a call to this function.
616 Use GetSize() to retrieve the size of the target data.
617 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
623 IN CONST EFI_GUID
*Guid
,
624 IN UINTN TokenNumber
,
625 IN OUT UINTN
*SizeOfBuffer
,
630 Sets an Boolean value for a given PCD token.
632 When the PCD service sets a value, it will check to ensure that the
633 size of the value being set is compatible with the Token's existing definition.
634 If it is not, an error will be returned.
636 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
637 @param[in] TokenNumber The PCD token number.
638 @param[in] Value The value to set for the PCD token.
640 @retval EFI_SUCCESS Procedure returned successfully.
641 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
642 being set was incompatible with a call to this function.
643 Use GetSize() to retrieve the size of the target data.
644 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
650 IN CONST EFI_GUID
*Guid
,
651 IN UINTN TokenNumber
,
656 Specifies a function to be called anytime the value of a designated token is changed.
658 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
659 @param[in] TokenNumber The PCD token number.
660 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
662 @retval EFI_SUCCESS The PCD service has successfully established a call event
663 for the CallBackToken requested.
664 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
669 PeiRegisterCallBackOnSet (
670 IN CONST EFI_GUID
*Guid
, OPTIONAL
671 IN UINTN TokenNumber
,
672 IN PCD_PPI_CALLBACK CallBackFunction
676 Cancels a previously set callback function for a particular PCD token number.
678 @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
679 @param [in] TokenNumber The PCD token number.
680 @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
682 @retval EFI_SUCCESS The PCD service has successfully established a call event
683 for the CallBackToken requested.
684 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
689 PcdUnRegisterCallBackOnSet (
690 IN CONST EFI_GUID
*Guid
, OPTIONAL
691 IN UINTN TokenNumber
,
692 IN PCD_PPI_CALLBACK CallBackFunction
696 Retrieves the next valid token number in a given namespace.
698 This is useful since the PCD infrastructure contains a sparse list of token numbers,
699 and one cannot a priori know what token numbers are valid in the database.
701 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
702 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
703 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
704 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
705 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
706 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
707 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
708 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
711 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
712 This is an optional parameter that may be NULL. If this parameter is NULL, then a request
713 is being made to retrieve tokens from the default token space.
714 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
716 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
717 Or the input token number is already the last valid token number in the PCD database.
718 In the later case, *TokenNumber is updated with the value of 0.
719 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
725 IN CONST EFI_GUID
*Guid
, OPTIONAL
726 IN OUT UINTN
*TokenNumber
730 Retrieves the next valid PCD token namespace for a given namespace.
732 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
733 a known token namespace from which the search will start. On output,
734 it designates the next valid token namespace on the platform. If the input
735 token namespace does not exist on the platform, an error is returned and
736 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
737 first token space of the current platform is assigned to *Guid the function
738 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
739 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
740 and the function return EFI_SUCCESS. If this input token namespace is the last
741 namespace on the platform, *Guid will be assigned to NULL and the function return
744 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
745 Or the input token space Guid is already the last valid token space Guid
746 in the PCD database. In the later case, *Guid is updated with the value of NULL.
747 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
752 PeiPcdGetNextTokenSpace (
753 IN OUT CONST EFI_GUID
**Guid
757 /* Internal Function definitions */
759 Get PCD database from GUID HOB in PEI phase.
761 @return Pointer to PCD database.
770 Wrapper function for setting non-pointer type value for a PCD entry.
772 @param TokenNumber Pcd token number autogenerated by build tools.
773 @param Data Value want to be set for PCD entry
774 @param Size Size of value.
776 @return status of SetWorker.
781 IN UINTN TokenNumber
,
787 Set value for an PCD entry
789 @param TokenNumber Pcd token number autogenerated by build tools.
790 @param Data Value want to be set for PCD entry
791 @param Size Size of value.
792 @param PtrType If TRUE, the type of PCD entry's value is Pointer.
793 If False, the type of PCD entry's value is not Pointer.
795 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
796 @retval EFI_INVALID_PARAMETER If Size can not be set to size table.
797 @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database.
798 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
799 range of UINT8, UINT16, UINT32, UINT64
800 @retval EFI_NOT_FOUND Can not find the PCD type according to token number.
804 IN UINTN TokenNumber
,
811 Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.
813 @param ExTokenNumber Token number for dynamic-ex PCD.
814 @param Guid Token space guid for dynamic-ex PCD.
815 @param Data Value want to be set.
816 @param SetSize The size of value.
818 @return status of ExSetWorker().
823 IN UINTN ExTokenNumber
,
824 IN CONST EFI_GUID
*Guid
,
830 Set value for a dynamic PCD entry.
832 This routine find the local token number according to dynamic-ex PCD's token
833 space guid and token number firstly, and invoke callback function if this PCD
834 entry registered callback function. Finally, invoken general SetWorker to set
837 @param ExTokenNumber Dynamic-ex PCD token number.
838 @param Guid Token space guid for dynamic-ex PCD.
839 @param Data PCD value want to be set
840 @param SetSize Size of value.
841 @param PtrType If TRUE, this PCD entry is pointer type.
842 If FALSE, this PCD entry is not pointer type.
844 @return status of SetWorker().
849 IN UINTN ExTokenNumber
,
850 IN CONST EFI_GUID
*Guid
,
857 Get the PCD entry pointer in PCD database.
859 This routine will visit PCD database to find the PCD entry according to given
860 token number. The given token number is autogened by build tools and it will be
861 translated to local token number. Local token number contains PCD's type and
862 offset of PCD entry in PCD database.
864 @param TokenNumber Token's number, it is autogened by build tools
865 @param GetSize The size of token's value
867 @return PCD entry pointer in PCD database
872 IN UINTN TokenNumber
,
877 Wrapper function for get PCD value for dynamic-ex PCD.
879 @param Guid Token space guid for dynamic-ex PCD.
880 @param ExTokenNumber Token number for dyanmic-ex PCD.
881 @param GetSize The size of dynamic-ex PCD value.
883 @return PCD entry in PCD database.
888 IN CONST EFI_GUID
*Guid
,
889 IN UINTN ExTokenNumber
,
896 UINT32 LocalTokenNumberAlias
;
897 } EX_PCD_ENTRY_ATTRIBUTE
;
900 Get local token number according to dynamic-ex PCD's {token space guid:token number}
902 A dynamic-ex type PCD, developer must provide pair of token space guid: token number
903 in DEC file. PCD database maintain a mapping table that translate pair of {token
904 space guid: token number} to local token number.
906 @param Guid Token space guid for dynamic-ex PCD entry.
907 @param ExTokenNumber Token number for dynamic-ex PCD.
909 @return local token number for dynamic-ex PCD.
913 GetExPcdTokenNumber (
914 IN CONST EFI_GUID
*Guid
,
915 IN UINTN ExTokenNumber
919 The function registers the CallBackOnSet fucntion
920 according to TokenNumber and EFI_GUID space.
922 @param TokenNumber The token number.
923 @param Guid The GUID space.
924 @param CallBackFunction The Callback function to be registered.
925 @param Register To register or unregister the callback function.
927 @retval EFI_SUCCESS If the Callback function is registered.
928 @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
929 @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
930 slot left in the CallbackFnTable.
933 PeiRegisterCallBackWorker (
934 IN UINTN TokenNumber
,
935 IN CONST EFI_GUID
*Guid
, OPTIONAL
936 IN PCD_PPI_CALLBACK CallBackFunction
,
941 The function builds the PCD database.
949 Get SKU ID tabble from PCD database.
951 @param LocalTokenNumberTableIdx Index of local token number in token number table.
952 @param Database PCD Database in PEI phase
954 @return Pointer to SKU ID array table
959 IN UINTN LocalTokenNumberTableIdx
,
960 IN PEI_PCD_DATABASE
*Database
964 Get index of PCD entry in size table.
966 @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
967 @param Database Pointer to PCD database.
969 @return index of PCD entry in size table.
974 IN UINTN LocalTokenNumberTableIdx
,
975 IN PEI_PCD_DATABASE
*Database
979 Get PCD value's size for POINTER type PCD.
981 The POINTER type PCD's value will be stored into a buffer in specificed size.
982 The max size of this PCD's value is described in PCD's definition in DEC file.
984 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
985 @param MaxSize Maxmium size of PCD's value
986 @param Database Pcd database in PEI phase.
988 @return PCD value's size for POINTER type PCD.
993 IN UINTN LocalTokenNumberTableIdx
,
995 IN PEI_PCD_DATABASE
*Database
999 Set PCD value's size for POINTER type PCD.
1001 The POINTER type PCD's value will be stored into a buffer in specificed size.
1002 The max size of this PCD's value is described in PCD's definition in DEC file.
1004 @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table
1005 @param CurrentSize Maxmium size of PCD's value
1006 @param Database Pcd database in PEI phase.
1008 @retval TRUE Success to set PCD's value size, which is not exceed maxmium size
1009 @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size
1014 IN UINTN LocalTokenNumberTableIdx
,
1015 IN OUT UINTN
*CurrentSize
,
1016 IN PEI_PCD_DATABASE
*Database
1020 // The init Database created by PCD Database generation tool
1022 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit
;