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