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