]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/PcdLib.h
Fix typo in comment.
[mirror_edk2.git] / MdePkg / Include / Library / PcdLib.h
1 /** @file
2 PCD Library Class Interface Declarations
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. 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
9
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.
12
13 **/
14
15 #ifndef __PCD_LIB_H__
16 #define __PCD_LIB_H__
17
18 #include <Base.h>
19
20 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
21
22 #define PcdToken(TokenName) _PCD_TOKEN_##TokenName
23
24
25 //
26 // Feature Flag is in the form of a global constant
27 //
28 #define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName
29
30
31 //
32 // Fixed is fixed at build time
33 //
34 #define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName
35 #define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName
36 #define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName
37 #define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName
38 #define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName
39
40
41 #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)
42
43
44 //
45 // (Binary) Patch is in the form of a global variable
46 //
47 #define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName
48 #define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName
49 #define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName
50 #define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName
51 #define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName
52 #define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)
53
54 #define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
55 #define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
56 #define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
57 #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
58 #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
59 #define PatchPcdSetPtr(TokenName, Size, Buffer) \
60 LibPatchPcdSetPtr ( \
61 _gPcd_BinaryPatch_##TokenName, \
62 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
63 (Size), \
64 (Buffer) \
65 )
66
67 //
68 // Dynamic is via the protocol with only the TokenNumber as argument
69 // It can also be Patch or Fixed type based on a build option
70 //
71 #define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName
72 #define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName
73 #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName
74 #define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName
75 #define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName
76 #define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName
77
78 //
79 // Dynamic Set
80 //
81 #define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))
82 #define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))
83 #define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))
84 #define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))
85 #define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \
86 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))
87 #define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))
88
89 //
90 // Dynamic Ex is to support binary distribution
91 //
92 #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), _PCD_TOKEN_##TokenName)
93 #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), _PCD_TOKEN_##TokenName)
94 #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), _PCD_TOKEN_##TokenName)
95 #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), _PCD_TOKEN_##TokenName)
96 #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), _PCD_TOKEN_##TokenName)
97 #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), _PCD_TOKEN_##TokenName)
98
99 //
100 // Dynamic Set Ex
101 //
102 #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), _PCD_TOKEN_##TokenName, (Value))
103 #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), _PCD_TOKEN_##TokenName, (Value))
104 #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), _PCD_TOKEN_##TokenName, (Value))
105 #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), _PCD_TOKEN_##TokenName, (Value))
106 #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
107 LibPcdSetExPtr ((Guid), _PCD_TOKEN_##TokenName, (SizeOfBuffer), (Buffer))
108 #define PcdSetExBool(Guid, TokenName, Value) \
109 LibPcdSetExBool((Guid), _PCD_TOKEN_##TokenName, (Value))
110
111
112 /**
113 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
114
115 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
116 set values associated with a PCD token.
117
118 @retval SKU_ID Return the SKU ID that just be set.
119
120 **/
121 UINTN
122 EFIAPI
123 LibPcdSetSku (
124 IN UINTN SkuId
125 );
126
127
128 /**
129 Returns the 8-bit value for the token specified by TokenNumber.
130
131 @param[in] TokenNumber The PCD token number to retrieve a current value for.
132
133 @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber.
134
135 **/
136 UINT8
137 EFIAPI
138 LibPcdGet8 (
139 IN UINTN TokenNumber
140 );
141
142
143 /**
144 Returns the 16-bit value for the token specified by TokenNumber.
145
146 @param[in] TokenNumber The PCD token number to retrieve a current value for.
147
148 @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber.
149
150 **/
151 UINT16
152 EFIAPI
153 LibPcdGet16 (
154 IN UINTN TokenNumber
155 );
156
157
158 /**
159 Returns the 32-bit value for the token specified by TokenNumber.
160
161 @param[in] TokenNumber The PCD token number to retrieve a current value for.
162
163 @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.
164
165 **/
166 UINT32
167 EFIAPI
168 LibPcdGet32 (
169 IN UINTN TokenNumber
170 );
171
172
173 /**
174 Returns the 64-bit value for the token specified by TokenNumber.
175
176 @param[in] TokenNumber The PCD token number to retrieve a current value for.
177
178 @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.
179
180 **/
181 UINT64
182 EFIAPI
183 LibPcdGet64 (
184 IN UINTN TokenNumber
185 );
186
187
188 /**
189 Returns the pointer to the buffer of the token specified by TokenNumber.
190
191 @param[in] TokenNumber The PCD token number to retrieve a current value for.
192
193 @retval VOID* Returns the pointer to the token specified by TokenNumber.
194
195 **/
196 VOID *
197 EFIAPI
198 LibPcdGetPtr (
199 IN UINTN TokenNumber
200 );
201
202
203 /**
204 Returns the Boolean value of the token specified by TokenNumber.
205
206 @param[in] TokenNumber The PCD token number to retrieve a current value for.
207
208 @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber.
209
210 **/
211 BOOLEAN
212 EFIAPI
213 LibPcdGetBool (
214 IN UINTN TokenNumber
215 );
216
217
218 /**
219 Returns the size of the token specified by TokenNumber.
220
221 @param[in] TokenNumber The PCD token number to retrieve a current value for.
222
223 @retval UINTN Returns the size of the token specified by TokenNumber.
224
225 **/
226 UINTN
227 EFIAPI
228 LibPcdGetSize (
229 IN UINTN TokenNumber
230 );
231
232
233 /**
234 Returns the 8-bit value for the token specified by TokenNumber and Guid.
235 If Guid is NULL, then ASSERT().
236
237 @param[in] Guid Pointer to a 128-bit unique value that designates
238 which namespace to retrieve a value from.
239 @param[in] TokenNumber The PCD token number to retrieve a current value for.
240
241 @retval UINT8 Return the UINT8.
242
243 **/
244 UINT8
245 EFIAPI
246 LibPcdGetEx8 (
247 IN CONST GUID *Guid,
248 IN UINTN TokenNumber
249 );
250
251
252 /**
253 Returns the 16-bit value for the token specified by TokenNumber and Guid.
254 If Guid is NULL, then ASSERT().
255
256 @param[in] Guid Pointer to a 128-bit unique value that designates
257 which namespace to retrieve a value from.
258 @param[in] TokenNumber The PCD token number to retrieve a current value for.
259
260 @retval UINT16 Return the UINT16.
261
262 **/
263 UINT16
264 EFIAPI
265 LibPcdGetEx16 (
266 IN CONST GUID *Guid,
267 IN UINTN TokenNumber
268 );
269
270
271 /**
272 Returns the 32-bit value for the token specified by TokenNumber and Guid.
273 If Guid is NULL, then ASSERT().
274
275 @param[in] Guid Pointer to a 128-bit unique value that designates
276 which namespace to retrieve a value from.
277 @param[in] TokenNumber The PCD token number to retrieve a current value for.
278
279 @retval UINT32 Return the UINT32.
280
281 **/
282 UINT32
283 EFIAPI
284 LibPcdGetEx32 (
285 IN CONST GUID *Guid,
286 IN UINTN TokenNumber
287 );
288
289
290 /**
291 Returns the 64-bit value for the token specified by TokenNumber and Guid.
292 If Guid is NULL, then ASSERT().
293
294 @param[in] Guid Pointer to a 128-bit unique value that designates
295 which namespace to retrieve a value from.
296 @param[in] TokenNumber The PCD token number to retrieve a current value for.
297
298 @retval UINT64 Return the UINT64.
299
300 **/
301 UINT64
302 EFIAPI
303 LibPcdGetEx64 (
304 IN CONST GUID *Guid,
305 IN UINTN TokenNumber
306 );
307
308
309 /**
310 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
311 If Guid is NULL, then ASSERT().
312
313 @param[in] Guid Pointer to a 128-bit unique value that designates
314 which namespace to retrieve a value from.
315 @param[in] TokenNumber The PCD token number to retrieve a current value for.
316
317 @retval VOID* Return the VOID* pointer.
318
319 **/
320 VOID *
321 EFIAPI
322 LibPcdGetExPtr (
323 IN CONST GUID *Guid,
324 IN UINTN TokenNumber
325 );
326
327
328 /**
329 Returns the Boolean value of the token specified by TokenNumber and Guid.
330 If Guid is NULL, then ASSERT().
331
332 @param[in] Guid Pointer to a 128-bit unique value that designates
333 which namespace to retrieve a value from.
334 @param[in] TokenNumber The PCD token number to retrieve a current value for.
335
336 @retval BOOLEAN Return the BOOLEAN.
337
338 **/
339 BOOLEAN
340 EFIAPI
341 LibPcdGetExBool (
342 IN CONST GUID *Guid,
343 IN UINTN TokenNumber
344 );
345
346
347 /**
348 Returns the size of the token specified by TokenNumber and Guid.
349 If Guid is NULL, then ASSERT().
350
351 @param[in] Guid Pointer to a 128-bit unique value that designates
352 which namespace to retrieve a value from.
353 @param[in] TokenNumber The PCD token number to retrieve a current value for.
354
355 @retval UINTN Return the size.
356
357 **/
358 UINTN
359 EFIAPI
360 LibPcdGetExSize (
361 IN CONST GUID *Guid,
362 IN UINTN TokenNumber
363 );
364
365
366 /**
367 Sets the 8-bit value for the token specified by TokenNumber
368 to the value specified by Value. Value is returned.
369
370 @param[in] TokenNumber The PCD token number to set a current value for.
371 @param[in] Value The 8-bit value to set.
372
373 @retval UINT8 Return the value been set.
374
375 **/
376 UINT8
377 EFIAPI
378 LibPcdSet8 (
379 IN UINTN TokenNumber,
380 IN UINT8 Value
381 );
382
383
384 /**
385 Sets the 16-bit value for the token specified by TokenNumber
386 to the value specified by Value. Value is returned.
387
388 @param[in] TokenNumber The PCD token number to set a current value for.
389 @param[in] Value The 16-bit value to set.
390
391 @retval UINT16 Return the value been set.
392
393 **/
394 UINT16
395 EFIAPI
396 LibPcdSet16 (
397 IN UINTN TokenNumber,
398 IN UINT16 Value
399 );
400
401
402 /**
403 Sets the 32-bit value for the token specified by TokenNumber
404 to the value specified by Value. Value is returned.
405
406 @param[in] TokenNumber The PCD token number to set a current value for.
407 @param[in] Value The 32-bit value to set.
408
409 @retval UINT32 Return the value been set.
410
411 **/
412 UINT32
413 EFIAPI
414 LibPcdSet32 (
415 IN UINTN TokenNumber,
416 IN UINT32 Value
417 );
418
419
420 /**
421 Sets the 64-bit value for the token specified by TokenNumber
422 to the value specified by Value. Value is returned.
423
424 @param[in] TokenNumber The PCD token number to set a current value for.
425 @param[in] Value The 64-bit value to set.
426
427 @retval UINT64 Return the value been set.
428
429 **/
430 UINT64
431 EFIAPI
432 LibPcdSet64 (
433 IN UINTN TokenNumber,
434 IN UINT64 Value
435 );
436
437
438 /**
439 Sets a buffer for the token specified by TokenNumber to the value
440 specified by Buffer and SizeOfValue. Buffer is returned.
441 If SizeOfValue is greater than the maximum size support by TokenNumber,
442 then set SizeOfValue to the maximum size supported by TokenNumber and
443 return NULL to indicate that the set operation was not actually performed.
444
445 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to the
446 maximum size supported by TokenName and NULL must be returned.
447
448 If SizeOfValue is NULL, then ASSERT().
449 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
450
451 @param[in] TokenNumber The PCD token number to set a current value for.
452 @param[in,out] SizeOfBuffer The size, in bytes, of Buffer.
453 @param[in] Buffer Value A pointer to the buffer to set.
454
455 @retval VOID* Return the pointer for the buffer been set.
456
457 **/
458 VOID*
459 EFIAPI
460 LibPcdSetPtr (
461 IN UINTN TokenNumber,
462 IN OUT UINTN *SizeOfBuffer,
463 IN VOID *Buffer
464 );
465
466
467 /**
468 Sets the Boolean value for the token specified by TokenNumber
469 to the value specified by Value. Value is returned.
470
471 @param[in] TokenNumber The PCD token number to set a current value for.
472 @param[in] Value The boolean value to set.
473
474 @retval BOOLEAN Return the value been set.
475
476 **/
477 BOOLEAN
478 EFIAPI
479 LibPcdSetBool (
480 IN UINTN TokenNumber,
481 IN BOOLEAN Value
482 );
483
484
485 /**
486 Sets the 8-bit value for the token specified by TokenNumber and
487 Guid to the value specified by Value. Value is returned.
488 If Guid is NULL, then ASSERT().
489
490 @param[in] Guid Pointer to a 128-bit unique value that
491 designates which namespace to set a value from.
492 @param[in] TokenNumber The PCD token number to set a current value for.
493 @param[in] Value The 8-bit value to set.
494
495 @retval UINT8 Return the value been set.
496
497 **/
498 UINT8
499 EFIAPI
500 LibPcdSetEx8 (
501 IN CONST GUID *Guid,
502 IN UINTN TokenNumber,
503 IN UINT8 Value
504 );
505
506
507 /**
508 Sets the 16-bit value for the token specified by TokenNumber and
509 Guid to the value specified by Value. Value is returned.
510 If Guid is NULL, then ASSERT().
511
512 @param[in] Guid Pointer to a 128-bit unique value that
513 designates which namespace to set a value from.
514 @param[in] TokenNumber The PCD token number to set a current value for.
515 @param[in] Value The 16-bit value to set.
516
517 @retval UINT8 Return the value been set.
518
519 **/
520 UINT16
521 EFIAPI
522 LibPcdSetEx16 (
523 IN CONST GUID *Guid,
524 IN UINTN TokenNumber,
525 IN UINT16 Value
526 );
527
528
529 /**
530 Sets the 32-bit value for the token specified by TokenNumber and
531 Guid to the value specified by Value. Value is returned.
532 If Guid is NULL, then ASSERT().
533
534 @param[in] Guid Pointer to a 128-bit unique value that
535 designates which namespace to set a value from.
536 @param[in] TokenNumber The PCD token number to set a current value for.
537 @param[in] Value The 32-bit value to set.
538
539 @retval UINT32 Return the value been set.
540
541 **/
542 UINT32
543 EFIAPI
544 LibPcdSetEx32 (
545 IN CONST GUID *Guid,
546 IN UINTN TokenNumber,
547 IN UINT32 Value
548 );
549
550
551 /**
552 Sets the 64-bit value for the token specified by TokenNumber and
553 Guid to the value specified by Value. Value is returned.
554 If Guid is NULL, then ASSERT().
555
556 @param[in] Guid Pointer to a 128-bit unique value that
557 designates which namespace to set a value from.
558 @param[in] TokenNumber The PCD token number to set a current value for.
559 @param[in] Value The 64-bit value to set.
560
561 @retval UINT64 Return the value been set.
562
563 **/
564 UINT64
565 EFIAPI
566 LibPcdSetEx64 (
567 IN CONST GUID *Guid,
568 IN UINTN TokenNumber,
569 IN UINT64 Value
570 );
571
572
573 /**
574 Sets a buffer for the token specified by TokenNumber to the value specified by
575 Buffer and SizeOfValue. Buffer is returned. If SizeOfValue is greater than
576 the maximum size support by TokenNumber, then set SizeOfValue to the maximum size
577 supported by TokenNumber and return NULL to indicate that the set operation
578 was not actually performed.
579
580 If Guid is NULL, then ASSERT().
581 If SizeOfValue is NULL, then ASSERT().
582 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
583
584 @param[in] Guid Pointer to a 128-bit unique value that
585 designates which namespace to set a value from.
586 @param[in] TokenNumber The PCD token number to set a current value for.
587 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
588 @param[in] Buffer A pointer to the buffer to set.
589
590 @retval VOID * Return the pinter to the buffer been set.
591
592 **/
593 VOID *
594 EFIAPI
595 LibPcdSetExPtr (
596 IN CONST GUID *Guid,
597 IN UINTN TokenNumber,
598 IN OUT UINTN *SizeOfBuffer,
599 IN VOID *Buffer
600 );
601
602
603 /**
604 Sets the Boolean value for the token specified by TokenNumber and
605 Guid to the value specified by Value. Value is returned.
606 If Guid is NULL, then ASSERT().
607
608 @param[in] Guid Pointer to a 128-bit unique value that
609 designates which namespace to set a value from.
610 @param[in] TokenNumber The PCD token number to set a current value for.
611 @param[in] Value The Boolean value to set.
612
613 @retval Boolean Return the value been set.
614
615 **/
616 BOOLEAN
617 EFIAPI
618 LibPcdSetExBool (
619 IN CONST GUID *Guid,
620 IN UINTN TokenNumber,
621 IN BOOLEAN Value
622 );
623
624
625 /**
626 When the token specified by TokenNumber and Guid is set,
627 then notification function specified by NotificationFunction is called.
628 If Guid is NULL, then the default token space is used.
629 If NotificationFunction is NULL, then ASSERT().
630
631 This notification function serves two purposes. Firstly, it notifies the module which
632 did the registration that the value of this PCD token has been set. Secondly,
633 it provides a mechanism for the module which did the registration to intercept
634 the set operation and override the value been set if necessary. After the invocation
635 of the callback function, TokenData will be used by PCD service PEIM or driver to
636 modify the internal data in PCD database.
637
638
639 @param[in] CallBackGuid The PCD token GUID being set.
640 @param[in] CallBackToken The PCD token number being set.
641 @param[in, out] TokenData A pointer to the token data being set.
642 @param[in] TokenDataSize The size, in bytes, of the data being set.
643
644 @retval VOID
645
646 **/
647 typedef
648 VOID
649 (EFIAPI *PCD_CALLBACK) (
650 IN CONST GUID *CallBackGuid, OPTIONAL
651 IN UINTN CallBackToken,
652 IN OUT VOID *TokenData,
653 IN UINTN TokenDataSize
654 );
655
656
657 /**
658 When the token specified by TokenNumber and Guid is set,
659 then notification function specified by NotificationFunction is called.
660 If Guid is NULL, then the default token space is used.
661 If NotificationFunction is NULL, then ASSERT().
662
663 @param[in] Guid Pointer to a 128-bit unique value that designates which
664 namespace to set a value from. If NULL, then the default
665 token space is used.
666 @param[in] TokenNumber The PCD token number to monitor.
667 @param[in] NotificationFunction The function to call when the token
668 specified by Guid and TokenNumber is set.
669
670 @retval VOID
671
672 **/
673 VOID
674 EFIAPI
675 LibPcdCallbackOnSet (
676 IN CONST GUID *Guid, OPTIONAL
677 IN UINTN TokenNumber,
678 IN PCD_CALLBACK NotificationFunction
679 );
680
681
682 /**
683 Disable a notification function that was established with LibPcdCallbackonSet().
684
685 @param[in] Guid Specify the GUID token space.
686 @param[in] TokenNumber Specify the token number.
687 @param[in] NotificationFunction The callback function to be unregistered.
688
689 @retval VOID
690
691 **/
692 VOID
693 EFIAPI
694 LibPcdCancelCallback (
695 IN CONST GUID *Guid, OPTIONAL
696 IN UINTN TokenNumber,
697 IN PCD_CALLBACK NotificationFunction
698 );
699
700
701 /**
702 Retrieves the next PCD token number from the token space specified by Guid.
703 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
704 then the first token number is returned. Otherwise, the token number that
705 follows TokenNumber in the token space is returned. If TokenNumber is the last
706 token number in the token space, then 0 is returned. If TokenNumber is not 0 and
707 is not in the token space specified by Guid, then ASSERT().
708
709 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace
710 to set a value from. If NULL, then the default token space is used.
711 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
712 token number.
713
714 @retval UINTN The next valid token number.
715
716 **/
717 UINTN
718 EFIAPI
719 LibPcdGetNextToken (
720 IN CONST GUID *Guid, OPTIONAL
721 IN UINTN TokenNumber
722 );
723
724
725
726 /**
727 Retrieves the next PCD token space from a token space specified by Guid.
728 Guid of NULL is reserved to mark the default local token namespace on the current
729 platform. If Guid is NULL, then the GUID of the first non-local token space of the
730 current platform is returned. If Guid is the last non-local token space,
731 then NULL is returned.
732
733 If Guid is not NULL and is not a valid token space in the current platform, then ASSERT().
734
735
736
737 @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace
738 to start the search.
739
740 @retval CONST GUID * The next valid token namespace.
741
742 **/
743 GUID *
744 EFIAPI
745 LibPcdGetNextTokenSpace (
746 IN CONST GUID *Guid
747 );
748
749
750 /**
751 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
752 and SizeOfValue. Buffer is returned. If SizeOfValue is greater than
753 MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return
754 NULL to indicate that the set operation was not actually performed.
755 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to
756 MaximumDatumSize and NULL must be returned.
757
758 If PatchVariable is NULL, then ASSERT().
759 If SizeOfValue is NULL, then ASSERT().
760 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
761
762 @param[in] PatchVariable A pointer to the global variable in a module that is
763 the target of the set operation.
764 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
765 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
766 @param[in] Buffer A pointer to the buffer to used to set the target variable.
767
768 **/
769 VOID *
770 EFIAPI
771 LibPatchPcdSetPtr (
772 IN VOID *PatchVariable,
773 IN UINTN MaximumDatumSize,
774 IN OUT UINTN *SizeOfBuffer,
775 IN CONST VOID *Buffer
776 );
777
778 #endif