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 - 2008, Intel Corporation
18 All rights reserved. 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 an 8-bit PCD token value based on a GUID and a token name.
538 Returns the 8-bit value for the token specified by Guid and TokenName.
539 If TokenName is not a valid token in the token space specified by Guid,
540 then the module will not build.
542 If Guid is NULL, then ASSERT().
544 @param Guid Pointer to a 128-bit unique value that designates
545 which namespace to retrieve a value from.
546 @param TokenName The name of the PCD token to retrieve a current value for.
548 @return An 8-bit PCD token value.
551 #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), _PCD_TOKEN_##TokenName)
555 Retrieves a 16-bit PCD token value based on a GUID and a token name.
557 Returns the 16-bit value for the token specified by Guid and TokenName.
558 If TokenName is not a valid token in the token space specified by Guid,
559 then the module will not build.
561 If Guid is NULL, then ASSERT().
563 @param Guid Pointer to a 128-bit unique value that designates
564 which namespace to retrieve a value from.
565 @param TokenName The name of the PCD token to retrieve a current value for.
567 @return A 16-bit PCD token value.
570 #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), _PCD_TOKEN_##TokenName)
574 Retrieves a 32-bit PCD token value based on a GUID and a token name.
576 Returns the 32-bit value for the token specified by Guid and TokenName.
577 If TokenName is not a valid token in the token space specified by Guid,
578 then the module will not build.
580 If Guid is NULL, then ASSERT().
582 @param Guid Pointer to a 128-bit unique value that designates
583 which namespace to retrieve a value from.
584 @param TokenName The name of the PCD token to retrieve a current value for.
586 @return A 32-bit PCD token value.
589 #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), _PCD_TOKEN_##TokenName)
593 Retrieves a 64-bit PCD token value based on a GUID and a token name.
595 Returns the 64-bit value for the token specified by Guid and TokenName.
596 If TokenName is not a valid token in the token space specified by Guid,
597 then the module will not build.
599 If Guid is NULL, then ASSERT().
601 @param Guid Pointer to a 128-bit unique value that designates
602 which namespace to retrieve a value from.
603 @param TokenName The name of the PCD token to retrieve a current value for.
605 @return A 64-bit PCD token value.
608 #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), _PCD_TOKEN_##TokenName)
612 Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
614 Returns a pointer to the buffer for the token specified by Guid and TokenName.
615 If TokenName is not a valid token in the token space specified by Guid,
616 then the module will not build.
618 If Guid is NULL, then ASSERT().
620 @param Guid Pointer to a 128-bit unique value that designates
621 which namespace to retrieve a value from.
622 @param TokenName The name of the PCD token to retrieve a current value for.
624 @return A pointer to a PCD token buffer.
627 #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), _PCD_TOKEN_##TokenName)
631 Retrieves a Boolean PCD token value based on a GUID and a token name.
633 Returns the Boolean value for the token specified by Guid and TokenName.
634 If TokenName is not a valid token in the token space specified by Guid,
635 then the module will not build.
637 If Guid is NULL, then ASSERT().
639 @param Guid Pointer to a 128-bit unique value that designates
640 which namespace to retrieve a value from.
641 @param TokenName The name of the PCD token to retrieve a current value for.
643 @return A Boolean PCD token value.
646 #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), _PCD_TOKEN_##TokenName)
650 Sets an 8-bit PCD token value based on a GUID and a token name.
652 Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
653 If TokenName is not a valid token in the token space specified by Guid,
654 then the module will not build.
656 If Guid is NULL, then ASSERT().
658 @param Guid Pointer to a 128-bit unique value that designates
659 which namespace to retrieve a value from.
660 @param TokenName The name of the PCD token to set the current value for.
661 @param Value The 8-bit value to set.
663 @return Return the Value that was set.
666 #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), _PCD_TOKEN_##TokenName, (Value))
670 Sets a 16-bit PCD token value based on a GUID and a token name.
672 Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
673 If TokenName is not a valid token in the token space specified by Guid,
674 then the module will not build.
676 If Guid is NULL, then ASSERT().
678 @param Guid Pointer to a 128-bit unique value that designates
679 which namespace to retrieve a value from.
680 @param TokenName The name of the PCD token to set the current value for.
681 @param Value The 16-bit value to set.
683 @return Return the Value that was set.
686 #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), _PCD_TOKEN_##TokenName, (Value))
690 Sets a 32-bit PCD token value based on a GUID and a token name.
692 Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
693 If TokenName is not a valid token in the token space specified by Guid,
694 then the module will not build.
696 If Guid is NULL, then ASSERT().
698 @param Guid Pointer to a 128-bit unique value that designates
699 which namespace to retrieve a value from.
700 @param TokenName The name of the PCD token to set the current value for.
701 @param Value The 32-bit value to set.
703 @return Return the Value that was set.
706 #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), _PCD_TOKEN_##TokenName, (Value))
710 Sets a 64-bit PCD token value based on a GUID and a token name.
712 Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
713 If TokenName is not a valid token in the token space specified by Guid,
714 then the module will not build.
716 If Guid is NULL, then ASSERT().
718 @param Guid Pointer to a 128-bit unique value that designates
719 which namespace to retrieve a value from.
720 @param TokenName The name of the PCD token to set the current value for.
721 @param Value The 64-bit value to set.
723 @return Return the Value that was set.
726 #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), _PCD_TOKEN_##TokenName, (Value))
730 Sets a pointer to a PCD token buffer based on a GUID and a token name.
732 Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
733 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
734 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
735 NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
736 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
737 Guid and TokenName and NULL must be returned.
738 If TokenName is not a valid token in the token space specified by Guid,
739 then the module will not build.
741 If Guid is NULL, then ASSERT().
742 If SizeOfBuffer is NULL, then ASSERT().
743 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
745 @param Guid Pointer to a 128-bit unique value that designates
746 which namespace to retrieve a value from.
747 @param TokenName The name of the PCD token to set the current value for.
748 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
749 @param Buffer Pointer to the buffer to set.
751 @return Return the pointer to the Buffer that was set.
754 #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
755 LibPcdSetExPtr ((Guid), _PCD_TOKEN_##TokenName, (SizeOfBuffer), (Buffer))
759 Sets a Boolean PCD token value based on a GUID and a token name.
761 Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
762 If TokenName is not a valid token in the token space specified by Guid,
763 then the module will not build.
765 If Guid is NULL, then ASSERT().
767 @param Guid Pointer to a 128-bit unique value that designates
768 which namespace to retrieve a value from.
769 @param TokenName The name of the PCD token to set the current value for.
770 @param Value The Boolean value to set.
772 @return Return the Value that was set.
775 #define PcdSetExBool(Guid, TokenName, Value) \
776 LibPcdSetExBool((Guid), _PCD_TOKEN_##TokenName, (Value))
780 This function provides a means by which SKU support can be established in the PCD infrastructure.
782 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
783 If SkuId >= PCD_MAX_SKU_ID, then ASSERT().
785 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values
786 associated with a PCD token.
788 @return Return the SKU ID that was set.
799 This function provides a means by which to retrieve a value for a given PCD token.
801 Returns the 8-bit value for the token specified by TokenNumber.
803 @param[in] TokenNumber The PCD token number to retrieve a current value for.
805 @return Returns the 8-bit value for the token specified by TokenNumber.
816 This function provides a means by which to retrieve a value for a given PCD token.
818 Returns the 16-bit value for the token specified by TokenNumber.
820 @param[in] TokenNumber The PCD token number to retrieve a current value for.
822 @return Returns the 16-bit value for the token specified by TokenNumber.
833 This function provides a means by which to retrieve a value for a given PCD token.
835 Returns the 32-bit value for the token specified by TokenNumber.
837 @param[in] TokenNumber The PCD token number to retrieve a current value for.
839 @return Returns the 32-bit value for the token specified by TokenNumber.
850 This function provides a means by which to retrieve a value for a given PCD token.
852 Returns the 64-bit value for the token specified by TokenNumber.
854 @param[in] TokenNumber The PCD token number to retrieve a current value for.
856 @return Returns the 64-bit value for the token specified by TokenNumber.
867 This function provides a means by which to retrieve a value for a given PCD token.
869 Returns the pointer to the buffer of the token specified by TokenNumber.
871 @param[in] TokenNumber The PCD token number to retrieve a current value for.
873 @return Returns the pointer to the token specified by TokenNumber.
884 This function provides a means by which to retrieve a value for a given PCD token.
886 Returns the Boolean value of the token specified by TokenNumber.
888 @param[in] TokenNumber The PCD token number to retrieve a current value for.
890 @return Returns the Boolean value of the token specified by TokenNumber.
901 This function provides a means by which to retrieve the size of a given PCD token.
903 @param[in] TokenNumber The PCD token number to retrieve a current value for.
905 @return Returns the size of the token specified by TokenNumber.
916 This function provides a means by which to retrieve a value for a given PCD token.
918 Returns the 8-bit value for the token specified by TokenNumber and Guid.
920 If Guid is NULL, then ASSERT().
922 @param[in] Guid Pointer to a 128-bit unique value that designates
923 which namespace to retrieve a value from.
924 @param[in] TokenNumber The PCD token number to retrieve a current value for.
926 @return Return the UINT8.
938 This function provides a means by which to retrieve a value for a given PCD token.
940 Returns the 16-bit value for the token specified by TokenNumber and Guid.
942 If Guid is NULL, then ASSERT().
944 @param[in] Guid Pointer to a 128-bit unique value that designates
945 which namespace to retrieve a value from.
946 @param[in] TokenNumber The PCD token number to retrieve a current value for.
948 @return Return the UINT16.
960 Returns the 32-bit value for the token specified by TokenNumber and Guid.
961 If Guid is NULL, then ASSERT().
963 @param[in] Guid Pointer to a 128-bit unique value that designates
964 which namespace to retrieve a value from.
965 @param[in] TokenNumber The PCD token number to retrieve a current value for.
967 @return Return the UINT32.
979 This function provides a means by which to retrieve a value for a given PCD token.
981 Returns the 64-bit value for the token specified by TokenNumber and Guid.
983 If Guid is NULL, then ASSERT().
985 @param[in] Guid Pointer to a 128-bit unique value that designates
986 which namespace to retrieve a value from.
987 @param[in] TokenNumber The PCD token number to retrieve a current value for.
989 @return Return the UINT64.
1001 This function provides a means by which to retrieve a value for a given PCD token.
1003 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
1005 If Guid is NULL, then ASSERT().
1007 @param[in] Guid Pointer to a 128-bit unique value that designates
1008 which namespace to retrieve a value from.
1009 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1011 @return Return the VOID* pointer.
1017 IN CONST GUID
*Guid
,
1018 IN UINTN TokenNumber
1023 This function provides a means by which to retrieve a value for a given PCD token.
1025 Returns the Boolean value of the token specified by TokenNumber and Guid.
1027 If Guid is NULL, then ASSERT().
1029 @param[in] Guid Pointer to a 128-bit unique value that designates
1030 which namespace to retrieve a value from.
1031 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1033 @return Return the BOOLEAN.
1039 IN CONST GUID
*Guid
,
1040 IN UINTN TokenNumber
1045 This function provides a means by which to retrieve the size of a given PCD token.
1047 Returns the size of the token specified by TokenNumber and Guid.
1049 If Guid is NULL, then ASSERT().
1051 @param[in] Guid Pointer to a 128-bit unique value that designates
1052 which namespace to retrieve a value from.
1053 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1055 @return Return the size.
1061 IN CONST GUID
*Guid
,
1062 IN UINTN TokenNumber
1067 This function provides a means by which to set a value for a given PCD token.
1069 Sets the 8-bit value for the token specified by TokenNumber
1070 to the value specified by Value. Value is returned.
1072 @param[in] TokenNumber The PCD token number to set a current value for.
1073 @param[in] Value The 8-bit value to set.
1075 @return Return the Value that was set.
1081 IN UINTN TokenNumber
,
1087 This function provides a means by which to set a value for a given PCD token.
1089 Sets the 16-bit value for the token specified by TokenNumber
1090 to the value specified by Value. Value is returned.
1092 @param[in] TokenNumber The PCD token number to set a current value for.
1093 @param[in] Value The 16-bit value to set.
1095 @return Return the Value that was set.
1101 IN UINTN TokenNumber
,
1107 This function provides a means by which to set a value for a given PCD token.
1109 Sets the 32-bit value for the token specified by TokenNumber
1110 to the value specified by Value. Value is returned.
1112 @param[in] TokenNumber The PCD token number to set a current value for.
1113 @param[in] Value The 32-bit value to set.
1115 @return Return the Value that was set.
1121 IN UINTN TokenNumber
,
1127 This function provides a means by which to set a value for a given PCD token.
1129 Sets the 64-bit value for the token specified by TokenNumber
1130 to the value specified by Value. Value is returned.
1132 @param[in] TokenNumber The PCD token number to set a current value for.
1133 @param[in] Value The 64-bit value to set.
1135 @return Return the Value that was set.
1141 IN UINTN TokenNumber
,
1147 This function provides a means by which to set a value for a given PCD token.
1149 Sets a buffer for the token specified by TokenNumber to the value
1150 specified by Buffer and SizeOfBuffer. Buffer is returned.
1151 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
1152 then set SizeOfBuffer to the maximum size supported by TokenNumber and
1153 return NULL to indicate that the set operation was not actually performed.
1155 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1156 maximum size supported by TokenName and NULL must be returned.
1158 If SizeOfBuffer is NULL, then ASSERT().
1159 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1161 @param[in] TokenNumber The PCD token number to set a current value for.
1162 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1163 @param[in] Buffer A pointer to the buffer to set.
1165 @return Return the pointer for the Buffer that was set.
1171 IN UINTN TokenNumber
,
1172 IN OUT UINTN
*SizeOfBuffer
,
1173 IN CONST VOID
*Buffer
1178 This function provides a means by which to set a value for a given PCD token.
1180 Sets the Boolean value for the token specified by TokenNumber
1181 to the value specified by Value. Value is returned.
1183 @param[in] TokenNumber The PCD token number to set a current value for.
1184 @param[in] Value The boolean value to set.
1186 @return Return the Value that was set.
1192 IN UINTN TokenNumber
,
1198 This function provides a means by which to set a value for a given PCD token.
1200 Sets the 8-bit value for the token specified by TokenNumber and
1201 Guid to the value specified by Value. Value is returned.
1203 If Guid is NULL, then ASSERT().
1205 @param[in] Guid Pointer to a 128-bit unique value that
1206 designates which namespace to set a value from.
1207 @param[in] TokenNumber The PCD token number to set a current value for.
1208 @param[in] Value The 8-bit value to set.
1210 @return Return the Value that was set.
1216 IN CONST GUID
*Guid
,
1217 IN UINTN TokenNumber
,
1223 This function provides a means by which to set a value for a given PCD token.
1225 Sets the 16-bit value for the token specified by TokenNumber and
1226 Guid to the value specified by Value. Value is returned.
1228 If Guid is NULL, then ASSERT().
1230 @param[in] Guid Pointer to a 128-bit unique value that
1231 designates which namespace to set a value from.
1232 @param[in] TokenNumber The PCD token number to set a current value for.
1233 @param[in] Value The 16-bit value to set.
1235 @return Return the Value that was set.
1241 IN CONST GUID
*Guid
,
1242 IN UINTN TokenNumber
,
1248 This function provides a means by which to set a value for a given PCD token.
1250 Sets the 32-bit value for the token specified by TokenNumber and
1251 Guid to the value specified by Value. Value is returned.
1253 If Guid is NULL, then ASSERT().
1255 @param[in] Guid Pointer to a 128-bit unique value that
1256 designates which namespace to set a value from.
1257 @param[in] TokenNumber The PCD token number to set a current value for.
1258 @param[in] Value The 32-bit value to set.
1260 @return Return the Value that was set.
1266 IN CONST GUID
*Guid
,
1267 IN UINTN TokenNumber
,
1273 This function provides a means by which to set a value for a given PCD token.
1275 Sets the 64-bit value for the token specified by TokenNumber and
1276 Guid to the value specified by Value. Value is returned.
1277 If Guid is NULL, then ASSERT().
1279 @param[in] Guid Pointer to a 128-bit unique value that
1280 designates which namespace to set a value from.
1281 @param[in] TokenNumber The PCD token number to set a current value for.
1282 @param[in] Value The 64-bit value to set.
1284 @return Return the Value that was set.
1290 IN CONST GUID
*Guid
,
1291 IN UINTN TokenNumber
,
1297 This function provides a means by which to set a value for a given PCD token.
1299 Sets a buffer for the token specified by TokenNumber to the value specified by
1300 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1301 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
1302 supported by TokenNumber and return NULL to indicate that the set operation
1303 was not actually performed.
1305 If Guid is NULL, then ASSERT().
1306 If SizeOfBuffer is NULL, then ASSERT().
1307 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1309 @param[in] Guid Pointer to a 128-bit unique value that
1310 designates which namespace to set a value from.
1311 @param[in] TokenNumber The PCD token number to set a current value for.
1312 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1313 @param[in] Buffer A pointer to the buffer to set.
1315 @return Return the pointer to the Buffer that was set.
1321 IN CONST GUID
*Guid
,
1322 IN UINTN TokenNumber
,
1323 IN OUT UINTN
*SizeOfBuffer
,
1329 This function provides a means by which to set a value for a given PCD token.
1331 Sets the Boolean value for the token specified by TokenNumber and
1332 Guid to the value specified by Value. Value is returned.
1334 If Guid is NULL, then ASSERT().
1336 @param[in] Guid Pointer to a 128-bit unique value that
1337 designates which namespace to set a value from.
1338 @param[in] TokenNumber The PCD token number to set a current value for.
1339 @param[in] Value The Boolean value to set.
1341 @return Return the Value that was set.
1347 IN CONST GUID
*Guid
,
1348 IN UINTN TokenNumber
,
1354 This notification function serves two purposes.
1356 Firstly, it notifies the module that did the registration that the value of this
1357 PCD token has been set.
1358 Secondly, it provides a mechanism for the module that did the registration to intercept
1359 the set operation and override the value been set if necessary. After the invocation of
1360 the callback function, TokenData will be used by PCD service PEIM or driver to modify th
1361 internal data in PCD database.
1363 @param[in] CallBackGuid The PCD token GUID being set.
1364 @param[in] CallBackToken The PCD token number being set.
1365 @param[in, out] TokenData A pointer to the token data being set.
1366 @param[in] TokenDataSize The size, in bytes, of the data being set.
1371 (EFIAPI
*PCD_CALLBACK
)(
1372 IN CONST GUID
*CallBackGuid
, OPTIONAL
1373 IN UINTN CallBackToken
,
1374 IN OUT VOID
*TokenData
,
1375 IN UINTN TokenDataSize
1380 Set up a notification function that is called when a specified token is set.
1382 When the token specified by TokenNumber and Guid is set,
1383 then notification function specified by NotificationFunction is called.
1384 If Guid is NULL, then the default token space is used.
1385 If NotificationFunction is NULL, then ASSERT().
1387 @param[in] Guid Pointer to a 128-bit unique value that designates which
1388 namespace to set a value from. If NULL, then the default
1389 token space is used.
1390 @param[in] TokenNumber The PCD token number to monitor.
1391 @param[in] NotificationFunction The function to call when the token
1392 specified by Guid and TokenNumber is set.
1397 LibPcdCallbackOnSet (
1398 IN CONST GUID
*Guid
, OPTIONAL
1399 IN UINTN TokenNumber
,
1400 IN PCD_CALLBACK NotificationFunction
1405 Disable a notification function that was established with LibPcdCallbackonSet().
1407 Disable a notification function that was previously established with LibPcdCallbackOnSet().
1408 If NotificationFunction is NULL, then ASSERT().
1409 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1410 and NotificationFunction, then ASSERT().
1412 @param[in] Guid Specify the GUID token space.
1413 @param[in] TokenNumber Specify the token number.
1414 @param[in] NotificationFunction The callback function to be unregistered.
1419 LibPcdCancelCallback (
1420 IN CONST GUID
*Guid
, OPTIONAL
1421 IN UINTN TokenNumber
,
1422 IN PCD_CALLBACK NotificationFunction
1427 Retrieves the next token in a token space.
1429 Retrieves the next PCD token number from the token space specified by Guid.
1430 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1431 then the first token number is returned. Otherwise, the token number that
1432 follows TokenNumber in the token space is returned. If TokenNumber is the last
1433 token number in the token space, then 0 is returned.
1435 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1437 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace
1438 to set a value from. If NULL, then the default token space is used.
1439 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1442 @return The next valid token number.
1447 LibPcdGetNextToken (
1448 IN CONST GUID
*Guid
, OPTIONAL
1449 IN UINTN TokenNumber
1455 Used to retrieve the list of available PCD token space GUIDs.
1457 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1459 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1460 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1462 @param TokenSpaceGuid Pointer to the a PCD token space GUID
1464 @return The next valid token namespace.
1469 LibPcdGetNextTokenSpace (
1470 IN CONST GUID
*TokenSpaceGuid
1475 Sets a value of a patchable PCD entry that is type pointer.
1477 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1478 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1479 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1480 NULL to indicate that the set operation was not actually performed.
1481 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1482 MaximumDatumSize and NULL must be returned.
1484 If PatchVariable is NULL, then ASSERT().
1485 If SizeOfBuffer is NULL, then ASSERT().
1486 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1488 @param[in] PatchVariable A pointer to the global variable in a module that is
1489 the target of the set operation.
1490 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1491 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1492 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1494 @return Return the pointer to the Buffer that was set.
1500 IN VOID
*PatchVariable
,
1501 IN UINTN MaximumDatumSize
,
1502 IN OUT UINTN
*SizeOfBuffer
,
1503 IN CONST VOID
*Buffer