2 A emptry template implementation of PCD Library.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/DebugLib.h>
12 #include <Library/PcdLib.h>
13 #include <Library/BaseMemoryLib.h>
17 This function provides a means by which SKU support can be established in the PCD infrastructure.
19 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
21 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
22 set values associated with a PCD token.
24 @return Return the SKU ID that just be set.
39 This function provides a means by which to retrieve a value for a given PCD token.
41 Returns the 8-bit value for the token specified by TokenNumber.
43 @param[in] TokenNumber The PCD token number to retrieve a current value for.
45 @return Returns the 8-bit value for the token specified by TokenNumber.
62 This function provides a means by which to retrieve a value for a given PCD token.
64 Returns the 16-bit value for the token specified by TokenNumber.
66 @param[in] TokenNumber The PCD token number to retrieve a current value for.
68 @return Returns the 16-bit value for the token specified by TokenNumber.
85 This function provides a means by which to retrieve a value for a given PCD token.
87 Returns the 32-bit value for the token specified by TokenNumber.
89 @param[in] TokenNumber The PCD token number to retrieve a current value for.
91 @return Returns the 32-bit value for the token specified by TokenNumber.
108 This function provides a means by which to retrieve a value for a given PCD token.
110 Returns the 64-bit value for the token specified by TokenNumber.
112 @param[in] TokenNumber The PCD token number to retrieve a current value for.
114 @return Returns the 64-bit value for the token specified by TokenNumber.
131 This function provides a means by which to retrieve a value for a given PCD token.
133 Returns the pointer to the buffer of the token specified by TokenNumber.
135 @param[in] TokenNumber The PCD token number to retrieve a current value for.
137 @return Returns the pointer to the token specified by TokenNumber.
154 This function provides a means by which to retrieve a value for a given PCD token.
156 Returns the Boolean value of the token specified by TokenNumber.
158 @param[in] TokenNumber The PCD token number to retrieve a current value for.
160 @return Returns the Boolean value of the token specified by TokenNumber.
177 This function provides a means by which to retrieve the size of a given PCD token.
179 @param[in] TokenNumber The PCD token number to retrieve a current value for.
181 @return Returns the size of the token specified by TokenNumber.
198 This function provides a means by which to retrieve a value for a given PCD token.
200 Returns the 8-bit value for the token specified by TokenNumber and Guid.
202 If Guid is NULL, then ASSERT().
204 @param[in] Guid The pointer to a 128-bit unique value that designates
205 which namespace to retrieve a value from.
206 @param[in] TokenNumber The PCD token number to retrieve a current value for.
208 @return Return the UINT8.
226 This function provides a means by which to retrieve a value for a given PCD token.
228 Returns the 16-bit value for the token specified by TokenNumber and Guid.
230 If Guid is NULL, then ASSERT().
232 @param[in] Guid The pointer to a 128-bit unique value that designates
233 which namespace to retrieve a value from.
234 @param[in] TokenNumber The PCD token number to retrieve a current value for.
236 @return Return the UINT16.
254 Returns the 32-bit value for the token specified by TokenNumber and Guid.
255 If Guid is NULL, then ASSERT().
257 @param[in] Guid The pointer to a 128-bit unique value that designates
258 which namespace to retrieve a value from.
259 @param[in] TokenNumber The PCD token number to retrieve a current value for.
261 @return Return the UINT32.
279 This function provides a means by which to retrieve a value for a given PCD token.
281 Returns the 64-bit value for the token specified by TokenNumber and Guid.
283 If Guid is NULL, then ASSERT().
285 @param[in] Guid The pointer to a 128-bit unique value that designates
286 which namespace to retrieve a value from.
287 @param[in] TokenNumber The PCD token number to retrieve a current value for.
289 @return Return the UINT64.
307 This function provides a means by which to retrieve a value for a given PCD token.
309 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
311 If Guid is NULL, then ASSERT().
313 @param[in] Guid The pointer to a 128-bit unique value that designates
314 which namespace to retrieve a value from.
315 @param[in] TokenNumber The PCD token number to retrieve a current value for.
317 @return Return the VOID* pointer.
335 This function provides a means by which to retrieve a value for a given PCD token.
337 Returns the Boolean value of the token specified by TokenNumber and Guid.
339 If Guid is NULL, then ASSERT().
341 @param[in] Guid The pointer to a 128-bit unique value that designates
342 which namespace to retrieve a value from.
343 @param[in] TokenNumber The PCD token number to retrieve a current value for.
345 @return Return the BOOLEAN.
363 This function provides a means by which to retrieve the size of a given PCD token.
365 Returns the size of the token specified by TokenNumber and Guid.
367 If Guid is NULL, then ASSERT().
369 @param[in] Guid The pointer to a 128-bit unique value that designates
370 which namespace to retrieve a value from.
371 @param[in] TokenNumber The PCD token number to retrieve a current value for.
373 @return Return the size.
390 #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
392 This function provides a means by which to set a value for a given PCD token.
394 Sets the 8-bit value for the token specified by TokenNumber
395 to the value specified by Value. Value is returned.
397 @param[in] TokenNumber The PCD token number to set a current value for.
398 @param[in] Value The 8-bit value to set.
400 @return Return the value that was set.
406 IN UINTN TokenNumber
,
418 This function provides a means by which to set a value for a given PCD token.
420 Sets the 16-bit value for the token specified by TokenNumber
421 to the value specified by Value. Value is returned.
423 @param[in] TokenNumber The PCD token number to set a current value for.
424 @param[in] Value The 16-bit value to set.
426 @return Return the value that was set.
432 IN UINTN TokenNumber
,
444 This function provides a means by which to set a value for a given PCD token.
446 Sets the 32-bit value for the token specified by TokenNumber
447 to the value specified by Value. Value is returned.
449 @param[in] TokenNumber The PCD token number to set a current value for.
450 @param[in] Value The 32-bit value to set.
452 @return Return the value that was set.
458 IN UINTN TokenNumber
,
470 This function provides a means by which to set a value for a given PCD token.
472 Sets the 64-bit value for the token specified by TokenNumber
473 to the value specified by Value. Value is returned.
475 @param[in] TokenNumber The PCD token number to set a current value for.
476 @param[in] Value The 64-bit value to set.
478 @return Return the value that was set.
484 IN UINTN TokenNumber
,
496 This function provides a means by which to set a value for a given PCD token.
498 Sets a buffer for the token specified by TokenNumber to the value
499 specified by Buffer and SizeOfBuffer. Buffer is returned.
500 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
501 then set SizeOfBuffer to the maximum size supported by TokenNumber and
502 return NULL to indicate that the set operation was not actually performed.
504 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
505 maximum size supported by TokenName and NULL must be returned.
507 If SizeOfBuffer is NULL, then ASSERT().
508 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
510 @param[in] TokenNumber The PCD token number to set a current value for.
511 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
512 @param[in] Buffer A pointer to the buffer to set.
514 @return Return the pointer for the buffer been set.
520 IN UINTN TokenNumber
,
521 IN OUT UINTN
*SizeOfBuffer
,
522 IN CONST VOID
*Buffer
533 This function provides a means by which to set a value for a given PCD token.
535 Sets the Boolean value for the token specified by TokenNumber
536 to the value specified by Value. Value is returned.
538 @param[in] TokenNumber The PCD token number to set a current value for.
539 @param[in] Value The boolean value to set.
541 @return Return the value that was set.
547 IN UINTN TokenNumber
,
559 This function provides a means by which to set a value for a given PCD token.
561 Sets the 8-bit value for the token specified by TokenNumber and
562 Guid to the value specified by Value. Value is returned.
564 If Guid is NULL, then ASSERT().
566 @param[in] Guid The pointer to a 128-bit unique value that
567 designates which namespace to set a value from.
568 @param[in] TokenNumber The PCD token number to set a current value for.
569 @param[in] Value The 8-bit value to set.
571 @return Return the value that was set.
578 IN UINTN TokenNumber
,
590 This function provides a means by which to set a value for a given PCD token.
592 Sets the 16-bit value for the token specified by TokenNumber and
593 Guid to the value specified by Value. Value is returned.
595 If Guid is NULL, then ASSERT().
597 @param[in] Guid The pointer to a 128-bit unique value that
598 designates which namespace to set a value from.
599 @param[in] TokenNumber The PCD token number to set a current value for.
600 @param[in] Value The 16-bit value to set.
602 @return Return the value that was set.
609 IN UINTN TokenNumber
,
621 This function provides a means by which to set a value for a given PCD token.
623 Sets the 32-bit value for the token specified by TokenNumber and
624 Guid to the value specified by Value. Value is returned.
626 If Guid is NULL, then ASSERT().
628 @param[in] Guid The pointer to a 128-bit unique value that
629 designates which namespace to set a value from.
630 @param[in] TokenNumber The PCD token number to set a current value for.
631 @param[in] Value The 32-bit value to set.
633 @return Return the value that was set.
640 IN UINTN TokenNumber
,
652 This function provides a means by which to set a value for a given PCD token.
654 Sets the 64-bit value for the token specified by TokenNumber and
655 Guid to the value specified by Value. Value is returned.
657 If Guid is NULL, then ASSERT().
659 @param[in] Guid The pointer to a 128-bit unique value that
660 designates which namespace to set a value from.
661 @param[in] TokenNumber The PCD token number to set a current value for.
662 @param[in] Value The 64-bit value to set.
664 @return Return the value that was set.
671 IN UINTN TokenNumber
,
683 This function provides a means by which to set a value for a given PCD token.
685 Sets a buffer for the token specified by TokenNumber to the value specified by
686 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
687 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
688 supported by TokenNumber and return NULL to indicate that the set operation
689 was not actually performed.
691 If Guid is NULL, then ASSERT().
692 If SizeOfBuffer is NULL, then ASSERT().
693 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
695 @param[in] Guid The pointer to a 128-bit unique value that
696 designates which namespace to set a value from.
697 @param[in] TokenNumber The PCD token number to set a current value for.
698 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
699 @param[in] Buffer A pointer to the buffer to set.
701 @return Return the pinter to the buffer been set.
708 IN UINTN TokenNumber
,
709 IN OUT UINTN
*SizeOfBuffer
,
721 This function provides a means by which to set a value for a given PCD token.
723 Sets the Boolean value for the token specified by TokenNumber and
724 Guid to the value specified by Value. Value is returned.
726 If Guid is NULL, then ASSERT().
728 @param[in] Guid The pointer to a 128-bit unique value that
729 designates which namespace to set a value from.
730 @param[in] TokenNumber The PCD token number to set a current value for.
731 @param[in] Value The Boolean value to set.
733 @return Return the value that was set.
740 IN UINTN TokenNumber
,
751 This function provides a means by which to set a value for a given PCD token.
753 Sets the 8-bit value for the token specified by TokenNumber
754 to the value specified by Value.
756 @param[in] TokenNumber The PCD token number to set a current value for.
757 @param[in] Value The 8-bit value to set.
759 @return The status of the set operation.
765 IN UINTN TokenNumber
,
771 return RETURN_INVALID_PARAMETER
;
775 This function provides a means by which to set a value for a given PCD token.
777 Sets the 16-bit value for the token specified by TokenNumber
778 to the value specified by Value.
780 @param[in] TokenNumber The PCD token number to set a current value for.
781 @param[in] Value The 16-bit value to set.
783 @return The status of the set operation.
789 IN UINTN TokenNumber
,
795 return RETURN_INVALID_PARAMETER
;
799 This function provides a means by which to set a value for a given PCD token.
801 Sets the 32-bit value for the token specified by TokenNumber
802 to the value specified by Value.
804 @param[in] TokenNumber The PCD token number to set a current value for.
805 @param[in] Value The 32-bit value to set.
807 @return The status of the set operation.
813 IN UINTN TokenNumber
,
819 return RETURN_INVALID_PARAMETER
;
823 This function provides a means by which to set a value for a given PCD token.
825 Sets the 64-bit value for the token specified by TokenNumber
826 to the value specified by Value.
828 @param[in] TokenNumber The PCD token number to set a current value for.
829 @param[in] Value The 64-bit value to set.
831 @return The status of the set operation.
837 IN UINTN TokenNumber
,
843 return RETURN_INVALID_PARAMETER
;
847 This function provides a means by which to set a value for a given PCD token.
849 Sets a buffer for the token specified by TokenNumber to the value specified
850 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
851 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
852 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
853 was not actually performed.
855 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
856 maximum size supported by TokenName and EFI_INVALID_PARAMETER must be returned.
858 If SizeOfBuffer is NULL, then ASSERT().
859 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
861 @param[in] TokenNumber The PCD token number to set a current value for.
862 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
863 @param[in] Buffer A pointer to the buffer to set.
865 @return The status of the set operation.
871 IN UINTN TokenNumber
,
872 IN OUT UINTN
*SizeOfBuffer
,
873 IN CONST VOID
*Buffer
878 return RETURN_INVALID_PARAMETER
;
882 This function provides a means by which to set a value for a given PCD token.
884 Sets the boolean value for the token specified by TokenNumber
885 to the value specified by Value.
887 @param[in] TokenNumber The PCD token number to set a current value for.
888 @param[in] Value The boolean value to set.
890 @return The status of the set operation.
896 IN UINTN TokenNumber
,
902 return RETURN_INVALID_PARAMETER
;
906 This function provides a means by which to set a value for a given PCD token.
908 Sets the 8-bit value for the token specified by TokenNumber
909 to the value specified by Value.
911 If Guid is NULL, then ASSERT().
913 @param[in] Guid The pointer to a 128-bit unique value that
914 designates which namespace to set a value from.
915 @param[in] TokenNumber The PCD token number to set a current value for.
916 @param[in] Value The 8-bit value to set.
918 @return The status of the set operation.
925 IN UINTN TokenNumber
,
931 return RETURN_INVALID_PARAMETER
;
935 This function provides a means by which to set a value for a given PCD token.
937 Sets the 16-bit value for the token specified by TokenNumber
938 to the value specified by Value.
940 If Guid is NULL, then ASSERT().
942 @param[in] Guid The pointer to a 128-bit unique value that
943 designates which namespace to set a value from.
944 @param[in] TokenNumber The PCD token number to set a current value for.
945 @param[in] Value The 16-bit value to set.
947 @return The status of the set operation.
954 IN UINTN TokenNumber
,
960 return RETURN_INVALID_PARAMETER
;
964 This function provides a means by which to set a value for a given PCD token.
966 Sets the 32-bit value for the token specified by TokenNumber
967 to the value specified by Value.
969 If Guid is NULL, then ASSERT().
971 @param[in] Guid The pointer to a 128-bit unique value that
972 designates which namespace to set a value from.
973 @param[in] TokenNumber The PCD token number to set a current value for.
974 @param[in] Value The 32-bit value to set.
976 @return The status of the set operation.
983 IN UINTN TokenNumber
,
989 return RETURN_INVALID_PARAMETER
;
993 This function provides a means by which to set a value for a given PCD token.
995 Sets the 64-bit value for the token specified by TokenNumber
996 to the value specified by Value.
998 If Guid is NULL, then ASSERT().
1000 @param[in] Guid The pointer to a 128-bit unique value that
1001 designates which namespace to set a value from.
1002 @param[in] TokenNumber The PCD token number to set a current value for.
1003 @param[in] Value The 64-bit value to set.
1005 @return The status of the set operation.
1011 IN CONST GUID
*Guid
,
1012 IN UINTN TokenNumber
,
1018 return RETURN_INVALID_PARAMETER
;
1022 This function provides a means by which to set a value for a given PCD token.
1024 Sets a buffer for the token specified by TokenNumber to the value specified by
1025 Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
1026 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
1027 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
1028 was not actually performed.
1030 If Guid is NULL, then ASSERT().
1031 If SizeOfBuffer is NULL, then ASSERT().
1032 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1034 @param[in] Guid Pointer to a 128-bit unique value that
1035 designates which namespace to set a value from.
1036 @param[in] TokenNumber The PCD token number to set a current value for.
1037 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1038 @param[in] Buffer A pointer to the buffer to set.
1040 @return The status of the set operation.
1046 IN CONST GUID
*Guid
,
1047 IN UINTN TokenNumber
,
1048 IN OUT UINTN
*SizeOfBuffer
,
1054 return RETURN_INVALID_PARAMETER
;
1058 This function provides a means by which to set a value for a given PCD token.
1060 Sets the boolean value for the token specified by TokenNumber
1061 to the value specified by Value.
1063 If Guid is NULL, then ASSERT().
1065 @param[in] Guid The pointer to a 128-bit unique value that
1066 designates which namespace to set a value from.
1067 @param[in] TokenNumber The PCD token number to set a current value for.
1068 @param[in] Value The boolean value to set.
1070 @return The status of the set operation.
1076 IN CONST GUID
*Guid
,
1077 IN UINTN TokenNumber
,
1083 return RETURN_INVALID_PARAMETER
;
1087 Set up a notification function that is called when a specified token is set.
1089 When the token specified by TokenNumber and Guid is set,
1090 then notification function specified by NotificationFunction is called.
1091 If Guid is NULL, then the default token space is used.
1093 If NotificationFunction is NULL, then ASSERT().
1095 @param[in] Guid The pointer to a 128-bit unique value that designates which
1096 namespace to set a value from. If NULL, then the default
1097 token space is used.
1098 @param[in] TokenNumber The PCD token number to monitor.
1099 @param[in] NotificationFunction The function to call when the token
1100 specified by Guid and TokenNumber is set.
1105 LibPcdCallbackOnSet (
1106 IN CONST GUID
*Guid
, OPTIONAL
1107 IN UINTN TokenNumber
,
1108 IN PCD_CALLBACK NotificationFunction
1117 Disable a notification function that was established with LibPcdCallbackonSet().
1119 Disable a notification function that was previously established with LibPcdCallbackOnSet().
1121 If NotificationFunction is NULL, then ASSERT().
1122 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1123 and NotificationFunction, then ASSERT().
1125 @param[in] Guid Specify the GUID token space.
1126 @param[in] TokenNumber Specify the token number.
1127 @param[in] NotificationFunction The callback function to be unregistered.
1132 LibPcdCancelCallback (
1133 IN CONST GUID
*Guid
, OPTIONAL
1134 IN UINTN TokenNumber
,
1135 IN PCD_CALLBACK NotificationFunction
1144 Retrieves the next token in a token space.
1146 Retrieves the next PCD token number from the token space specified by Guid.
1147 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1148 then the first token number is returned. Otherwise, the token number that
1149 follows TokenNumber in the token space is returned. If TokenNumber is the last
1150 token number in the token space, then 0 is returned.
1152 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1154 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace
1155 to set a value from. If NULL, then the default token space is used.
1156 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1159 @return The next valid token number.
1164 LibPcdGetNextToken (
1165 IN CONST GUID
*Guid
, OPTIONAL
1166 IN UINTN TokenNumber
1177 Used to retrieve the list of available PCD token space GUIDs.
1179 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1181 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1182 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1184 @param TokenSpaceGuid The pointer to a PCD token space GUID.
1186 @return The next valid token namespace.
1191 LibPcdGetNextTokenSpace (
1192 IN CONST GUID
*TokenSpaceGuid
1202 Sets a value of a patchable PCD entry that is type pointer.
1204 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1205 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1206 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1207 NULL to indicate that the set operation was not actually performed.
1208 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1209 MaximumDatumSize and NULL must be returned.
1211 If PatchVariable is NULL, then ASSERT().
1212 If SizeOfBuffer is NULL, then ASSERT().
1213 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1215 @param[out] PatchVariable A pointer to the global variable in a module that is
1216 the target of the set operation.
1217 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1218 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1219 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1221 @return Return the pointer to the buffer that was set.
1227 OUT VOID
*PatchVariable
,
1228 IN UINTN MaximumDatumSize
,
1229 IN OUT UINTN
*SizeOfBuffer
,
1230 IN CONST VOID
*Buffer
1233 ASSERT (PatchVariable
!= NULL
);
1234 ASSERT (SizeOfBuffer
!= NULL
);
1236 if (*SizeOfBuffer
> 0) {
1237 ASSERT (Buffer
!= NULL
);
1240 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1241 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1242 *SizeOfBuffer
= MaximumDatumSize
;
1246 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1248 return (VOID
*) Buffer
;
1252 Sets a value of a patchable PCD entry that is type pointer.
1254 Sets the PCD entry specified by PatchVariable to the value specified
1255 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
1256 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
1257 to indicate that the set operation was not actually performed.
1258 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1259 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
1261 If PatchVariable is NULL, then ASSERT().
1262 If SizeOfBuffer is NULL, then ASSERT().
1263 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1265 @param[out] PatchVariable A pointer to the global variable in a module that is
1266 the target of the set operation.
1267 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1268 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1269 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1271 @return The status of the set operation.
1276 LibPatchPcdSetPtrS (
1277 OUT VOID
*PatchVariable
,
1278 IN UINTN MaximumDatumSize
,
1279 IN OUT UINTN
*SizeOfBuffer
,
1280 IN CONST VOID
*Buffer
1283 ASSERT (PatchVariable
!= NULL
);
1284 ASSERT (SizeOfBuffer
!= NULL
);
1286 if (*SizeOfBuffer
> 0) {
1287 ASSERT (Buffer
!= NULL
);
1290 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1291 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1292 *SizeOfBuffer
= MaximumDatumSize
;
1293 return RETURN_INVALID_PARAMETER
;
1296 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1298 return RETURN_SUCCESS
;
1302 Sets a value and size of a patchable PCD entry that is type pointer.
1304 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1305 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1306 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1307 NULL to indicate that the set operation was not actually performed.
1308 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1309 MaximumDatumSize and NULL must be returned.
1311 If PatchVariable is NULL, then ASSERT().
1312 If SizeOfPatchVariable is NULL, then ASSERT().
1313 If SizeOfBuffer is NULL, then ASSERT().
1314 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1316 @param[out] PatchVariable A pointer to the global variable in a module that is
1317 the target of the set operation.
1318 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
1319 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1320 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1321 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1323 @return Return the pointer to the buffer been set.
1328 LibPatchPcdSetPtrAndSize (
1329 OUT VOID
*PatchVariable
,
1330 OUT UINTN
*SizeOfPatchVariable
,
1331 IN UINTN MaximumDatumSize
,
1332 IN OUT UINTN
*SizeOfBuffer
,
1333 IN CONST VOID
*Buffer
1336 ASSERT (PatchVariable
!= NULL
);
1337 ASSERT (SizeOfPatchVariable
!= NULL
);
1338 ASSERT (SizeOfBuffer
!= NULL
);
1340 if (*SizeOfBuffer
> 0) {
1341 ASSERT (Buffer
!= NULL
);
1344 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1345 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1346 *SizeOfBuffer
= MaximumDatumSize
;
1350 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1351 *SizeOfPatchVariable
= *SizeOfBuffer
;
1353 return (VOID
*) Buffer
;
1357 Sets a value and size of a patchable PCD entry that is type pointer.
1359 Sets the PCD entry specified by PatchVariable to the value specified
1360 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
1361 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
1362 to indicate that the set operation was not actually performed.
1363 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1364 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
1366 If PatchVariable is NULL, then ASSERT().
1367 If SizeOfPatchVariable is NULL, then ASSERT().
1368 If SizeOfBuffer is NULL, then ASSERT().
1369 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1371 @param[out] PatchVariable A pointer to the global variable in a module that is
1372 the target of the set operation.
1373 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
1374 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1375 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1376 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1378 @return The status of the set operation.
1383 LibPatchPcdSetPtrAndSizeS (
1384 OUT VOID
*PatchVariable
,
1385 OUT UINTN
*SizeOfPatchVariable
,
1386 IN UINTN MaximumDatumSize
,
1387 IN OUT UINTN
*SizeOfBuffer
,
1388 IN CONST VOID
*Buffer
1391 ASSERT (PatchVariable
!= NULL
);
1392 ASSERT (SizeOfPatchVariable
!= NULL
);
1393 ASSERT (SizeOfBuffer
!= NULL
);
1395 if (*SizeOfBuffer
> 0) {
1396 ASSERT (Buffer
!= NULL
);
1399 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1400 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1401 *SizeOfBuffer
= MaximumDatumSize
;
1402 return RETURN_INVALID_PARAMETER
;
1405 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1406 *SizeOfPatchVariable
= *SizeOfBuffer
;
1408 return RETURN_SUCCESS
;
1412 Retrieve additional information associated with a PCD token.
1414 This includes information such as the type of value the TokenNumber is associated with as well as possible
1415 human readable name that is associated with the token.
1417 If TokenNumber is not in the default token space specified, then ASSERT().
1419 @param[in] TokenNumber The PCD token number.
1420 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1421 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1426 IN UINTN TokenNumber
,
1427 OUT PCD_INFO
*PcdInfo
1434 Retrieve additional information associated with a PCD token.
1436 This includes information such as the type of value the TokenNumber is associated with as well as possible
1437 human readable name that is associated with the token.
1439 If TokenNumber is not in the token space specified by Guid, then ASSERT().
1441 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
1442 @param[in] TokenNumber The PCD token number.
1443 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1444 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1449 IN CONST GUID
*Guid
,
1450 IN UINTN TokenNumber
,
1451 OUT PCD_INFO
*PcdInfo
1458 Retrieve the currently set SKU Id.
1460 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
1461 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU