2 A emptry template implementation of PCD Library.
4 Copyright (c) 2006 - 2016, 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.
17 #include <Library/DebugLib.h>
18 #include <Library/PcdLib.h>
19 #include <Library/BaseMemoryLib.h>
23 This function provides a means by which SKU support can be established in the PCD infrastructure.
25 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
27 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
28 set values associated with a PCD token.
30 @return Return the SKU ID that just be set.
45 This function provides a means by which to retrieve a value for a given PCD token.
47 Returns the 8-bit value for the token specified by TokenNumber.
49 @param[in] TokenNumber The PCD token number to retrieve a current value for.
51 @return Returns the 8-bit value for the token specified by TokenNumber.
68 This function provides a means by which to retrieve a value for a given PCD token.
70 Returns the 16-bit value for the token specified by TokenNumber.
72 @param[in] TokenNumber The PCD token number to retrieve a current value for.
74 @return Returns the 16-bit value for the token specified by TokenNumber.
91 This function provides a means by which to retrieve a value for a given PCD token.
93 Returns the 32-bit value for the token specified by TokenNumber.
95 @param[in] TokenNumber The PCD token number to retrieve a current value for.
97 @return Returns the 32-bit value for the token specified by TokenNumber.
114 This function provides a means by which to retrieve a value for a given PCD token.
116 Returns the 64-bit value for the token specified by TokenNumber.
118 @param[in] TokenNumber The PCD token number to retrieve a current value for.
120 @return Returns the 64-bit value for the token specified by TokenNumber.
137 This function provides a means by which to retrieve a value for a given PCD token.
139 Returns the pointer to the buffer of the token specified by TokenNumber.
141 @param[in] TokenNumber The PCD token number to retrieve a current value for.
143 @return Returns the pointer to the token specified by TokenNumber.
160 This function provides a means by which to retrieve a value for a given PCD token.
162 Returns the Boolean value of the token specified by TokenNumber.
164 @param[in] TokenNumber The PCD token number to retrieve a current value for.
166 @return Returns the Boolean value of the token specified by TokenNumber.
183 This function provides a means by which to retrieve the size of a given PCD token.
185 @param[in] TokenNumber The PCD token number to retrieve a current value for.
187 @return Returns the size of the token specified by TokenNumber.
204 This function provides a means by which to retrieve a value for a given PCD token.
206 Returns the 8-bit value for the token specified by TokenNumber and Guid.
208 If Guid is NULL, then ASSERT().
210 @param[in] Guid The pointer to a 128-bit unique value that designates
211 which namespace to retrieve a value from.
212 @param[in] TokenNumber The PCD token number to retrieve a current value for.
214 @return Return the UINT8.
232 This function provides a means by which to retrieve a value for a given PCD token.
234 Returns the 16-bit value for the token specified by TokenNumber and Guid.
236 If Guid is NULL, then ASSERT().
238 @param[in] Guid The pointer to a 128-bit unique value that designates
239 which namespace to retrieve a value from.
240 @param[in] TokenNumber The PCD token number to retrieve a current value for.
242 @return Return the UINT16.
260 Returns the 32-bit value for the token specified by TokenNumber and Guid.
261 If Guid is NULL, then ASSERT().
263 @param[in] Guid The pointer to a 128-bit unique value that designates
264 which namespace to retrieve a value from.
265 @param[in] TokenNumber The PCD token number to retrieve a current value for.
267 @return Return the UINT32.
285 This function provides a means by which to retrieve a value for a given PCD token.
287 Returns the 64-bit value for the token specified by TokenNumber and Guid.
289 If Guid is NULL, then ASSERT().
291 @param[in] Guid The pointer to a 128-bit unique value that designates
292 which namespace to retrieve a value from.
293 @param[in] TokenNumber The PCD token number to retrieve a current value for.
295 @return Return the UINT64.
313 This function provides a means by which to retrieve a value for a given PCD token.
315 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
317 If Guid is NULL, then ASSERT().
319 @param[in] Guid The pointer to a 128-bit unique value that designates
320 which namespace to retrieve a value from.
321 @param[in] TokenNumber The PCD token number to retrieve a current value for.
323 @return Return the VOID* pointer.
341 This function provides a means by which to retrieve a value for a given PCD token.
343 Returns the Boolean value of the token specified by TokenNumber and Guid.
345 If Guid is NULL, then ASSERT().
347 @param[in] Guid The pointer to a 128-bit unique value that designates
348 which namespace to retrieve a value from.
349 @param[in] TokenNumber The PCD token number to retrieve a current value for.
351 @return Return the BOOLEAN.
369 This function provides a means by which to retrieve the size of a given PCD token.
371 Returns the size of the token specified by TokenNumber and Guid.
373 If Guid is NULL, then ASSERT().
375 @param[in] Guid The pointer to a 128-bit unique value that designates
376 which namespace to retrieve a value from.
377 @param[in] TokenNumber The PCD token number to retrieve a current value for.
379 @return Return the size.
396 #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
398 This function provides a means by which to set a value for a given PCD token.
400 Sets the 8-bit value for the token specified by TokenNumber
401 to the value specified by Value. Value is returned.
403 @param[in] TokenNumber The PCD token number to set a current value for.
404 @param[in] Value The 8-bit value to set.
406 @return Return the value that was set.
412 IN UINTN TokenNumber
,
424 This function provides a means by which to set a value for a given PCD token.
426 Sets the 16-bit value for the token specified by TokenNumber
427 to the value specified by Value. Value is returned.
429 @param[in] TokenNumber The PCD token number to set a current value for.
430 @param[in] Value The 16-bit value to set.
432 @return Return the value that was set.
438 IN UINTN TokenNumber
,
450 This function provides a means by which to set a value for a given PCD token.
452 Sets the 32-bit value for the token specified by TokenNumber
453 to the value specified by Value. Value is returned.
455 @param[in] TokenNumber The PCD token number to set a current value for.
456 @param[in] Value The 32-bit value to set.
458 @return Return the value that was set.
464 IN UINTN TokenNumber
,
476 This function provides a means by which to set a value for a given PCD token.
478 Sets the 64-bit value for the token specified by TokenNumber
479 to the value specified by Value. Value is returned.
481 @param[in] TokenNumber The PCD token number to set a current value for.
482 @param[in] Value The 64-bit value to set.
484 @return Return the value that was set.
490 IN UINTN TokenNumber
,
502 This function provides a means by which to set a value for a given PCD token.
504 Sets a buffer for the token specified by TokenNumber to the value
505 specified by Buffer and SizeOfBuffer. Buffer is returned.
506 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
507 then set SizeOfBuffer to the maximum size supported by TokenNumber and
508 return NULL to indicate that the set operation was not actually performed.
510 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
511 maximum size supported by TokenName and NULL must be returned.
513 If SizeOfBuffer is NULL, then ASSERT().
514 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
516 @param[in] TokenNumber The PCD token number to set a current value for.
517 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
518 @param[in] Buffer A pointer to the buffer to set.
520 @return Return the pointer for the buffer been set.
526 IN UINTN TokenNumber
,
527 IN OUT UINTN
*SizeOfBuffer
,
528 IN CONST VOID
*Buffer
539 This function provides a means by which to set a value for a given PCD token.
541 Sets the Boolean value for the token specified by TokenNumber
542 to the value specified by Value. Value is returned.
544 @param[in] TokenNumber The PCD token number to set a current value for.
545 @param[in] Value The boolean value to set.
547 @return Return the value that was set.
553 IN UINTN TokenNumber
,
565 This function provides a means by which to set a value for a given PCD token.
567 Sets the 8-bit value for the token specified by TokenNumber and
568 Guid to the value specified by Value. Value is returned.
570 If Guid is NULL, then ASSERT().
572 @param[in] Guid The pointer to a 128-bit unique value that
573 designates which namespace to set a value from.
574 @param[in] TokenNumber The PCD token number to set a current value for.
575 @param[in] Value The 8-bit value to set.
577 @return Return the value that was set.
584 IN UINTN TokenNumber
,
596 This function provides a means by which to set a value for a given PCD token.
598 Sets the 16-bit value for the token specified by TokenNumber and
599 Guid to the value specified by Value. Value is returned.
601 If Guid is NULL, then ASSERT().
603 @param[in] Guid The pointer to a 128-bit unique value that
604 designates which namespace to set a value from.
605 @param[in] TokenNumber The PCD token number to set a current value for.
606 @param[in] Value The 16-bit value to set.
608 @return Return the value that was set.
615 IN UINTN TokenNumber
,
627 This function provides a means by which to set a value for a given PCD token.
629 Sets the 32-bit value for the token specified by TokenNumber and
630 Guid to the value specified by Value. Value is returned.
632 If Guid is NULL, then ASSERT().
634 @param[in] Guid The pointer to a 128-bit unique value that
635 designates which namespace to set a value from.
636 @param[in] TokenNumber The PCD token number to set a current value for.
637 @param[in] Value The 32-bit value to set.
639 @return Return the value that was set.
646 IN UINTN TokenNumber
,
658 This function provides a means by which to set a value for a given PCD token.
660 Sets the 64-bit value for the token specified by TokenNumber and
661 Guid to the value specified by Value. Value is returned.
663 If Guid is NULL, then ASSERT().
665 @param[in] Guid The pointer to a 128-bit unique value that
666 designates which namespace to set a value from.
667 @param[in] TokenNumber The PCD token number to set a current value for.
668 @param[in] Value The 64-bit value to set.
670 @return Return the value that was set.
677 IN UINTN TokenNumber
,
689 This function provides a means by which to set a value for a given PCD token.
691 Sets a buffer for the token specified by TokenNumber to the value specified by
692 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
693 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
694 supported by TokenNumber and return NULL to indicate that the set operation
695 was not actually performed.
697 If Guid is NULL, then ASSERT().
698 If SizeOfBuffer is NULL, then ASSERT().
699 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
701 @param[in] Guid The pointer to a 128-bit unique value that
702 designates which namespace to set a value from.
703 @param[in] TokenNumber The PCD token number to set a current value for.
704 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
705 @param[in] Buffer A pointer to the buffer to set.
707 @return Return the pinter to the buffer been set.
714 IN UINTN TokenNumber
,
715 IN OUT UINTN
*SizeOfBuffer
,
727 This function provides a means by which to set a value for a given PCD token.
729 Sets the Boolean value for the token specified by TokenNumber and
730 Guid to the value specified by Value. Value is returned.
732 If Guid is NULL, then ASSERT().
734 @param[in] Guid The pointer to a 128-bit unique value that
735 designates which namespace to set a value from.
736 @param[in] TokenNumber The PCD token number to set a current value for.
737 @param[in] Value The Boolean value to set.
739 @return Return the value that was set.
746 IN UINTN TokenNumber
,
757 This function provides a means by which to set a value for a given PCD token.
759 Sets the 8-bit value for the token specified by TokenNumber
760 to the value specified by Value.
762 @param[in] TokenNumber The PCD token number to set a current value for.
763 @param[in] Value The 8-bit value to set.
765 @return The status of the set operation.
771 IN UINTN TokenNumber
,
777 return RETURN_INVALID_PARAMETER
;
781 This function provides a means by which to set a value for a given PCD token.
783 Sets the 16-bit value for the token specified by TokenNumber
784 to the value specified by Value.
786 @param[in] TokenNumber The PCD token number to set a current value for.
787 @param[in] Value The 16-bit value to set.
789 @return The status of the set operation.
795 IN UINTN TokenNumber
,
801 return RETURN_INVALID_PARAMETER
;
805 This function provides a means by which to set a value for a given PCD token.
807 Sets the 32-bit value for the token specified by TokenNumber
808 to the value specified by Value.
810 @param[in] TokenNumber The PCD token number to set a current value for.
811 @param[in] Value The 32-bit value to set.
813 @return The status of the set operation.
819 IN UINTN TokenNumber
,
825 return RETURN_INVALID_PARAMETER
;
829 This function provides a means by which to set a value for a given PCD token.
831 Sets the 64-bit value for the token specified by TokenNumber
832 to the value specified by Value.
834 @param[in] TokenNumber The PCD token number to set a current value for.
835 @param[in] Value The 64-bit value to set.
837 @return The status of the set operation.
843 IN UINTN TokenNumber
,
849 return RETURN_INVALID_PARAMETER
;
853 This function provides a means by which to set a value for a given PCD token.
855 Sets a buffer for the token specified by TokenNumber to the value specified
856 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
857 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
858 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
859 was not actually performed.
861 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
862 maximum size supported by TokenName and EFI_INVALID_PARAMETER must be returned.
864 If SizeOfBuffer is NULL, then ASSERT().
865 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
867 @param[in] TokenNumber The PCD token number to set a current value for.
868 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
869 @param[in] Buffer A pointer to the buffer to set.
871 @return The status of the set operation.
877 IN UINTN TokenNumber
,
878 IN OUT UINTN
*SizeOfBuffer
,
879 IN CONST VOID
*Buffer
884 return RETURN_INVALID_PARAMETER
;
888 This function provides a means by which to set a value for a given PCD token.
890 Sets the boolean value for the token specified by TokenNumber
891 to the value specified by Value.
893 @param[in] TokenNumber The PCD token number to set a current value for.
894 @param[in] Value The boolean value to set.
896 @return The status of the set operation.
902 IN UINTN TokenNumber
,
908 return RETURN_INVALID_PARAMETER
;
912 This function provides a means by which to set a value for a given PCD token.
914 Sets the 8-bit value for the token specified by TokenNumber
915 to the value specified by Value.
917 If Guid is NULL, then ASSERT().
919 @param[in] Guid The pointer to a 128-bit unique value that
920 designates which namespace to set a value from.
921 @param[in] TokenNumber The PCD token number to set a current value for.
922 @param[in] Value The 8-bit value to set.
924 @return The status of the set operation.
931 IN UINTN TokenNumber
,
937 return RETURN_INVALID_PARAMETER
;
941 This function provides a means by which to set a value for a given PCD token.
943 Sets the 16-bit value for the token specified by TokenNumber
944 to the value specified by Value.
946 If Guid is NULL, then ASSERT().
948 @param[in] Guid The pointer to a 128-bit unique value that
949 designates which namespace to set a value from.
950 @param[in] TokenNumber The PCD token number to set a current value for.
951 @param[in] Value The 16-bit value to set.
953 @return The status of the set operation.
960 IN UINTN TokenNumber
,
966 return RETURN_INVALID_PARAMETER
;
970 This function provides a means by which to set a value for a given PCD token.
972 Sets the 32-bit value for the token specified by TokenNumber
973 to the value specified by Value.
975 If Guid is NULL, then ASSERT().
977 @param[in] Guid The pointer to a 128-bit unique value that
978 designates which namespace to set a value from.
979 @param[in] TokenNumber The PCD token number to set a current value for.
980 @param[in] Value The 32-bit value to set.
982 @return The status of the set operation.
989 IN UINTN TokenNumber
,
995 return RETURN_INVALID_PARAMETER
;
999 This function provides a means by which to set a value for a given PCD token.
1001 Sets the 64-bit value for the token specified by TokenNumber
1002 to the value specified by Value.
1004 If Guid is NULL, then ASSERT().
1006 @param[in] Guid The pointer to a 128-bit unique value that
1007 designates which namespace to set a value from.
1008 @param[in] TokenNumber The PCD token number to set a current value for.
1009 @param[in] Value The 64-bit value to set.
1011 @return The status of the set operation.
1017 IN CONST GUID
*Guid
,
1018 IN UINTN TokenNumber
,
1024 return RETURN_INVALID_PARAMETER
;
1028 This function provides a means by which to set a value for a given PCD token.
1030 Sets a buffer for the token specified by TokenNumber to the value specified by
1031 Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
1032 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
1033 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
1034 was not actually performed.
1036 If Guid is NULL, then ASSERT().
1037 If SizeOfBuffer is NULL, then ASSERT().
1038 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1040 @param[in] Guid Pointer to a 128-bit unique value that
1041 designates which namespace to set a value from.
1042 @param[in] TokenNumber The PCD token number to set a current value for.
1043 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1044 @param[in] Buffer A pointer to the buffer to set.
1046 @return The status of the set operation.
1052 IN CONST GUID
*Guid
,
1053 IN UINTN TokenNumber
,
1054 IN OUT UINTN
*SizeOfBuffer
,
1060 return RETURN_INVALID_PARAMETER
;
1064 This function provides a means by which to set a value for a given PCD token.
1066 Sets the boolean value for the token specified by TokenNumber
1067 to the value specified by Value.
1069 If Guid is NULL, then ASSERT().
1071 @param[in] Guid The pointer to a 128-bit unique value that
1072 designates which namespace to set a value from.
1073 @param[in] TokenNumber The PCD token number to set a current value for.
1074 @param[in] Value The boolean value to set.
1076 @return The status of the set operation.
1082 IN CONST GUID
*Guid
,
1083 IN UINTN TokenNumber
,
1089 return RETURN_INVALID_PARAMETER
;
1093 Set up a notification function that is called when a specified token is set.
1095 When the token specified by TokenNumber and Guid is set,
1096 then notification function specified by NotificationFunction is called.
1097 If Guid is NULL, then the default token space is used.
1099 If NotificationFunction is NULL, then ASSERT().
1101 @param[in] Guid The pointer to a 128-bit unique value that designates which
1102 namespace to set a value from. If NULL, then the default
1103 token space is used.
1104 @param[in] TokenNumber The PCD token number to monitor.
1105 @param[in] NotificationFunction The function to call when the token
1106 specified by Guid and TokenNumber is set.
1111 LibPcdCallbackOnSet (
1112 IN CONST GUID
*Guid
, OPTIONAL
1113 IN UINTN TokenNumber
,
1114 IN PCD_CALLBACK NotificationFunction
1123 Disable a notification function that was established with LibPcdCallbackonSet().
1125 Disable a notification function that was previously established with LibPcdCallbackOnSet().
1127 If NotificationFunction is NULL, then ASSERT().
1128 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1129 and NotificationFunction, then ASSERT().
1131 @param[in] Guid Specify the GUID token space.
1132 @param[in] TokenNumber Specify the token number.
1133 @param[in] NotificationFunction The callback function to be unregistered.
1138 LibPcdCancelCallback (
1139 IN CONST GUID
*Guid
, OPTIONAL
1140 IN UINTN TokenNumber
,
1141 IN PCD_CALLBACK NotificationFunction
1150 Retrieves the next token in a token space.
1152 Retrieves the next PCD token number from the token space specified by Guid.
1153 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1154 then the first token number is returned. Otherwise, the token number that
1155 follows TokenNumber in the token space is returned. If TokenNumber is the last
1156 token number in the token space, then 0 is returned.
1158 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1160 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace
1161 to set a value from. If NULL, then the default token space is used.
1162 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1165 @return The next valid token number.
1170 LibPcdGetNextToken (
1171 IN CONST GUID
*Guid
, OPTIONAL
1172 IN UINTN TokenNumber
1183 Used to retrieve the list of available PCD token space GUIDs.
1185 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1187 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1188 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1190 @param TokenSpaceGuid The pointer to a PCD token space GUID.
1192 @return The next valid token namespace.
1197 LibPcdGetNextTokenSpace (
1198 IN CONST GUID
*TokenSpaceGuid
1208 Sets a value of a patchable PCD entry that is type pointer.
1210 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1211 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1212 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1213 NULL to indicate that the set operation was not actually performed.
1214 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1215 MaximumDatumSize and NULL must be returned.
1217 If PatchVariable is NULL, then ASSERT().
1218 If SizeOfBuffer is NULL, then ASSERT().
1219 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1221 @param[out] PatchVariable A pointer to the global variable in a module that is
1222 the target of the set operation.
1223 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1224 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1225 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1227 @return Return the pointer to the buffer that was set.
1233 OUT VOID
*PatchVariable
,
1234 IN UINTN MaximumDatumSize
,
1235 IN OUT UINTN
*SizeOfBuffer
,
1236 IN CONST VOID
*Buffer
1239 ASSERT (PatchVariable
!= NULL
);
1240 ASSERT (SizeOfBuffer
!= NULL
);
1242 if (*SizeOfBuffer
> 0) {
1243 ASSERT (Buffer
!= NULL
);
1246 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1247 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1248 *SizeOfBuffer
= MaximumDatumSize
;
1252 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1254 return (VOID
*) Buffer
;
1258 Sets a value of a patchable PCD entry that is type pointer.
1260 Sets the PCD entry specified by PatchVariable to the value specified
1261 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
1262 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
1263 to indicate that the set operation was not actually performed.
1264 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1265 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
1267 If PatchVariable is NULL, then ASSERT().
1268 If SizeOfBuffer is NULL, then ASSERT().
1269 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1271 @param[out] PatchVariable A pointer to the global variable in a module that is
1272 the target of the set operation.
1273 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1274 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1275 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1277 @return The status of the set operation.
1282 LibPatchPcdSetPtrS (
1283 OUT VOID
*PatchVariable
,
1284 IN UINTN MaximumDatumSize
,
1285 IN OUT UINTN
*SizeOfBuffer
,
1286 IN CONST VOID
*Buffer
1289 ASSERT (PatchVariable
!= NULL
);
1290 ASSERT (SizeOfBuffer
!= NULL
);
1292 if (*SizeOfBuffer
> 0) {
1293 ASSERT (Buffer
!= NULL
);
1296 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1297 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1298 *SizeOfBuffer
= MaximumDatumSize
;
1299 return RETURN_INVALID_PARAMETER
;
1302 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1304 return RETURN_SUCCESS
;
1308 Sets a value and size of a patchable PCD entry that is type pointer.
1310 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1311 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1312 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1313 NULL to indicate that the set operation was not actually performed.
1314 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1315 MaximumDatumSize and NULL must be returned.
1317 If PatchVariable is NULL, then ASSERT().
1318 If SizeOfPatchVariable is NULL, then ASSERT().
1319 If SizeOfBuffer is NULL, then ASSERT().
1320 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1322 @param[out] PatchVariable A pointer to the global variable in a module that is
1323 the target of the set operation.
1324 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
1325 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1326 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1327 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1329 @return Return the pointer to the buffer been set.
1334 LibPatchPcdSetPtrAndSize (
1335 OUT VOID
*PatchVariable
,
1336 OUT UINTN
*SizeOfPatchVariable
,
1337 IN UINTN MaximumDatumSize
,
1338 IN OUT UINTN
*SizeOfBuffer
,
1339 IN CONST VOID
*Buffer
1342 ASSERT (PatchVariable
!= NULL
);
1343 ASSERT (SizeOfPatchVariable
!= NULL
);
1344 ASSERT (SizeOfBuffer
!= NULL
);
1346 if (*SizeOfBuffer
> 0) {
1347 ASSERT (Buffer
!= NULL
);
1350 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1351 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1352 *SizeOfBuffer
= MaximumDatumSize
;
1356 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1357 *SizeOfPatchVariable
= *SizeOfBuffer
;
1359 return (VOID
*) Buffer
;
1363 Sets a value and size of a patchable PCD entry that is type pointer.
1365 Sets the PCD entry specified by PatchVariable to the value specified
1366 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
1367 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
1368 to indicate that the set operation was not actually performed.
1369 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1370 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
1372 If PatchVariable is NULL, then ASSERT().
1373 If SizeOfPatchVariable is NULL, then ASSERT().
1374 If SizeOfBuffer is NULL, then ASSERT().
1375 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1377 @param[out] PatchVariable A pointer to the global variable in a module that is
1378 the target of the set operation.
1379 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
1380 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1381 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1382 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1384 @return The status of the set operation.
1389 LibPatchPcdSetPtrAndSizeS (
1390 OUT VOID
*PatchVariable
,
1391 OUT UINTN
*SizeOfPatchVariable
,
1392 IN UINTN MaximumDatumSize
,
1393 IN OUT UINTN
*SizeOfBuffer
,
1394 IN CONST VOID
*Buffer
1397 ASSERT (PatchVariable
!= NULL
);
1398 ASSERT (SizeOfPatchVariable
!= NULL
);
1399 ASSERT (SizeOfBuffer
!= NULL
);
1401 if (*SizeOfBuffer
> 0) {
1402 ASSERT (Buffer
!= NULL
);
1405 if ((*SizeOfBuffer
> MaximumDatumSize
) ||
1406 (*SizeOfBuffer
== MAX_ADDRESS
)) {
1407 *SizeOfBuffer
= MaximumDatumSize
;
1408 return RETURN_INVALID_PARAMETER
;
1411 CopyMem (PatchVariable
, Buffer
, *SizeOfBuffer
);
1412 *SizeOfPatchVariable
= *SizeOfBuffer
;
1414 return RETURN_SUCCESS
;
1418 Retrieve additional information associated with a PCD token.
1420 This includes information such as the type of value the TokenNumber is associated with as well as possible
1421 human readable name that is associated with the token.
1423 If TokenNumber is not in the default token space specified, then ASSERT().
1425 @param[in] TokenNumber The PCD token number.
1426 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1427 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1432 IN UINTN TokenNumber
,
1433 OUT PCD_INFO
*PcdInfo
1440 Retrieve additional information associated with a PCD token.
1442 This includes information such as the type of value the TokenNumber is associated with as well as possible
1443 human readable name that is associated with the token.
1445 If TokenNumber is not in the token space specified by Guid, then ASSERT().
1447 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
1448 @param[in] TokenNumber The PCD token number.
1449 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1450 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1455 IN CONST GUID
*Guid
,
1456 IN UINTN TokenNumber
,
1457 OUT PCD_INFO
*PcdInfo
1464 Retrieve the currently set SKU Id.
1466 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
1467 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU