2 Implementation of PcdLib class library for PEI phase.
4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
5 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.
22 #include <Ppi/PiPcd.h>
23 #include <Ppi/PcdInfo.h>
24 #include <Ppi/PiPcdInfo.h>
26 #include <Library/PeiServicesLib.h>
27 #include <Library/PcdLib.h>
28 #include <Library/DebugLib.h>
29 #include <Library/BaseMemoryLib.h>
32 Retrieve the PCD_PPI pointer.
34 This function is to locate PCD_PPI PPI via PeiService.
35 If fail to locate PCD_PPI, then ASSERT_EFI_ERROR().
37 @retval PCD_PPI * The pointer to the PCD_PPI.
48 Status
= PeiServicesLocatePpi (&gPcdPpiGuid
, 0, NULL
, (VOID
**)&PcdPpi
);
49 ASSERT_EFI_ERROR (Status
);
55 Retrieve the pointer of EFI_PEI_PCD_PPI defined in PI 1.2 Vol 3.
57 This function is to locate EFI_PEI_PCD_PPI PPI via PeiService.
58 If fail to locate EFI_PEI_PCD_PPI, then ASSERT_EFI_ERROR().
60 @retval EFI_PEI_PCD_PPI * The pointer to the EFI_PEI_PCD_PPI.
69 EFI_PEI_PCD_PPI
*PiPcdPpi
;
71 Status
= PeiServicesLocatePpi (&gEfiPeiPcdPpiGuid
, 0, NULL
, (VOID
**)&PiPcdPpi
);
72 ASSERT_EFI_ERROR (Status
);
78 Retrieve the GET_PCD_INFO_PPI pointer.
80 This function is to locate GET_PCD_INFO_PPI PPI via PeiService.
81 If fail to locate GET_PCD_INFO_PPI, then ASSERT_EFI_ERROR().
83 @retval GET_PCD_INFO_PPI * The pointer to the GET_PCD_INFO_PPI.
87 GetPcdInfoPpiPointer (
92 GET_PCD_INFO_PPI
*PcdInfoPpi
;
94 Status
= PeiServicesLocatePpi (&gGetPcdInfoPpiGuid
, 0, NULL
, (VOID
**)&PcdInfoPpi
);
95 ASSERT_EFI_ERROR (Status
);
101 Retrieve the pointer of EFI_GET_PCD_INFO_PPI defined in PI 1.2.1 Vol 3.
103 This function is to locate EFI_GET_PCD_INFO_PPI PPI via PeiService.
104 If fail to locate EFI_GET_PCD_INFO_PPI, then ASSERT_EFI_ERROR().
106 @retval EFI_GET_PCD_INFO_PPI * The pointer to the EFI_GET_PCD_INFO_PPI.
109 EFI_GET_PCD_INFO_PPI
*
110 GetPiPcdInfoPpiPointer (
115 EFI_GET_PCD_INFO_PPI
*PiPcdInfoPpi
;
117 Status
= PeiServicesLocatePpi (&gEfiGetPcdInfoPpiGuid
, 0, NULL
, (VOID
**)&PiPcdInfoPpi
);
118 ASSERT_EFI_ERROR (Status
);
124 This function provides a means by which SKU support can be established in the PCD infrastructure.
126 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
127 If SkuId >= PCD_MAX_SKU_ID, then ASSERT().
129 @param SkuId The SKU value that will be used when the PCD service retrieves
130 and sets values associated with a PCD token.
132 @return Return the SKU ID that just be set.
142 ASSERT (SkuId
< PCD_MAX_SKU_ID
);
144 GetPiPcdPpiPointer()->SetSku (SkuId
);
152 This function provides a means by which to retrieve a value for a given PCD token.
154 Returns the 8-bit value for the token specified by TokenNumber.
156 @param[in] TokenNumber The PCD token number to retrieve a current value for.
158 @return Returns the 8-bit value for the token specified by TokenNumber.
167 return (GetPcdPpiPointer ())->Get8 (TokenNumber
);
173 This function provides a means by which to retrieve a value for a given PCD token.
175 Returns the 16-bit value for the token specified by TokenNumber.
177 @param[in] TokenNumber The PCD token number to retrieve a current value for.
179 @return Returns the 16-bit value for the token specified by TokenNumber.
188 return (GetPcdPpiPointer ())->Get16 (TokenNumber
);
194 This function provides a means by which to retrieve a value for a given PCD token.
196 Returns the 32-bit value for the token specified by TokenNumber.
198 @param[in] TokenNumber The PCD token number to retrieve a current value for.
200 @return Returns the 32-bit value for the token specified by TokenNumber.
209 return (GetPcdPpiPointer ())->Get32 (TokenNumber
);
215 This function provides a means by which to retrieve a value for a given PCD token.
217 Returns the 64-bit value for the token specified by TokenNumber.
219 @param[in] TokenNumber The PCD token number to retrieve a current value for.
221 @return Returns the 64-bit value for the token specified by TokenNumber.
230 return (GetPcdPpiPointer ())->Get64 (TokenNumber
);
236 This function provides a means by which to retrieve a value for a given PCD token.
238 Returns the pointer to the buffer of the token specified by TokenNumber.
240 @param[in] TokenNumber The PCD token number to retrieve a current value for.
242 @return Returns the pointer to the token specified by TokenNumber.
251 return (GetPcdPpiPointer ())->GetPtr (TokenNumber
);
257 This function provides a means by which to retrieve a value for a given PCD token.
259 Returns the Boolean value of the token specified by TokenNumber.
261 @param[in] TokenNumber The PCD token number to retrieve a current value for.
263 @return Returns the Boolean value of the token specified by TokenNumber.
272 return (GetPcdPpiPointer ())->GetBool (TokenNumber
);
278 This function provides a means by which to retrieve the size of a given PCD token.
280 @param[in] TokenNumber The PCD token number to retrieve a current value for.
282 @return Returns the size of the token specified by TokenNumber.
291 return (GetPcdPpiPointer ())->GetSize (TokenNumber
);
297 This function provides a means by which to retrieve a value for a given PCD token.
299 Returns the 8-bit value for the token specified by TokenNumber and Guid.
301 If Guid is NULL, then ASSERT().
303 @param[in] Guid The pointer to a 128-bit unique value that designates
304 which namespace to retrieve a value from.
305 @param[in] TokenNumber The PCD token number to retrieve a current value for.
307 @return Return the UINT8.
317 ASSERT (Guid
!= NULL
);
319 return (GetPiPcdPpiPointer ())->Get8 (Guid
, TokenNumber
);
325 This function provides a means by which to retrieve a value for a given PCD token.
327 Returns the 16-bit value for the token specified by TokenNumber and Guid.
329 If Guid is NULL, then ASSERT().
331 @param[in] Guid The pointer to a 128-bit unique value that designates
332 which namespace to retrieve a value from.
333 @param[in] TokenNumber The PCD token number to retrieve a current value for.
335 @return Return the UINT16.
346 ASSERT (Guid
!= NULL
);
348 return (GetPiPcdPpiPointer ())->Get16 (Guid
, TokenNumber
);
354 Returns the 32-bit value for the token specified by TokenNumber and Guid.
355 If Guid is NULL, then ASSERT().
357 @param[in] Guid The pointer to a 128-bit unique value that designates
358 which namespace to retrieve a value from.
359 @param[in] TokenNumber The PCD token number to retrieve a current value for.
361 @return Return the UINT32.
371 ASSERT (Guid
!= NULL
);
373 return (GetPiPcdPpiPointer ())->Get32 (Guid
, TokenNumber
);
380 This function provides a means by which to retrieve a value for a given PCD token.
382 Returns the 64-bit value for the token specified by TokenNumber and Guid.
384 If Guid is NULL, then ASSERT().
386 @param[in] Guid The pointer to a 128-bit unique value that designates
387 which namespace to retrieve a value from.
388 @param[in] TokenNumber The PCD token number to retrieve a current value for.
390 @return Return the UINT64.
400 ASSERT (Guid
!= NULL
);
401 return (GetPiPcdPpiPointer ())->Get64 (Guid
, TokenNumber
);
407 This function provides a means by which to retrieve a value for a given PCD token.
409 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
411 If Guid is NULL, then ASSERT().
413 @param[in] Guid The pointer to a 128-bit unique value that designates
414 which namespace to retrieve a value from.
415 @param[in] TokenNumber The PCD token number to retrieve a current value for.
417 @return Return the VOID* pointer.
427 ASSERT (Guid
!= NULL
);
429 return (GetPiPcdPpiPointer ())->GetPtr (Guid
, TokenNumber
);
435 This function provides a means by which to retrieve a value for a given PCD token.
437 Returns the Boolean value of the token specified by TokenNumber and Guid.
439 If Guid is NULL, then ASSERT().
441 @param[in] Guid The pointer to a 128-bit unique value that designates
442 which namespace to retrieve a value from.
443 @param[in] TokenNumber The PCD token number to retrieve a current value for.
445 @return Return the BOOLEAN.
455 ASSERT (Guid
!= NULL
);
456 return (GetPiPcdPpiPointer ())->GetBool (Guid
, TokenNumber
);
462 This function provides a means by which to retrieve the size of a given PCD token.
464 Returns the size of the token specified by TokenNumber and Guid.
466 If Guid is NULL, then ASSERT().
468 @param[in] Guid The pointer to a 128-bit unique value that designates
469 which namespace to retrieve a value from.
470 @param[in] TokenNumber The PCD token number to retrieve a current value for.
472 @return Return the size.
482 ASSERT (Guid
!= NULL
);
483 return (GetPiPcdPpiPointer ())->GetSize (Guid
, TokenNumber
);
489 This function provides a means by which to set a value for a given PCD token.
491 Sets the 8-bit value for the token specified by TokenNumber
492 to the value specified by Value. Value is returned.
494 If the set operation was not correctly performed, then ASSERT().
496 @param[in] TokenNumber The PCD token number to set a current value for.
497 @param[in] Value The 8-bit value to set.
499 @return Return the value that was set.
505 IN UINTN TokenNumber
,
511 Status
= (GetPcdPpiPointer ())->Set8 (TokenNumber
, Value
);
513 ASSERT_EFI_ERROR (Status
);
521 This function provides a means by which to set a value for a given PCD token.
523 Sets the 16-bit value for the token specified by TokenNumber
524 to the value specified by Value. Value is returned.
526 If the set operation was not correctly performed, then ASSERT().
528 @param[in] TokenNumber The PCD token number to set a current value for.
529 @param[in] Value The 16-bit value to set.
531 @return Return the value that was set.
537 IN UINTN TokenNumber
,
543 Status
= (GetPcdPpiPointer ())->Set16 (TokenNumber
, Value
);
545 ASSERT_EFI_ERROR (Status
);
553 This function provides a means by which to set a value for a given PCD token.
555 Sets the 32-bit value for the token specified by TokenNumber
556 to the value specified by Value. Value is returned.
558 If the set operation was not correctly performed, then ASSERT().
560 @param[in] TokenNumber The PCD token number to set a current value for.
561 @param[in] Value The 32-bit value to set.
563 @return Return the value that was set.
569 IN UINTN TokenNumber
,
575 Status
= (GetPcdPpiPointer ())->Set32 (TokenNumber
, Value
);
577 ASSERT_EFI_ERROR (Status
);
585 This function provides a means by which to set a value for a given PCD token.
587 Sets the 64-bit value for the token specified by TokenNumber
588 to the value specified by Value. Value is returned.
590 If the set operation was not correctly performed, then ASSERT().
592 @param[in] TokenNumber The PCD token number to set a current value for.
593 @param[in] Value The 64-bit value to set.
595 @return Return the value that was set.
601 IN UINTN TokenNumber
,
607 Status
= (GetPcdPpiPointer ())->Set64 (TokenNumber
, Value
);
609 ASSERT_EFI_ERROR (Status
);
617 This function provides a means by which to set a value for a given PCD token.
619 Sets a buffer for the token specified by TokenNumber to the value
620 specified by Buffer and SizeOfBuffer. Buffer is returned.
621 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
622 then set SizeOfBuffer to the maximum size supported by TokenNumber and
623 return NULL to indicate that the set operation was not actually performed,
624 or ASSERT() if the set operation was not corretly performed.
626 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
627 maximum size supported by TokenName and NULL must be returned.
629 If SizeOfBuffer is NULL, then ASSERT().
630 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
632 @param[in] TokenNumber The PCD token number to set a current value for.
633 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
634 @param[in] Buffer A pointer to the buffer to set.
636 @return Return the pointer for the buffer been set.
642 IN UINTN TokenNumber
,
643 IN OUT UINTN
*SizeOfBuffer
,
644 IN CONST VOID
*Buffer
648 UINTN InputSizeOfBuffer
;
650 ASSERT (SizeOfBuffer
!= NULL
);
652 if (*SizeOfBuffer
> 0) {
653 ASSERT (Buffer
!= NULL
);
656 InputSizeOfBuffer
= *SizeOfBuffer
;
657 Status
= (GetPcdPpiPointer ())->SetPtr (TokenNumber
, SizeOfBuffer
, (VOID
*) Buffer
);
658 if (EFI_ERROR (Status
) && (*SizeOfBuffer
< InputSizeOfBuffer
)) {
661 ASSERT_EFI_ERROR (Status
);
663 return (VOID
*) Buffer
;
669 This function provides a means by which to set a value for a given PCD token.
671 Sets the Boolean value for the token specified by TokenNumber
672 to the value specified by Value. Value is returned.
674 If the set operation was not correctly performed, then ASSERT().
676 @param[in] TokenNumber The PCD token number to set a current value for.
677 @param[in] Value The boolean value to set.
679 @return Return the value that was set.
685 IN UINTN TokenNumber
,
691 Status
= (GetPcdPpiPointer ())->SetBool (TokenNumber
, Value
);
693 ASSERT_EFI_ERROR (Status
);
701 This function provides a means by which to set a value for a given PCD token.
703 Sets the 8-bit value for the token specified by TokenNumber and
704 Guid to the value specified by Value. Value is returned.
706 If Guid is NULL, then ASSERT().
707 If the set operation was not correctly performed, then ASSERT().
709 @param[in] Guid The pointer to a 128-bit unique value that
710 designates which namespace to set a value from.
711 @param[in] TokenNumber The PCD token number to set a current value for.
712 @param[in] Value The 8-bit value to set.
714 @return Return the value that was set.
721 IN UINTN TokenNumber
,
727 ASSERT (Guid
!= NULL
);
729 Status
= (GetPiPcdPpiPointer ())->Set8 (Guid
, TokenNumber
, Value
);
731 ASSERT_EFI_ERROR (Status
);
739 This function provides a means by which to set a value for a given PCD token.
741 Sets the 16-bit value for the token specified by TokenNumber and
742 Guid to the value specified by Value. Value is returned.
744 If Guid is NULL, then ASSERT().
745 If the set operation was not correctly performed, then ASSERT().
747 @param[in] Guid The pointer to a 128-bit unique value that
748 designates which namespace to set a value from.
749 @param[in] TokenNumber The PCD token number to set a current value for.
750 @param[in] Value The 16-bit value to set.
752 @return Return the value that was set.
759 IN UINTN TokenNumber
,
764 ASSERT (Guid
!= NULL
);
765 Status
= (GetPiPcdPpiPointer ())->Set16 (Guid
, TokenNumber
, Value
);
767 ASSERT_EFI_ERROR (Status
);
775 This function provides a means by which to set a value for a given PCD token.
777 Sets the 32-bit value for the token specified by TokenNumber and
778 Guid to the value specified by Value. Value is returned.
780 If Guid is NULL, then ASSERT().
781 If the set operation was not correctly performed, then ASSERT().
783 @param[in] Guid The pointer to a 128-bit unique value that
784 designates which namespace to set a value from.
785 @param[in] TokenNumber The PCD token number to set a current value for.
786 @param[in] Value The 32-bit value to set.
788 @return Return the value that was set.
795 IN UINTN TokenNumber
,
801 ASSERT (Guid
!= NULL
);
803 Status
= (GetPiPcdPpiPointer ())->Set32 (Guid
, TokenNumber
, Value
);
805 ASSERT_EFI_ERROR (Status
);
813 This function provides a means by which to set a value for a given PCD token.
815 Sets the 64-bit value for the token specified by TokenNumber and
816 Guid to the value specified by Value. Value is returned.
818 If Guid is NULL, then ASSERT().
819 If the set operation was not correctly performed, then ASSERT().
821 @param[in] Guid The pointer to a 128-bit unique value that
822 designates which namespace to set a value from.
823 @param[in] TokenNumber The PCD token number to set a current value for.
824 @param[in] Value The 64-bit value to set.
826 @return Return the value that was set.
833 IN UINTN TokenNumber
,
838 ASSERT (Guid
!= NULL
);
840 Status
= (GetPiPcdPpiPointer ())->Set64 (Guid
, TokenNumber
, Value
);
842 ASSERT_EFI_ERROR (Status
);
850 This function provides a means by which to set a value for a given PCD token.
852 Sets a buffer for the token specified by TokenNumber to the value specified by
853 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
854 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
855 supported by TokenNumber and return NULL to indicate that the set operation
856 was not actually performed, or ASSERT() if the set operation was not corretly performed.
858 If Guid is NULL, then ASSERT().
859 If SizeOfBuffer is NULL, then ASSERT().
860 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
862 @param[in] Guid The pointer to a 128-bit unique value that
863 designates which namespace to set a value from.
864 @param[in] TokenNumber The PCD token number to set a current value for.
865 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
866 @param[in] Buffer A pointer to the buffer to set.
868 @return Return the pinter to the buffer been set.
875 IN UINTN TokenNumber
,
876 IN OUT UINTN
*SizeOfBuffer
,
881 UINTN InputSizeOfBuffer
;
884 ASSERT (SizeOfBuffer
!= NULL
);
885 if (*SizeOfBuffer
> 0) {
886 ASSERT (Buffer
!= NULL
);
888 ASSERT (Guid
!= NULL
);
890 InputSizeOfBuffer
= *SizeOfBuffer
;
891 Status
= (GetPiPcdPpiPointer ())->SetPtr (Guid
, TokenNumber
, SizeOfBuffer
, Buffer
);
892 if (EFI_ERROR (Status
) && (*SizeOfBuffer
< InputSizeOfBuffer
)) {
895 ASSERT_EFI_ERROR (Status
);
903 This function provides a means by which to set a value for a given PCD token.
905 Sets the Boolean value for the token specified by TokenNumber and
906 Guid to the value specified by Value. Value is returned.
908 If Guid is NULL, then ASSERT().
909 If the set operation was not correctly performed, then ASSERT().
911 @param[in] Guid The pointer to a 128-bit unique value that
912 designates which namespace to set a value from.
913 @param[in] TokenNumber The PCD token number to set a current value for.
914 @param[in] Value The Boolean value to set.
916 @return Return the value that was set.
923 IN UINTN TokenNumber
,
929 ASSERT (Guid
!= NULL
);
930 Status
= (GetPiPcdPpiPointer ())->SetBool (Guid
, TokenNumber
, Value
);
932 ASSERT_EFI_ERROR (Status
);
940 Set up a notification function that is called when a specified token is set.
942 When the token specified by TokenNumber and Guid is set,
943 then notification function specified by NotificationFunction is called.
944 If Guid is NULL, then the default token space is used.
945 If NotificationFunction is NULL, then ASSERT().
947 @param[in] Guid The pointer to a 128-bit unique value that
948 designates which namespace to set a value from.
949 If NULL, then the default token space is used.
950 @param[in] TokenNumber The PCD token number to monitor.
951 @param[in] NotificationFunction The function to call when the token
952 specified by Guid and TokenNumber is set.
957 LibPcdCallbackOnSet (
958 IN CONST GUID
*Guid
, OPTIONAL
959 IN UINTN TokenNumber
,
960 IN PCD_CALLBACK NotificationFunction
965 ASSERT (NotificationFunction
!= NULL
);
967 Status
= (GetPiPcdPpiPointer ())->CallbackOnSet (Guid
, TokenNumber
, (EFI_PEI_PCD_PPI_CALLBACK
) NotificationFunction
);
969 ASSERT_EFI_ERROR (Status
);
977 Disable a notification function that was established with LibPcdCallbackonSet().
979 Disable a notification function that was previously established with LibPcdCallbackOnSet().
980 If NotificationFunction is NULL, then ASSERT().
981 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
982 and NotificationFunction, then ASSERT().
984 @param[in] Guid Specify the GUID token space.
985 @param[in] TokenNumber Specify the token number.
986 @param[in] NotificationFunction The callback function to be unregistered.
991 LibPcdCancelCallback (
992 IN CONST GUID
*Guid
, OPTIONAL
993 IN UINTN TokenNumber
,
994 IN PCD_CALLBACK NotificationFunction
999 ASSERT (NotificationFunction
!= NULL
);
1001 Status
= (GetPiPcdPpiPointer ())->CancelCallback (Guid
, TokenNumber
, (EFI_PEI_PCD_PPI_CALLBACK
) NotificationFunction
);
1003 ASSERT_EFI_ERROR (Status
);
1011 Retrieves the next token in a token space.
1013 Retrieves the next PCD token number from the token space specified by Guid.
1014 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1015 then the first token number is returned. Otherwise, the token number that
1016 follows TokenNumber in the token space is returned. If TokenNumber is the last
1017 token number in the token space, then 0 is returned.
1019 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1021 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace
1022 to set a value from. If NULL, then the default token space is used.
1023 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1026 @return The next valid token number.
1031 LibPcdGetNextToken (
1032 IN CONST GUID
*Guid
, OPTIONAL
1033 IN UINTN TokenNumber
1038 Status
= (GetPiPcdPpiPointer ())->GetNextToken (Guid
, &TokenNumber
);
1039 ASSERT (!EFI_ERROR (Status
) || TokenNumber
== 0);
1046 Used to retrieve the list of available PCD token space GUIDs.
1048 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1050 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1051 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1053 @param TokenSpaceGuid The pointer to the a PCD token space GUID
1055 @return The next valid token namespace.
1060 LibPcdGetNextTokenSpace (
1061 IN CONST GUID
*TokenSpaceGuid
1064 (GetPiPcdPpiPointer ())->GetNextTokenSpace (&TokenSpaceGuid
);
1066 return (GUID
*) TokenSpaceGuid
;
1072 Sets a value of a patchable PCD entry that is type pointer.
1074 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1075 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1076 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1077 NULL to indicate that the set operation was not actually performed.
1078 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1079 MaximumDatumSize and NULL must be returned.
1081 If PatchVariable is NULL, then ASSERT().
1082 If SizeOfBuffer is NULL, then ASSERT().
1083 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1085 @param[in] PatchVariable A pointer to the global variable in a module that is
1086 the target of the set operation.
1087 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1088 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1089 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1091 @return Return the pointer to the buffer been set.
1097 IN VOID
*PatchVariable
,
1098 IN UINTN MaximumDatumSize
,
1099 IN OUT UINTN
*SizeOfBuffer
,
1100 IN CONST VOID
*Buffer
1103 ASSERT (PatchVariable
!= NULL
);
1104 ASSERT (SizeOfBuffer
!= NULL
);
1106 if (*SizeOfBuffer
> 0) {
1107 ASSERT (Buffer
!= NULL
);
1110 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1111 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1112 *SizeOfBuffer
= MaximumDatumSize
;
1116 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1118 return (VOID
*) Buffer
;
1122 Retrieve additional information associated with a PCD token.
1124 This includes information such as the type of value the TokenNumber is associated with as well as possible
1125 human readable name that is associated with the token.
1127 If TokenNumber is not in the default token space specified, then ASSERT().
1129 @param[in] TokenNumber The PCD token number.
1130 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1131 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1136 IN UINTN TokenNumber
,
1137 OUT PCD_INFO
*PcdInfo
1142 Status
= GetPcdInfoPpiPointer()->GetInfo (TokenNumber
, (EFI_PCD_INFO
*) PcdInfo
);
1143 ASSERT_EFI_ERROR (Status
);
1147 Retrieve additional information associated with a PCD token.
1149 This includes information such as the type of value the TokenNumber is associated with as well as possible
1150 human readable name that is associated with the token.
1152 If TokenNumber is not in the token space specified by Guid, then ASSERT().
1154 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
1155 @param[in] TokenNumber The PCD token number.
1156 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1157 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1162 IN CONST GUID
*Guid
,
1163 IN UINTN TokenNumber
,
1164 OUT PCD_INFO
*PcdInfo
1169 Status
= GetPiPcdInfoPpiPointer()->GetInfo (Guid
, TokenNumber
, (EFI_PCD_INFO
*) PcdInfo
);
1170 ASSERT_EFI_ERROR (Status
);
1174 Retrieve the currently set SKU Id.
1176 If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().
1178 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
1179 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
1190 SkuId
= GetPiPcdInfoPpiPointer()->GetSku ();
1191 ASSERT (SkuId
< PCD_MAX_SKU_ID
);