2 Provides library services to get and set Platform Configuration Database entries.
4 PCD Library Class provides a PCD usage macro interface for all PCD types.
5 It should be included in any module that uses PCD. If a module uses dynamic/dynamicex
6 PCD, module should be linked to a PEIM/DXE library instance to access that PCD.
7 If a module uses PatchableInModule type PCD, it also needs the library instance to produce
8 LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is
9 translated to a variable or macro that is auto-generated by build tool in
10 module's autogen.h/autogen.c.
11 The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are
12 only available prior to ExitBootServices(). If access to PCD values are required
13 at runtime, then their values must be collected prior to ExitBootServices().
14 There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),
15 PatchPcdGetXX(), and PatchPcdSetXX().
17 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
18 This program and the accompanying materials
19 are licensed and made available under the terms and conditions of the BSD License
20 which accompanies this distribution. The full text of the license may be found at
21 http://opensource.org/licenses/bsd-license.php
23 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
24 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
31 #define PCD_MAX_SKU_ID 0x100
35 Retrieves a token number based on a token name.
37 Returns the token number associated with the PCD token specified by TokenName.
38 If TokenName is not a valid token in the token space, then the module will not build.
39 If TokenName is not a feature flag, then the module will not build.
41 @param TokenName The name of the PCD token to retrieve the token number for.
43 @return The token number associated with the PCD.
46 #define PcdToken(TokenName) _PCD_TOKEN_##TokenName
50 Retrieves a Boolean PCD feature flag based on a token name.
52 Returns the Boolean value for the PCD feature flag specified by TokenName.
53 If TokenName is not a valid token in the token space, then the module will not build.
54 If TokenName is not a feature flag, then the module will not build.
56 @param TokenName The name of the PCD token to retrieve a current value for.
58 @return Boolean value for the PCD feature flag.
61 #define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName
65 Retrieves an 8-bit fixed PCD token value based on a token name.
67 Returns the 8-bit value for the token specified by TokenName.
68 If TokenName is not a valid token in the token space, then the module will not build.
69 If TokenName is not a feature flag, then the module will not build.
71 @param TokenName The name of the PCD token to retrieve a current value for.
73 @return 8-bit value for the token specified by TokenName.
76 #define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName
80 Retrieves a 16-bit fixed PCD token value based on a token name.
82 Returns the 16-bit value for the token specified by TokenName.
83 If TokenName is not a valid token in the token space, then the module will not build.
84 If TokenName is not a feature flag, then the module will not build.
86 @param TokenName The name of the PCD token to retrieve a current value for.
88 @return 16-bit value for the token specified by TokenName.
91 #define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName
95 Retrieves a 32-bit fixed PCD token value based on a token name.
97 Returns the 32-bit value for the token specified by TokenName.
98 If TokenName is not a valid token in the token space, then the module will not build.
99 If TokenName is not a feature flag, then the module will not build.
101 @param TokenName The name of the PCD token to retrieve a current value for.
103 @return 32-bit value for the token specified by TokenName.
106 #define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName
110 Retrieves a 64-bit fixed PCD token value based on a token name.
112 Returns the 64-bit value for the token specified by TokenName.
113 If TokenName is not a valid token in the token space, then the module will not build.
114 If TokenName is not a feature flag, then the module will not build.
116 @param TokenName The name of the PCD token to retrieve a current value for.
118 @return 64-bit value for the token specified by TokenName.
121 #define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName
125 Retrieves a Boolean fixed PCD token value based on a token name.
127 Returns the Boolean value for the token specified by TokenName.
128 If TokenName is not a valid token in the token space, then the module will not build.
129 If TokenName is not a feature flag, then the module will not build.
131 @param TokenName The name of the PCD token to retrieve a current value for.
133 @return The Boolean value for the token.
136 #define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName
140 Retrieves a pointer to a fixed PCD token buffer based on a token name.
142 Returns a pointer to the buffer for the token specified by TokenName.
143 If TokenName is not a valid token in the token space, then the module will not build.
144 If TokenName is not a feature flag, then the module will not build.
146 @param TokenName The name of the PCD token to retrieve a current value for.
148 @return A pointer to the buffer.
151 #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)
155 Retrieves an 8-bit binary patchable PCD token value based on a token name.
157 Returns the 8-bit value for the token specified by TokenName.
158 If TokenName is not a valid token in the token space, then the module will not build.
159 If TokenName is not a feature flag, then the module will not build.
161 @param TokenName The name of the PCD token to retrieve a current value for.
163 @return An 8-bit binary patchable PCD token value.
166 #define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName
169 Retrieves a 16-bit binary patchable PCD token value based on a token name.
171 Returns the 16-bit value for the token specified by TokenName.
172 If TokenName is not a valid token in the token space, then the module will not build.
173 If TokenName is not a feature flag, then the module will not build.
175 @param TokenName The name of the PCD token to retrieve a current value for.
177 @return A 16-bit binary patchable PCD token value.
180 #define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName
184 Retrieves a 32-bit binary patchable PCD token value based on a token name.
186 Returns the 32-bit value for the token specified by TokenName.
187 If TokenName is not a valid token in the token space, then the module will not build.
188 If TokenName is not a feature flag, then the module will not build.
190 @param TokenName The name of the PCD token to retrieve a current value for.
192 @return A 32-bit binary patchable PCD token value.
195 #define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName
199 Retrieves a 64-bit binary patchable PCD token value based on a token name.
201 Returns the 64-bit value for the token specified by TokenName.
202 If TokenName is not a valid token in the token space, then the module will not build.
203 If TokenName is not a feature flag, then the module will not build.
205 @param TokenName The name of the PCD token to retrieve a current value for.
207 @return A 64-bit binary patchable PCD token value.
210 #define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName
214 Retrieves a Boolean binary patchable PCD token value based on a token name.
216 Returns the Boolean value for the token specified by TokenName.
217 If TokenName is not a valid token in the token space, then the module will not build.
218 If TokenName is not a feature flag, then the module will not build.
220 @param TokenName The name of the PCD token to retrieve a current value for.
222 @return The Boolean value for the token.
225 #define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName
229 Retrieves a pointer to a binary patchable PCD token buffer based on a token name.
231 Returns a pointer to the buffer for the token specified by TokenName.
232 If TokenName is not a valid token in the token space, then the module will not build.
233 If TokenName is not a feature flag, then the module will not build.
235 @param TokenName The name of the PCD token to retrieve a current value for.
237 @return A pointer to the buffer for the token.
240 #define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)
244 Sets an 8-bit binary patchable PCD token value based on a token name.
246 Sets the 8-bit value for the token specified by TokenName. Value is returned.
247 If TokenName is not a valid token in the token space, then the module will not build.
248 If TokenName is not a feature flag, then the module will not build.
250 @param TokenName The name of the binary patchable PCD token to set the current value for.
251 @param Value The 8-bit value to set.
253 @return Return the Value that was set.
256 #define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
260 Sets a 16-bit binary patchable PCD token value based on a token name.
262 Sets the 16-bit value for the token specified by TokenName. Value is returned.
263 If TokenName is not a valid token in the token space, then the module will not build.
264 If TokenName is not a feature flag, then the module will not build.
266 @param TokenName The name of the binary patchable PCD token to set the current value for.
267 @param Value The 16-bit value to set.
269 @return Return the Value that was set.
272 #define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
276 Sets a 32-bit binary patchable PCD token value based on a token name.
278 Sets the 32-bit value for the token specified by TokenName. Value is returned.
279 If TokenName is not a valid token in the token space, then the module will not build.
280 If TokenName is not a feature flag, then the module will not build.
282 @param TokenName The name of the binary patchable PCD token to set the current value for.
283 @param Value The 32-bit value to set.
285 @return Return the Value that was set.
288 #define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
292 Sets a 64-bit binary patchable PCD token value based on a token name.
294 Sets the 64-bit value for the token specified by TokenName. Value is returned.
295 If TokenName is not a valid token in the token space, then the module will not build.
296 If TokenName is not a feature flag, then the module will not build.
298 @param TokenName The name of the binary patchable PCD token to set the current value for.
299 @param Value The 64-bit value to set.
301 @return Return the Value that was set.
304 #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
308 Sets a Boolean binary patchable PCD token value based on a token name.
310 Sets the Boolean value for the token specified by TokenName. Value is returned.
311 If TokenName is not a valid token in the token space, then the module will not build.
312 If TokenName is not a feature flag, then the module will not build.
314 @param TokenName The name of the binary patchable PCD token to set the current value for.
315 @param Value The boolean value to set.
317 @return Return the Value that was set.
320 #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
324 Sets a pointer to a binary patchable PCD token buffer based on a token name.
326 Sets the buffer for the token specified by TokenName. Buffer is returned.
327 If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer
328 to the maximum size supported by TokenName and return NULL to indicate that the set operation
329 was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be
330 set to the maximum size supported by TokenName and NULL must be returned.
331 If TokenName is not a valid token in the token space, then the module will not build.
332 If TokenName is not a feature flag, then the module will not build.
334 If SizeOfBuffer is NULL, then ASSERT().
335 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
337 @param TokenName The name of the binary patchable PCD token to set the current value for.
338 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
339 @param Buffer Pointer to the value to set.
341 @return Return the pointer to the Buffer that was set.
344 #define PatchPcdSetPtr(TokenName, Size, Buffer) \
345 LibPatchPcdSetPtr ( \
346 _gPcd_BinaryPatch_##TokenName, \
347 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
353 Retrieves an 8-bit PCD token value based on a token name.
355 Returns the 8-bit value for the token specified by TokenName.
356 If TokenName is not a valid token in the token space, then the module will not build.
358 @param TokenName The name of the PCD token to retrieve a current value for.
360 @return 8-bit value for the token specified by TokenName.
363 #define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName
367 Retrieves a 16-bit PCD token value based on a token name.
369 Returns the 16-bit value for the token specified by TokenName.
370 If TokenName is not a valid token in the token space, then the module will not build.
372 @param TokenName The name of the PCD token to retrieve a current value for.
374 @return 16-bit value for the token specified by TokenName.
377 #define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName
381 Retrieves a 32-bit PCD token value based on a token name.
383 Returns the 32-bit value for the token specified by TokenName.
384 If TokenName is not a valid token in the token space, then the module will not build.
386 @param TokenName The name of the PCD token to retrieve a current value for.
388 @return 32-bit value for the token specified by TokenName.
391 #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName
395 Retrieves a 64-bit PCD token value based on a token name.
397 Returns the 64-bit value for the token specified by TokenName.
398 If TokenName is not a valid token in the token space, then the module will not build.
400 @param TokenName The name of the PCD token to retrieve a current value for.
402 @return 64-bit value for the token specified by TokenName.
405 #define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName
409 Retrieves a pointer to a PCD token buffer based on a token name.
411 Returns a pointer to the buffer for the token specified by TokenName.
412 If TokenName is not a valid token in the token space, then the module will not build.
414 @param TokenName The name of the PCD token to retrieve a current value for.
416 @return A pointer to the buffer.
419 #define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName
423 Retrieves a Boolean PCD token value based on a token name.
425 Returns the Boolean value for the token specified by TokenName.
426 If TokenName is not a valid token in the token space, then the module will not build.
428 @param TokenName The name of the PCD token to retrieve a current value for.
430 @return A Boolean PCD token value.
433 #define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName
437 Sets an 8-bit PCD token value based on a token name.
439 Sets the 8-bit value for the token specified by TokenName. Value is returned.
440 If TokenName is not a valid token in the token space, then the module will not build.
442 @param TokenName The name of the PCD token to retrieve a current value for.
443 @param Value The 8-bit value to set.
445 @return Return the Value that was set.
448 #define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))
452 Sets a 16-bit PCD token value based on a token name.
454 Sets the 16-bit value for the token specified by TokenName. Value is returned.
455 If TokenName is not a valid token in the token space, then the module will not build.
457 @param TokenName The name of the PCD token to retrieve a current value for.
458 @param Value The 16-bit value to set.
460 @return Return the Value that was set.
463 #define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))
467 Sets a 32-bit PCD token value based on a token name.
469 Sets the 32-bit value for the token specified by TokenName. Value is returned.
470 If TokenName is not a valid token in the token space, then the module will not build.
472 @param TokenName The name of the PCD token to retrieve a current value for.
473 @param Value The 32-bit value to set.
475 @return Return the Value that was set.
478 #define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))
482 Sets a 64-bit PCD token value based on a token name.
484 Sets the 64-bit value for the token specified by TokenName. Value is returned.
485 If TokenName is not a valid token in the token space, then the module will not build.
487 @param TokenName The name of the PCD token to retrieve a current value for.
488 @param Value The 64-bit value to set.
490 @return Return the Value that was set.
493 #define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))
497 Sets a pointer to a PCD token buffer based on a token name.
499 Sets the buffer for the token specified by TokenName. Buffer is returned.
500 If SizeOfBuffer is greater than the maximum size supported by TokenName,
501 then set SizeOfBuffer to the maximum size supported by TokenName and return NULL
502 to indicate that the set operation was not actually performed. If SizeOfBuffer
503 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported
504 by TokenName and NULL must be returned.
505 If TokenName is not a valid token in the token space, then the module will not build.
507 If SizeOfBuffer is NULL, then ASSERT().
508 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
510 @param TokenName The name of the PCD token to set the current value for.
511 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
512 @param Buffer A pointer to the buffer to set.
514 @return Return the pointer to the Buffer that was set.
517 #define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \
518 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))
521 Sets a Boolean PCD token value based on a token name.
523 Sets the Boolean value for the token specified by TokenName. Value is returned.
524 If TokenName is not a valid token in the token space, then the module will not build.
526 @param TokenName The name of the PCD token to set the current value for.
527 @param Buffer The Boolean value to set.
529 @return Return the Value that was set.
532 #define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))
536 Retrieves a token number based on a GUID and a token name.
538 Returns the token number for the token specified by Guid and TokenName.
540 @param Guid Pointer to a 128-bit unique value that designates
541 which namespace to retrieve a value from.
542 @param TokenName The name of the PCD token to retrieve a current value for.
544 @return Return the token number.
547 #define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid)
550 Retrieves an 8-bit PCD token value based on a GUID and a token name.
552 Returns the 8-bit value for the token specified by Guid and TokenName.
553 If TokenName is not a valid token in the token space specified by Guid,
554 then the module will not build.
556 If Guid is NULL, then ASSERT().
558 @param Guid Pointer to a 128-bit unique value that designates
559 which namespace to retrieve a value from.
560 @param TokenName The name of the PCD token to retrieve a current value for.
562 @return An 8-bit PCD token value.
565 #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
568 Retrieves a 16-bit PCD token value based on a GUID and a token name.
570 Returns the 16-bit value for the token specified by Guid and TokenName.
571 If TokenName is not a valid token in the token space specified by Guid,
572 then the module will not build.
574 If Guid is NULL, then ASSERT().
576 @param Guid Pointer to a 128-bit unique value that designates
577 which namespace to retrieve a value from.
578 @param TokenName The name of the PCD token to retrieve a current value for.
580 @return A 16-bit PCD token value.
583 #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
587 Retrieves a 32-bit PCD token value based on a GUID and a token name.
589 Returns the 32-bit value for the token specified by Guid and TokenName.
590 If TokenName is not a valid token in the token space specified by Guid,
591 then the module will not build.
593 If Guid is NULL, then ASSERT().
595 @param Guid Pointer to a 128-bit unique value that designates
596 which namespace to retrieve a value from.
597 @param TokenName The name of the PCD token to retrieve a current value for.
599 @return A 32-bit PCD token value.
602 #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
606 Retrieves a 64-bit PCD token value based on a GUID and a token name.
608 Returns the 64-bit value for the token specified by Guid and TokenName.
609 If TokenName is not a valid token in the token space specified by Guid,
610 then the module will not build.
612 If Guid is NULL, then ASSERT().
614 @param Guid Pointer to a 128-bit unique value that designates
615 which namespace to retrieve a value from.
616 @param TokenName The name of the PCD token to retrieve a current value for.
618 @return A 64-bit PCD token value.
621 #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
625 Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
627 Returns a pointer to the buffer for the token specified by Guid and TokenName.
628 If TokenName is not a valid token in the token space specified by Guid,
629 then the module will not build.
631 If Guid is NULL, then ASSERT().
633 @param Guid Pointer to a 128-bit unique value that designates
634 which namespace to retrieve a value from.
635 @param TokenName The name of the PCD token to retrieve a current value for.
637 @return A pointer to a PCD token buffer.
640 #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
644 Retrieves a Boolean PCD token value based on a GUID and a token name.
646 Returns the Boolean value for the token specified by Guid and TokenName.
647 If TokenName is not a valid token in the token space specified by Guid,
648 then the module will not build.
650 If Guid is NULL, then ASSERT().
652 @param Guid Pointer to a 128-bit unique value that designates
653 which namespace to retrieve a value from.
654 @param TokenName The name of the PCD token to retrieve a current value for.
656 @return A Boolean PCD token value.
659 #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))
663 Sets an 8-bit PCD token value based on a GUID and a token name.
665 Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
666 If TokenName is not a valid token in the token space specified by Guid,
667 then the module will not build.
669 If Guid is NULL, then ASSERT().
671 @param Guid Pointer to a 128-bit unique value that designates
672 which namespace to retrieve a value from.
673 @param TokenName The name of the PCD token to set the current value for.
674 @param Value The 8-bit value to set.
676 @return Return the Value that was set.
679 #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
683 Sets a 16-bit PCD token value based on a GUID and a token name.
685 Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
686 If TokenName is not a valid token in the token space specified by Guid,
687 then the module will not build.
689 If Guid is NULL, then ASSERT().
691 @param Guid Pointer to a 128-bit unique value that designates
692 which namespace to retrieve a value from.
693 @param TokenName The name of the PCD token to set the current value for.
694 @param Value The 16-bit value to set.
696 @return Return the Value that was set.
699 #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
703 Sets a 32-bit PCD token value based on a GUID and a token name.
705 Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
706 If TokenName is not a valid token in the token space specified by Guid,
707 then the module will not build.
709 If Guid is NULL, then ASSERT().
711 @param Guid Pointer to a 128-bit unique value that designates
712 which namespace to retrieve a value from.
713 @param TokenName The name of the PCD token to set the current value for.
714 @param Value The 32-bit value to set.
716 @return Return the Value that was set.
719 #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
723 Sets a 64-bit PCD token value based on a GUID and a token name.
725 Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
726 If TokenName is not a valid token in the token space specified by Guid,
727 then the module will not build.
729 If Guid is NULL, then ASSERT().
731 @param Guid Pointer to a 128-bit unique value that designates
732 which namespace to retrieve a value from.
733 @param TokenName The name of the PCD token to set the current value for.
734 @param Value The 64-bit value to set.
736 @return Return the Value that was set.
739 #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
743 Sets a pointer to a PCD token buffer based on a GUID and a token name.
745 Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
746 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
747 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
748 NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
749 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
750 Guid and TokenName and NULL must be returned.
751 If TokenName is not a valid token in the token space specified by Guid,
752 then the module will not build.
754 If Guid is NULL, then ASSERT().
755 If SizeOfBuffer is NULL, then ASSERT().
756 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
758 @param Guid Pointer to a 128-bit unique value that designates
759 which namespace to retrieve a value from.
760 @param TokenName The name of the PCD token to set the current value for.
761 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
762 @param Buffer Pointer to the buffer to set.
764 @return Return the pointer to the Buffer that was set.
767 #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
768 LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
772 Sets a Boolean PCD token value based on a GUID and a token name.
774 Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
775 If TokenName is not a valid token in the token space specified by Guid,
776 then the module will not build.
778 If Guid is NULL, then ASSERT().
780 @param Guid Pointer to a 128-bit unique value that designates
781 which namespace to retrieve a value from.
782 @param TokenName The name of the PCD token to set the current value for.
783 @param Value The Boolean value to set.
785 @return Return the Value that was set.
788 #define PcdSetExBool(Guid, TokenName, Value) \
789 LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))
793 This function provides a means by which SKU support can be established in the PCD infrastructure.
795 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
796 If SkuId >= PCD_MAX_SKU_ID, then ASSERT().
798 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values
799 associated with a PCD token.
801 @return Return the SKU ID that was set.
812 This function provides a means by which to retrieve a value for a given PCD token.
814 Returns the 8-bit value for the token specified by TokenNumber.
816 @param[in] TokenNumber The PCD token number to retrieve a current value for.
818 @return Returns the 8-bit value for the token specified by TokenNumber.
829 This function provides a means by which to retrieve a value for a given PCD token.
831 Returns the 16-bit value for the token specified by TokenNumber.
833 @param[in] TokenNumber The PCD token number to retrieve a current value for.
835 @return Returns the 16-bit value for the token specified by TokenNumber.
846 This function provides a means by which to retrieve a value for a given PCD token.
848 Returns the 32-bit value for the token specified by TokenNumber.
850 @param[in] TokenNumber The PCD token number to retrieve a current value for.
852 @return Returns the 32-bit value for the token specified by TokenNumber.
863 This function provides a means by which to retrieve a value for a given PCD token.
865 Returns the 64-bit value for the token specified by TokenNumber.
867 @param[in] TokenNumber The PCD token number to retrieve a current value for.
869 @return Returns the 64-bit value for the token specified by TokenNumber.
880 This function provides a means by which to retrieve a value for a given PCD token.
882 Returns the pointer to the buffer of the token specified by TokenNumber.
884 @param[in] TokenNumber The PCD token number to retrieve a current value for.
886 @return Returns the pointer to the token specified by TokenNumber.
897 This function provides a means by which to retrieve a value for a given PCD token.
899 Returns the Boolean value of the token specified by TokenNumber.
901 @param[in] TokenNumber The PCD token number to retrieve a current value for.
903 @return Returns the Boolean value of the token specified by TokenNumber.
914 This function provides a means by which to retrieve the size of a given PCD token.
916 @param[in] TokenNumber The PCD token number to retrieve a current value for.
918 @return Returns the size of the token specified by TokenNumber.
929 This function provides a means by which to retrieve a value for a given PCD token.
931 Returns the 8-bit value for the token specified by TokenNumber and Guid.
933 If Guid is NULL, then ASSERT().
935 @param[in] Guid Pointer to a 128-bit unique value that designates
936 which namespace to retrieve a value from.
937 @param[in] TokenNumber The PCD token number to retrieve a current value for.
939 @return Return the UINT8.
951 This function provides a means by which to retrieve a value for a given PCD token.
953 Returns the 16-bit value for the token specified by TokenNumber and Guid.
955 If Guid is NULL, then ASSERT().
957 @param[in] Guid Pointer to a 128-bit unique value that designates
958 which namespace to retrieve a value from.
959 @param[in] TokenNumber The PCD token number to retrieve a current value for.
961 @return Return the UINT16.
973 Returns the 32-bit value for the token specified by TokenNumber and Guid.
974 If Guid is NULL, then ASSERT().
976 @param[in] Guid Pointer to a 128-bit unique value that designates
977 which namespace to retrieve a value from.
978 @param[in] TokenNumber The PCD token number to retrieve a current value for.
980 @return Return the UINT32.
992 This function provides a means by which to retrieve a value for a given PCD token.
994 Returns the 64-bit value for the token specified by TokenNumber and Guid.
996 If Guid is NULL, then ASSERT().
998 @param[in] Guid Pointer to a 128-bit unique value that designates
999 which namespace to retrieve a value from.
1000 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1002 @return Return the UINT64.
1008 IN CONST GUID
*Guid
,
1009 IN UINTN TokenNumber
1014 This function provides a means by which to retrieve a value for a given PCD token.
1016 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
1018 If Guid is NULL, then ASSERT().
1020 @param[in] Guid Pointer to a 128-bit unique value that designates
1021 which namespace to retrieve a value from.
1022 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1024 @return Return the VOID* pointer.
1030 IN CONST GUID
*Guid
,
1031 IN UINTN TokenNumber
1036 This function provides a means by which to retrieve a value for a given PCD token.
1038 Returns the Boolean value of the token specified by TokenNumber and Guid.
1040 If Guid is NULL, then ASSERT().
1042 @param[in] Guid Pointer to a 128-bit unique value that designates
1043 which namespace to retrieve a value from.
1044 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1046 @return Return the BOOLEAN.
1052 IN CONST GUID
*Guid
,
1053 IN UINTN TokenNumber
1058 This function provides a means by which to retrieve the size of a given PCD token.
1060 Returns the size of the token specified by TokenNumber and Guid.
1062 If Guid is NULL, then ASSERT().
1064 @param[in] Guid Pointer to a 128-bit unique value that designates
1065 which namespace to retrieve a value from.
1066 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1068 @return Return the size.
1074 IN CONST GUID
*Guid
,
1075 IN UINTN TokenNumber
1080 This function provides a means by which to set a value for a given PCD token.
1082 Sets the 8-bit value for the token specified by TokenNumber
1083 to the value specified by Value. Value is returned.
1085 @param[in] TokenNumber The PCD token number to set a current value for.
1086 @param[in] Value The 8-bit value to set.
1088 @return Return the Value that was set.
1094 IN UINTN TokenNumber
,
1100 This function provides a means by which to set a value for a given PCD token.
1102 Sets the 16-bit value for the token specified by TokenNumber
1103 to the value specified by Value. Value is returned.
1105 @param[in] TokenNumber The PCD token number to set a current value for.
1106 @param[in] Value The 16-bit value to set.
1108 @return Return the Value that was set.
1114 IN UINTN TokenNumber
,
1120 This function provides a means by which to set a value for a given PCD token.
1122 Sets the 32-bit value for the token specified by TokenNumber
1123 to the value specified by Value. Value is returned.
1125 @param[in] TokenNumber The PCD token number to set a current value for.
1126 @param[in] Value The 32-bit value to set.
1128 @return Return the Value that was set.
1134 IN UINTN TokenNumber
,
1140 This function provides a means by which to set a value for a given PCD token.
1142 Sets the 64-bit value for the token specified by TokenNumber
1143 to the value specified by Value. Value is returned.
1145 @param[in] TokenNumber The PCD token number to set a current value for.
1146 @param[in] Value The 64-bit value to set.
1148 @return Return the Value that was set.
1154 IN UINTN TokenNumber
,
1160 This function provides a means by which to set a value for a given PCD token.
1162 Sets a buffer for the token specified by TokenNumber to the value
1163 specified by Buffer and SizeOfBuffer. Buffer is returned.
1164 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
1165 then set SizeOfBuffer to the maximum size supported by TokenNumber and
1166 return NULL to indicate that the set operation was not actually performed.
1168 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1169 maximum size supported by TokenName and NULL must be returned.
1171 If SizeOfBuffer is NULL, then ASSERT().
1172 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1174 @param[in] TokenNumber The PCD token number to set a current value for.
1175 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1176 @param[in] Buffer A pointer to the buffer to set.
1178 @return Return the pointer for the Buffer that was set.
1184 IN UINTN TokenNumber
,
1185 IN OUT UINTN
*SizeOfBuffer
,
1186 IN CONST VOID
*Buffer
1191 This function provides a means by which to set a value for a given PCD token.
1193 Sets the Boolean value for the token specified by TokenNumber
1194 to the value specified by Value. Value is returned.
1196 @param[in] TokenNumber The PCD token number to set a current value for.
1197 @param[in] Value The boolean value to set.
1199 @return Return the Value that was set.
1205 IN UINTN TokenNumber
,
1211 This function provides a means by which to set a value for a given PCD token.
1213 Sets the 8-bit value for the token specified by TokenNumber and
1214 Guid to the value specified by Value. Value is returned.
1216 If Guid is NULL, then ASSERT().
1218 @param[in] Guid Pointer to a 128-bit unique value that
1219 designates which namespace to set a value from.
1220 @param[in] TokenNumber The PCD token number to set a current value for.
1221 @param[in] Value The 8-bit value to set.
1223 @return Return the Value that was set.
1229 IN CONST GUID
*Guid
,
1230 IN UINTN TokenNumber
,
1236 This function provides a means by which to set a value for a given PCD token.
1238 Sets the 16-bit value for the token specified by TokenNumber and
1239 Guid to the value specified by Value. Value is returned.
1241 If Guid is NULL, then ASSERT().
1243 @param[in] Guid Pointer to a 128-bit unique value that
1244 designates which namespace to set a value from.
1245 @param[in] TokenNumber The PCD token number to set a current value for.
1246 @param[in] Value The 16-bit value to set.
1248 @return Return the Value that was set.
1254 IN CONST GUID
*Guid
,
1255 IN UINTN TokenNumber
,
1261 This function provides a means by which to set a value for a given PCD token.
1263 Sets the 32-bit value for the token specified by TokenNumber and
1264 Guid to the value specified by Value. Value is returned.
1266 If Guid is NULL, then ASSERT().
1268 @param[in] Guid Pointer to a 128-bit unique value that
1269 designates which namespace to set a value from.
1270 @param[in] TokenNumber The PCD token number to set a current value for.
1271 @param[in] Value The 32-bit value to set.
1273 @return Return the Value that was set.
1279 IN CONST GUID
*Guid
,
1280 IN UINTN TokenNumber
,
1286 This function provides a means by which to set a value for a given PCD token.
1288 Sets the 64-bit value for the token specified by TokenNumber and
1289 Guid to the value specified by Value. Value is returned.
1290 If Guid is NULL, then ASSERT().
1292 @param[in] Guid Pointer to a 128-bit unique value that
1293 designates which namespace to set a value from.
1294 @param[in] TokenNumber The PCD token number to set a current value for.
1295 @param[in] Value The 64-bit value to set.
1297 @return Return the Value that was set.
1303 IN CONST GUID
*Guid
,
1304 IN UINTN TokenNumber
,
1310 This function provides a means by which to set a value for a given PCD token.
1312 Sets a buffer for the token specified by TokenNumber to the value specified by
1313 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1314 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
1315 supported by TokenNumber and return NULL to indicate that the set operation
1316 was not actually performed.
1318 If Guid is NULL, then ASSERT().
1319 If SizeOfBuffer is NULL, then ASSERT().
1320 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1322 @param[in] Guid Pointer to a 128-bit unique value that
1323 designates which namespace to set a value from.
1324 @param[in] TokenNumber The PCD token number to set a current value for.
1325 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1326 @param[in] Buffer A pointer to the buffer to set.
1328 @return Return the pointer to the Buffer that was set.
1334 IN CONST GUID
*Guid
,
1335 IN UINTN TokenNumber
,
1336 IN OUT UINTN
*SizeOfBuffer
,
1342 This function provides a means by which to set a value for a given PCD token.
1344 Sets the Boolean value for the token specified by TokenNumber and
1345 Guid to the value specified by Value. Value is returned.
1347 If Guid is NULL, then ASSERT().
1349 @param[in] Guid Pointer to a 128-bit unique value that
1350 designates which namespace to set a value from.
1351 @param[in] TokenNumber The PCD token number to set a current value for.
1352 @param[in] Value The Boolean value to set.
1354 @return Return the Value that was set.
1360 IN CONST GUID
*Guid
,
1361 IN UINTN TokenNumber
,
1367 This notification function serves two purposes.
1369 Firstly, it notifies the module that did the registration that the value of this
1370 PCD token has been set.
1371 Secondly, it provides a mechanism for the module that did the registration to intercept
1372 the set operation and override the value been set if necessary. After the invocation of
1373 the callback function, TokenData will be used by PCD service PEIM or driver to modify th
1374 internal data in PCD database.
1376 @param[in] CallBackGuid The PCD token GUID being set.
1377 @param[in] CallBackToken The PCD token number being set.
1378 @param[in, out] TokenData A pointer to the token data being set.
1379 @param[in] TokenDataSize The size, in bytes, of the data being set.
1384 (EFIAPI
*PCD_CALLBACK
)(
1385 IN CONST GUID
*CallBackGuid
, OPTIONAL
1386 IN UINTN CallBackToken
,
1387 IN OUT VOID
*TokenData
,
1388 IN UINTN TokenDataSize
1393 Set up a notification function that is called when a specified token is set.
1395 When the token specified by TokenNumber and Guid is set,
1396 then notification function specified by NotificationFunction is called.
1397 If Guid is NULL, then the default token space is used.
1398 If NotificationFunction is NULL, then ASSERT().
1400 @param[in] Guid Pointer to a 128-bit unique value that designates which
1401 namespace to set a value from. If NULL, then the default
1402 token space is used.
1403 @param[in] TokenNumber The PCD token number to monitor.
1404 @param[in] NotificationFunction The function to call when the token
1405 specified by Guid and TokenNumber is set.
1410 LibPcdCallbackOnSet (
1411 IN CONST GUID
*Guid
, OPTIONAL
1412 IN UINTN TokenNumber
,
1413 IN PCD_CALLBACK NotificationFunction
1418 Disable a notification function that was established with LibPcdCallbackonSet().
1420 Disable a notification function that was previously established with LibPcdCallbackOnSet().
1421 If NotificationFunction is NULL, then ASSERT().
1422 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1423 and NotificationFunction, then ASSERT().
1425 @param[in] Guid Specify the GUID token space.
1426 @param[in] TokenNumber Specify the token number.
1427 @param[in] NotificationFunction The callback function to be unregistered.
1432 LibPcdCancelCallback (
1433 IN CONST GUID
*Guid
, OPTIONAL
1434 IN UINTN TokenNumber
,
1435 IN PCD_CALLBACK NotificationFunction
1440 Retrieves the next token in a token space.
1442 Retrieves the next PCD token number from the token space specified by Guid.
1443 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1444 then the first token number is returned. Otherwise, the token number that
1445 follows TokenNumber in the token space is returned. If TokenNumber is the last
1446 token number in the token space, then 0 is returned.
1448 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1450 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace
1451 to set a value from. If NULL, then the default token space is used.
1452 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1455 @return The next valid token number.
1460 LibPcdGetNextToken (
1461 IN CONST GUID
*Guid
, OPTIONAL
1462 IN UINTN TokenNumber
1468 Used to retrieve the list of available PCD token space GUIDs.
1470 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1472 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1473 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1475 @param TokenSpaceGuid Pointer to the a PCD token space GUID
1477 @return The next valid token namespace.
1482 LibPcdGetNextTokenSpace (
1483 IN CONST GUID
*TokenSpaceGuid
1488 Sets a value of a patchable PCD entry that is type pointer.
1490 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1491 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1492 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1493 NULL to indicate that the set operation was not actually performed.
1494 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1495 MaximumDatumSize and NULL must be returned.
1497 If PatchVariable is NULL, then ASSERT().
1498 If SizeOfBuffer is NULL, then ASSERT().
1499 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1501 @param[in] PatchVariable A pointer to the global variable in a module that is
1502 the target of the set operation.
1503 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1504 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1505 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1507 @return Return the pointer to the Buffer that was set.
1513 IN VOID
*PatchVariable
,
1514 IN UINTN MaximumDatumSize
,
1515 IN OUT UINTN
*SizeOfBuffer
,
1516 IN CONST VOID
*Buffer