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