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