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