2 Implementation of PcdLib class library for DXE phase.
4 Copyright (c) 2006 - 2013, 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.
19 #include <Protocol/Pcd.h>
20 #include <Protocol/PiPcd.h>
21 #include <Protocol/PcdInfo.h>
22 #include <Protocol/PiPcdInfo.h>
24 #include <Library/PcdLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <Library/BaseMemoryLib.h>
29 PCD_PROTOCOL
*mPcd
= NULL
;
30 EFI_PCD_PROTOCOL
*mPiPcd
= NULL
;
31 GET_PCD_INFO_PROTOCOL
*mPcdInfo
= NULL
;
32 EFI_GET_PCD_INFO_PROTOCOL
*mPiPcdInfo
= NULL
;
35 Retrieves the PI PCD protocol from the handle database.
37 @retval EFI_PCD_PROTOCOL * The pointer to the EFI_PCD_PROTOCOL.
49 // PI Pcd protocol defined in PI 1.2 vol3 should be installed before the module
50 // access DynamicEx type PCD.
52 Status
= gBS
->LocateProtocol (&gEfiPcdProtocolGuid
, NULL
, (VOID
**) &mPiPcd
);
53 ASSERT_EFI_ERROR (Status
);
54 ASSERT (mPiPcd
!= NULL
);
60 Retrieves the PCD protocol from the handle database.
62 @retval PCD_PROTOCOL * The pointer to the PCD_PROTOCOL.
74 // PCD protocol need to be installed before the module access Dynamic type PCD.
75 // But dynamic type PCD is not required in PI 1.2 specification.
77 Status
= gBS
->LocateProtocol (&gPcdProtocolGuid
, NULL
, (VOID
**)&mPcd
);
78 ASSERT_EFI_ERROR (Status
);
79 ASSERT (mPcd
!= NULL
);
85 Retrieves the PI PCD info protocol from the handle database.
87 @retval EFI_GET_PCD_INFO_PROTOCOL * The pointer to the EFI_GET_PCD_INFO_PROTOCOL defined in PI 1.2.1 Vol 3.
89 EFI_GET_PCD_INFO_PROTOCOL
*
90 GetPiPcdInfoProtocolPointer (
96 if (mPiPcdInfo
== NULL
) {
97 Status
= gBS
->LocateProtocol (&gEfiGetPcdInfoProtocolGuid
, NULL
, (VOID
**)&mPiPcdInfo
);
98 ASSERT_EFI_ERROR (Status
);
99 ASSERT (mPiPcdInfo
!= NULL
);
105 Retrieves the PCD info protocol from the handle database.
107 @retval GET_PCD_INFO_PROTOCOL * The pointer to the GET_PCD_INFO_PROTOCOL.
109 GET_PCD_INFO_PROTOCOL
*
110 GetPcdInfoProtocolPointer (
116 if (mPcdInfo
== NULL
) {
117 Status
= gBS
->LocateProtocol (&gGetPcdInfoProtocolGuid
, NULL
, (VOID
**)&mPcdInfo
);
118 ASSERT_EFI_ERROR (Status
);
119 ASSERT (mPcdInfo
!= NULL
);
125 This function provides a means by which SKU support can be established in the PCD infrastructure.
127 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
128 If SkuId >= PCD_MAX_SKU_ID, then ASSERT().
130 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values
131 associated with a PCD token.
133 @return Return the SKU ID that just be set.
142 ASSERT (SkuId
< PCD_MAX_SKU_ID
);
144 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPcdProtocol()->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 GetPiPcdProtocol()->Get8 (Guid
, TokenNumber
);
324 This function provides a means by which to retrieve a value for a given PCD token.
326 Returns the 16-bit value for the token specified by TokenNumber and Guid.
328 If Guid is NULL, then ASSERT().
330 @param[in] Guid The pointer to a 128-bit unique value that designates
331 which namespace to retrieve a value from.
332 @param[in] TokenNumber The PCD token number to retrieve a current value for.
334 @return Return the UINT16.
344 ASSERT (Guid
!= NULL
);
346 return GetPiPcdProtocol()->Get16 (Guid
, TokenNumber
);
351 Returns the 32-bit value for the token specified by TokenNumber and Guid.
352 If Guid is NULL, then ASSERT().
354 @param[in] Guid The pointer to a 128-bit unique value that designates
355 which namespace to retrieve a value from.
356 @param[in] TokenNumber The PCD token number to retrieve a current value for.
358 @return Return the UINT32.
368 ASSERT (Guid
!= NULL
);
370 return GetPiPcdProtocol()->Get32 (Guid
, TokenNumber
);
376 This function provides a means by which to retrieve a value for a given PCD token.
378 Returns the 64-bit value for the token specified by TokenNumber and Guid.
380 If Guid is NULL, then ASSERT().
382 @param[in] Guid The pointer to a 128-bit unique value that designates
383 which namespace to retrieve a value from.
384 @param[in] TokenNumber The PCD token number to retrieve a current value for.
386 @return Return the UINT64.
396 ASSERT (Guid
!= NULL
);
398 return GetPiPcdProtocol()->Get64 (Guid
, TokenNumber
);
404 This function provides a means by which to retrieve a value for a given PCD token.
406 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
408 If Guid is NULL, then ASSERT().
410 @param[in] Guid The pointer to a 128-bit unique value that designates
411 which namespace to retrieve a value from.
412 @param[in] TokenNumber The PCD token number to retrieve a current value for.
414 @return Return the VOID* pointer.
424 ASSERT (Guid
!= NULL
);
426 return GetPiPcdProtocol()->GetPtr (Guid
, TokenNumber
);
432 This function provides a means by which to retrieve a value for a given PCD token.
434 Returns the Boolean value of the token specified by TokenNumber and Guid.
436 If Guid is NULL, then ASSERT().
438 @param[in] Guid The pointer to a 128-bit unique value that designates
439 which namespace to retrieve a value from.
440 @param[in] TokenNumber The PCD token number to retrieve a current value for.
442 @return Return the BOOLEAN.
452 ASSERT (Guid
!= NULL
);
454 return GetPiPcdProtocol()->GetBool (Guid
, TokenNumber
);
460 This function provides a means by which to retrieve the size of a given PCD token.
462 Returns the size of the token specified by TokenNumber and Guid.
464 If Guid is NULL, then ASSERT().
466 @param[in] Guid The pointer to a 128-bit unique value that designates
467 which namespace to retrieve a value from.
468 @param[in] TokenNumber The PCD token number to retrieve a current value for.
470 @return Return the size.
480 ASSERT (Guid
!= NULL
);
482 return GetPiPcdProtocol()->GetSize (Guid
, TokenNumber
);
488 This function provides a means by which to set a value for a given PCD token.
490 Sets the 8-bit value for the token specified by TokenNumber
491 to the value specified by Value. Value is returned.
493 @param[in] TokenNumber The PCD token number to set a current value for.
494 @param[in] Value The 8-bit value to set.
496 @return Return the value that was set.
502 IN UINTN TokenNumber
,
508 Status
= GetPcdProtocol()->Set8 (TokenNumber
, Value
);
509 ASSERT_EFI_ERROR (Status
);
517 This function provides a means by which to set a value for a given PCD token.
519 Sets the 16-bit value for the token specified by TokenNumber
520 to the value specified by Value. Value is returned.
522 @param[in] TokenNumber The PCD token number to set a current value for.
523 @param[in] Value The 16-bit value to set.
525 @return Return the value that was set.
531 IN UINTN TokenNumber
,
537 Status
= GetPcdProtocol()->Set16 (TokenNumber
, Value
);
538 ASSERT_EFI_ERROR (Status
);
546 This function provides a means by which to set a value for a given PCD token.
548 Sets the 32-bit value for the token specified by TokenNumber
549 to the value specified by Value. Value is returned.
551 @param[in] TokenNumber The PCD token number to set a current value for.
552 @param[in] Value The 32-bit value to set.
554 @return Return the value that was set.
560 IN UINTN TokenNumber
,
566 Status
= GetPcdProtocol()->Set32 (TokenNumber
, Value
);
567 ASSERT_EFI_ERROR (Status
);
575 This function provides a means by which to set a value for a given PCD token.
577 Sets the 64-bit value for the token specified by TokenNumber
578 to the value specified by Value. Value is returned.
580 @param[in] TokenNumber The PCD token number to set a current value for.
581 @param[in] Value The 64-bit value to set.
583 @return Return the value that was set.
589 IN UINTN TokenNumber
,
595 Status
= GetPcdProtocol()->Set64 (TokenNumber
, Value
);
596 ASSERT_EFI_ERROR (Status
);
604 This function provides a means by which to set a value for a given PCD token.
606 Sets a buffer for the token specified by TokenNumber to the value
607 specified by Buffer and SizeOfBuffer. Buffer is returned.
608 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
609 then set SizeOfBuffer to the maximum size supported by TokenNumber and
610 return NULL to indicate that the set operation was not actually performed.
612 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
613 maximum size supported by TokenName and NULL must be returned.
615 If SizeOfBuffer is NULL, then ASSERT().
616 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
618 @param[in] TokenNumber The PCD token number to set a current value for.
619 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
620 @param[in] Buffer A pointer to the buffer to set.
622 @return Return the pointer for the buffer been set.
628 IN UINTN TokenNumber
,
629 IN OUT UINTN
*SizeOfBuffer
,
630 IN CONST VOID
*Buffer
635 ASSERT (SizeOfBuffer
!= NULL
);
637 if (*SizeOfBuffer
> 0) {
638 ASSERT (Buffer
!= NULL
);
641 Status
= GetPcdProtocol()->SetPtr (TokenNumber
, SizeOfBuffer
, (VOID
*) Buffer
);
642 if (EFI_ERROR (Status
)) {
646 return (VOID
*)Buffer
;
652 This function provides a means by which to set a value for a given PCD token.
654 Sets the Boolean value for the token specified by TokenNumber
655 to the value specified by Value. Value is returned.
657 @param[in] TokenNumber The PCD token number to set a current value for.
658 @param[in] Value The boolean value to set.
660 @return Return the value that was set.
666 IN UINTN TokenNumber
,
672 Status
= GetPcdProtocol()->SetBool (TokenNumber
, Value
);
673 ASSERT_EFI_ERROR (Status
);
681 This function provides a means by which to set a value for a given PCD token.
683 Sets the 8-bit value for the token specified by TokenNumber and
684 Guid to the value specified by Value. Value is returned.
686 If Guid is NULL, then ASSERT().
688 @param[in] Guid The pointer to a 128-bit unique value that
689 designates which namespace to set a value from.
690 @param[in] TokenNumber The PCD token number to set a current value for.
691 @param[in] Value The 8-bit value to set.
693 @return Return the value that was set.
700 IN UINTN TokenNumber
,
706 ASSERT (Guid
!= NULL
);
708 Status
= GetPiPcdProtocol()->Set8 (Guid
, TokenNumber
, Value
);
709 ASSERT_EFI_ERROR (Status
);
717 This function provides a means by which to set a value for a given PCD token.
719 Sets the 16-bit value for the token specified by TokenNumber and
720 Guid to the value specified by Value. Value is returned.
722 If Guid is NULL, then ASSERT().
724 @param[in] Guid The pointer to a 128-bit unique value that
725 designates which namespace to set a value from.
726 @param[in] TokenNumber The PCD token number to set a current value for.
727 @param[in] Value The 16-bit value to set.
729 @return Return the value that was set.
736 IN UINTN TokenNumber
,
742 ASSERT (Guid
!= NULL
);
744 Status
= GetPiPcdProtocol()->Set16 (Guid
, TokenNumber
, Value
);
745 ASSERT_EFI_ERROR (Status
);
753 This function provides a means by which to set a value for a given PCD token.
755 Sets the 32-bit value for the token specified by TokenNumber and
756 Guid to the value specified by Value. Value is returned.
758 If Guid is NULL, then ASSERT().
760 @param[in] Guid The pointer to a 128-bit unique value that
761 designates which namespace to set a value from.
762 @param[in] TokenNumber The PCD token number to set a current value for.
763 @param[in] Value The 32-bit value to set.
765 @return Return the value that was set.
772 IN UINTN TokenNumber
,
778 ASSERT (Guid
!= NULL
);
780 Status
= GetPiPcdProtocol()->Set32 (Guid
, TokenNumber
, Value
);
781 ASSERT_EFI_ERROR (Status
);
789 This function provides a means by which to set a value for a given PCD token.
791 Sets the 64-bit value for the token specified by TokenNumber and
792 Guid to the value specified by Value. Value is returned.
793 If Guid is NULL, then ASSERT().
795 @param[in] Guid The pointer to a 128-bit unique value that
796 designates which namespace to set a value from.
797 @param[in] TokenNumber The PCD token number to set a current value for.
798 @param[in] Value The 64-bit value to set.
800 @return Return the value that was set.
807 IN UINTN TokenNumber
,
813 ASSERT (Guid
!= NULL
);
815 Status
= GetPiPcdProtocol()->Set64 (Guid
, TokenNumber
, Value
);
816 ASSERT_EFI_ERROR (Status
);
824 This function provides a means by which to set a value for a given PCD token.
826 Sets a buffer for the token specified by TokenNumber to the value specified by
827 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
828 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
829 supported by TokenNumber and return NULL to indicate that the set operation
830 was not actually performed.
832 If Guid is NULL, then ASSERT().
833 If SizeOfBuffer is NULL, then ASSERT().
834 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
836 @param[in] Guid The pointer to a 128-bit unique value that
837 designates which namespace to set a value from.
838 @param[in] TokenNumber The PCD token number to set a current value for.
839 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
840 @param[in] Buffer A pointer to the buffer to set.
842 @return Return the pointer to the buffer been set.
849 IN UINTN TokenNumber
,
850 IN OUT UINTN
*SizeOfBuffer
,
856 ASSERT (Guid
!= NULL
);
858 ASSERT (SizeOfBuffer
!= NULL
);
860 if (*SizeOfBuffer
> 0) {
861 ASSERT (Buffer
!= NULL
);
864 Status
= GetPiPcdProtocol()->SetPtr (Guid
, TokenNumber
, SizeOfBuffer
, Buffer
);
865 if (EFI_ERROR (Status
)) {
875 This function provides a means by which to set a value for a given PCD token.
877 Sets the Boolean value for the token specified by TokenNumber and
878 Guid to the value specified by Value. Value is returned.
880 If Guid is NULL, then ASSERT().
882 @param[in] Guid The pointer to a 128-bit unique value that
883 designates which namespace to set a value from.
884 @param[in] TokenNumber The PCD token number to set a current value for.
885 @param[in] Value The Boolean value to set.
887 @return Return the value that was set.
894 IN UINTN TokenNumber
,
900 ASSERT (Guid
!= NULL
);
902 Status
= GetPiPcdProtocol()->SetBool (Guid
, TokenNumber
, Value
);
903 ASSERT_EFI_ERROR (Status
);
911 Set up a notification function that is called when a specified token is set.
913 When the token specified by TokenNumber and Guid is set,
914 then notification function specified by NotificationFunction is called.
915 If Guid is NULL, then the default token space is used.
916 If NotificationFunction is NULL, then ASSERT().
918 @param[in] Guid The pointer to a 128-bit unique value that designates which
919 namespace to set a value from. If NULL, then the default
921 @param[in] TokenNumber The PCD token number to monitor.
922 @param[in] NotificationFunction The function to call when the token
923 specified by Guid and TokenNumber is set.
928 LibPcdCallbackOnSet (
929 IN CONST GUID
*Guid
, OPTIONAL
930 IN UINTN TokenNumber
,
931 IN PCD_CALLBACK NotificationFunction
936 ASSERT (NotificationFunction
!= NULL
);
938 Status
= GetPiPcdProtocol()->CallbackOnSet (Guid
, TokenNumber
, (EFI_PCD_PROTOCOL_CALLBACK
) NotificationFunction
);
939 ASSERT_EFI_ERROR (Status
);
947 Disable a notification function that was established with LibPcdCallbackonSet().
949 Disable a notification function that was previously established with LibPcdCallbackOnSet().
950 If NotificationFunction is NULL, then ASSERT().
951 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
952 and NotificationFunction, then ASSERT().
954 @param[in] Guid Specify the GUID token space.
955 @param[in] TokenNumber Specify the token number.
956 @param[in] NotificationFunction The callback function to be unregistered.
961 LibPcdCancelCallback (
962 IN CONST GUID
*Guid
, OPTIONAL
963 IN UINTN TokenNumber
,
964 IN PCD_CALLBACK NotificationFunction
969 ASSERT (NotificationFunction
!= NULL
);
971 Status
= GetPiPcdProtocol()->CancelCallback (Guid
, TokenNumber
, (EFI_PCD_PROTOCOL_CALLBACK
) NotificationFunction
);
972 ASSERT_EFI_ERROR (Status
);
980 Retrieves the next token in a token space.
982 Retrieves the next PCD token number from the token space specified by Guid.
983 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
984 then the first token number is returned. Otherwise, the token number that
985 follows TokenNumber in the token space is returned. If TokenNumber is the last
986 token number in the token space, then 0 is returned.
988 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
990 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace
991 to set a value from. If NULL, then the default token space is used.
992 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
995 @return The next valid token number.
1000 LibPcdGetNextToken (
1001 IN CONST GUID
*Guid
, OPTIONAL
1002 IN UINTN TokenNumber
1005 GetPiPcdProtocol()->GetNextToken (Guid
, &TokenNumber
);
1013 Used to retrieve the list of available PCD token space GUIDs.
1015 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1017 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1018 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1020 @param TokenSpaceGuid The pointer to the a PCD token space GUID.
1022 @return The next valid token namespace.
1027 LibPcdGetNextTokenSpace (
1028 IN CONST GUID
*TokenSpaceGuid
1031 GetPiPcdProtocol()->GetNextTokenSpace (&TokenSpaceGuid
);
1033 return (GUID
*)TokenSpaceGuid
;
1038 Sets a value of a patchable PCD entry that is type pointer.
1040 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1041 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1042 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1043 NULL to indicate that the set operation was not actually performed.
1044 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1045 MaximumDatumSize and NULL must be returned.
1047 If PatchVariable is NULL, then ASSERT().
1048 If SizeOfBuffer is NULL, then ASSERT().
1049 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1051 @param[in] PatchVariable A pointer to the global variable in a module that is
1052 the target of the set operation.
1053 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1054 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1055 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1057 @return Return the pointer to the buffer been set.
1063 IN VOID
*PatchVariable
,
1064 IN UINTN MaximumDatumSize
,
1065 IN OUT UINTN
*SizeOfBuffer
,
1066 IN CONST VOID
*Buffer
1069 ASSERT (PatchVariable
!= NULL
);
1070 ASSERT (SizeOfBuffer
!= NULL
);
1072 if (*SizeOfBuffer
> 0) {
1073 ASSERT (Buffer
!= NULL
);
1076 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1077 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1078 *SizeOfBuffer
= MaximumDatumSize
;
1082 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1084 return (VOID
*) Buffer
;
1088 Retrieve additional information associated with a PCD token.
1090 This includes information such as the type of value the TokenNumber is associated with as well as possible
1091 human readable name that is associated with the token.
1093 If TokenNumber is not in the default token space specified, then ASSERT().
1095 @param[in] TokenNumber The PCD token number.
1096 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1097 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1102 IN UINTN TokenNumber
,
1103 OUT PCD_INFO
*PcdInfo
1108 Status
= GetPcdInfoProtocolPointer()->GetInfo (TokenNumber
, (EFI_PCD_INFO
*) PcdInfo
);
1109 ASSERT_EFI_ERROR (Status
);
1113 Retrieve additional information associated with a PCD token.
1115 This includes information such as the type of value the TokenNumber is associated with as well as possible
1116 human readable name that is associated with the token.
1118 If TokenNumber is not in the token space specified by Guid, then ASSERT().
1120 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
1121 @param[in] TokenNumber The PCD token number.
1122 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1123 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1128 IN CONST GUID
*Guid
,
1129 IN UINTN TokenNumber
,
1130 OUT PCD_INFO
*PcdInfo
1135 Status
= GetPiPcdInfoProtocolPointer()->GetInfo (Guid
, TokenNumber
, (EFI_PCD_INFO
*) PcdInfo
);
1136 ASSERT_EFI_ERROR (Status
);
1140 Retrieve the currently set SKU Id.
1142 If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().
1144 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
1145 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
1156 SkuId
= GetPiPcdInfoProtocolPointer()->GetSku ();
1157 ASSERT (SkuId
< PCD_MAX_SKU_ID
);