]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/PcdLib.h
71034716c8356939e7196857a4647792cb5751e3
[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 The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are
12 only available prior to ExitBootServices(). If access to PCD values are required
13 at runtime, then their values must be collected prior to ExitBootServices().
14 There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),
15 PatchPcdGetXX(), and PatchPcdSetXX().
16
17 Copyright (c) 2006 - 2008, Intel Corporation
18 All rights reserved. This program and the accompanying materials
19 are licensed and made available under the terms and conditions of the BSD License
20 which accompanies this distribution. The full text of the license may be found at
21 http://opensource.org/licenses/bsd-license.php
22
23 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
24 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25
26 **/
27
28 #ifndef __PCD_LIB_H__
29 #define __PCD_LIB_H__
30
31 #define PCD_MAX_SKU_ID 0x100
32
33
34 /**
35 Retrieves a token number based on a token name.
36
37 Returns the token number associated with the PCD token specified by TokenName.
38 If TokenName is not a valid token in the token space, then the module will not build.
39 If TokenName is not a feature flag, then the module will not build.
40
41 @param TokenName The name of the PCD token to retrieve the token number for.
42
43 @return The token number associated with the PCD.
44
45 **/
46 #define PcdToken(TokenName) _PCD_TOKEN_##TokenName
47
48
49 /**
50 Retrieves a Boolean PCD feature flag based on a token name.
51
52 Returns the Boolean value for the PCD feature flag specified by TokenName.
53 If TokenName is not a valid token in the token space, then the module will not build.
54 If TokenName is not a feature flag, then the module will not build.
55
56 @param TokenName The name of the PCD token to retrieve a current value for.
57
58 @return Boolean value for the PCD feature flag.
59
60 **/
61 #define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName
62
63
64 /**
65 Retrieves an 8-bit fixed PCD token value based on a token name.
66
67 Returns the 8-bit value for the token specified by TokenName.
68 If TokenName is not a valid token in the token space, then the module will not build.
69 If TokenName is not a feature flag, then the module will not build.
70
71 @param TokenName The name of the PCD token to retrieve a current value for.
72
73 @return 8-bit value for the token specified by TokenName.
74
75 **/
76 #define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName
77
78
79 /**
80 Retrieves a 16-bit fixed PCD token value based on a token name.
81
82 Returns the 16-bit value for the token specified by TokenName.
83 If TokenName is not a valid token in the token space, then the module will not build.
84 If TokenName is not a feature flag, then the module will not build.
85
86 @param TokenName The name of the PCD token to retrieve a current value for.
87
88 @return 16-bit value for the token specified by TokenName.
89
90 **/
91 #define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName
92
93
94 /**
95 Retrieves a 32-bit fixed PCD token value based on a token name.
96
97 Returns the 32-bit value for the token specified by TokenName.
98 If TokenName is not a valid token in the token space, then the module will not build.
99 If TokenName is not a feature flag, then the module will not build.
100
101 @param TokenName The name of the PCD token to retrieve a current value for.
102
103 @return 32-bit value for the token specified by TokenName.
104
105 **/
106 #define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName
107
108
109 /**
110 Retrieves a 64-bit fixed PCD token value based on a token name.
111
112 Returns the 64-bit value for the token specified by TokenName.
113 If TokenName is not a valid token in the token space, then the module will not build.
114 If TokenName is not a feature flag, then the module will not build.
115
116 @param TokenName The name of the PCD token to retrieve a current value for.
117
118 @return 64-bit value for the token specified by TokenName.
119
120 **/
121 #define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName
122
123
124 /**
125 Retrieves a Boolean fixed PCD token value based on a token name.
126
127 Returns the Boolean value for the token specified by TokenName.
128 If TokenName is not a valid token in the token space, then the module will not build.
129 If TokenName is not a feature flag, then the module will not build.
130
131 @param TokenName The name of the PCD token to retrieve a current value for.
132
133 @return The Boolean value for the token.
134
135 **/
136 #define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName
137
138
139 /**
140 Retrieves a pointer to a fixed PCD token buffer based on a token name.
141
142 Returns a pointer to the buffer for the token specified by TokenName.
143 If TokenName is not a valid token in the token space, then the module will not build.
144 If TokenName is not a feature flag, then the module will not build.
145
146 @param TokenName The name of the PCD token to retrieve a current value for.
147
148 @return A pointer to the buffer.
149
150 **/
151 #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)
152
153
154 /**
155 Retrieves an 8-bit binary patchable PCD token value based on a token name.
156
157 Returns the 8-bit value for the token specified by TokenName.
158 If TokenName is not a valid token in the token space, then the module will not build.
159 If TokenName is not a feature flag, then the module will not build.
160
161 @param TokenName The name of the PCD token to retrieve a current value for.
162
163 @return An 8-bit binary patchable PCD token value.
164
165 **/
166 #define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName
167
168 /**
169 Retrieves a 16-bit binary patchable PCD token value based on a token name.
170
171 Returns the 16-bit value for the token specified by TokenName.
172 If TokenName is not a valid token in the token space, then the module will not build.
173 If TokenName is not a feature flag, then the module will not build.
174
175 @param TokenName The name of the PCD token to retrieve a current value for.
176
177 @return A 16-bit binary patchable PCD token value.
178
179 **/
180 #define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName
181
182
183 /**
184 Retrieves a 32-bit binary patchable PCD token value based on a token name.
185
186 Returns the 32-bit value for the token specified by TokenName.
187 If TokenName is not a valid token in the token space, then the module will not build.
188 If TokenName is not a feature flag, then the module will not build.
189
190 @param TokenName The name of the PCD token to retrieve a current value for.
191
192 @return A 32-bit binary patchable PCD token value.
193
194 **/
195 #define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName
196
197
198 /**
199 Retrieves a 64-bit binary patchable PCD token value based on a token name.
200
201 Returns the 64-bit value for the token specified by TokenName.
202 If TokenName is not a valid token in the token space, then the module will not build.
203 If TokenName is not a feature flag, then the module will not build.
204
205 @param TokenName The name of the PCD token to retrieve a current value for.
206
207 @return A 64-bit binary patchable PCD token value.
208
209 **/
210 #define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName
211
212
213 /**
214 Retrieves a Boolean binary patchable PCD token value based on a token name.
215
216 Returns the Boolean value for the token specified by TokenName.
217 If TokenName is not a valid token in the token space, then the module will not build.
218 If TokenName is not a feature flag, then the module will not build.
219
220 @param TokenName The name of the PCD token to retrieve a current value for.
221
222 @return The Boolean value for the token.
223
224 **/
225 #define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName
226
227
228 /**
229 Retrieves a pointer to a binary patchable PCD token buffer based on a token name.
230
231 Returns a pointer to the buffer for the token specified by TokenName.
232 If TokenName is not a valid token in the token space, then the module will not build.
233 If TokenName is not a feature flag, then the module will not build.
234
235 @param TokenName The name of the PCD token to retrieve a current value for.
236
237 @return A pointer to the buffer for the token.
238
239 **/
240 #define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)
241
242
243 /**
244 Sets an 8-bit binary patchable PCD token value based on a token name.
245
246 Sets the 8-bit value for the token specified by TokenName. Value is returned.
247 If TokenName is not a valid token in the token space, then the module will not build.
248 If TokenName is not a feature flag, then the module will not build.
249
250 @param TokenName The name of the binary patchable PCD token to set the current value for.
251 @param Value The 8-bit value to set.
252
253 @return Value.
254
255 **/
256 #define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
257
258
259 /**
260 Sets a 16-bit binary patchable PCD token value based on a token name.
261
262 Sets the 16-bit value for the token specified by TokenName. Value is returned.
263 If TokenName is not a valid token in the token space, then the module will not build.
264 If TokenName is not a feature flag, then the module will not build.
265
266 @param TokenName The name of the binary patchable PCD token to set the current value for.
267 @param Value The 16-bit value to set.
268
269 @return Value.
270
271 **/
272 #define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
273
274
275 /**
276 Sets a 32-bit binary patchable PCD token value based on a token name.
277
278 Sets the 32-bit value for the token specified by TokenName. Value is returned.
279 If TokenName is not a valid token in the token space, then the module will not build.
280 If TokenName is not a feature flag, then the module will not build.
281
282 @param TokenName The name of the binary patchable PCD token to set the current value for.
283 @param Value The 32-bit value to set.
284
285 @return Value.
286
287 **/
288 #define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
289
290
291 /**
292 Sets a 64-bit binary patchable PCD token value based on a token name.
293
294 Sets the 64-bit value for the token specified by TokenName. Value is returned.
295 If TokenName is not a valid token in the token space, then the module will not build.
296 If TokenName is not a feature flag, then the module will not build.
297
298 @param TokenName The name of the binary patchable PCD token to set the current value for.
299 @param Value The 64-bit value to set.
300
301 @return Value.
302
303 **/
304 #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
305
306
307 /**
308 Sets a Boolean binary patchable PCD token value based on a token name.
309
310 Sets the Boolean value for the token specified by TokenName. Value is returned.
311 If TokenName is not a valid token in the token space, then the module will not build.
312 If TokenName is not a feature flag, then the module will not build.
313
314 @param TokenName The name of the binary patchable PCD token to set the current value for.
315 @param Value The boolean value to set.
316
317 @return Value.
318
319 **/
320 #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
321
322
323 /**
324 Sets a pointer to a binary patchable PCD token buffer based on a token name.
325
326 Sets the buffer for the token specified by TokenName. Buffer is returned.
327 If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer
328 to the maximum size supported by TokenName and return NULL to indicate that the set operation
329 was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be
330 set to the maximum size supported by TokenName and NULL must be returned.
331 If TokenName is not a valid token in the token space, then the module will not build.
332 If TokenName is not a feature flag, then the module will not build.
333
334 If SizeOfBuffer is NULL, then ASSERT().
335 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
336
337 @param TokenName The name of the binary patchable PCD token to set the current value for.
338 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
339 @param Buffer Pointer to the value to set.
340
341 @return Value.
342
343 **/
344 #define PatchPcdSetPtr(TokenName, Size, Buffer) \
345 LibPatchPcdSetPtr ( \
346 _gPcd_BinaryPatch_##TokenName, \
347 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
348 (Size), \
349 (Buffer) \
350 )
351
352 /**
353 Retrieves an 8-bit PCD token value based on a token name.
354
355 Returns the 8-bit value for the token specified by TokenName.
356 If TokenName is not a valid token in the token space, then the module will not build.
357
358 @param TokenName The name of the PCD token to retrieve a current value for.
359
360 @return 8-bit value for the token specified by TokenName.
361
362 **/
363 #define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName
364
365
366 /**
367 Retrieves a 16-bit PCD token value based on a token name.
368
369 Returns the 16-bit value for the token specified by TokenName.
370 If TokenName is not a valid token in the token space, then the module will not build.
371
372 @param TokenName The name of the PCD token to retrieve a current value for.
373
374 @return 16-bit value for the token specified by TokenName.
375
376 **/
377 #define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName
378
379
380 /**
381 Retrieves a 32-bit PCD token value based on a token name.
382
383 Returns the 32-bit value for the token specified by TokenName.
384 If TokenName is not a valid token in the token space, then the module will not build.
385
386 @param TokenName The name of the PCD token to retrieve a current value for.
387
388 @return 32-bit value for the token specified by TokenName.
389
390 **/
391 #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName
392
393
394 /**
395 Retrieves a 64-bit PCD token value based on a token name.
396
397 Returns the 64-bit value for the token specified by TokenName.
398 If TokenName is not a valid token in the token space, then the module will not build.
399
400 @param TokenName The name of the PCD token to retrieve a current value for.
401
402 @return 64-bit value for the token specified by TokenName.
403
404 **/
405 #define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName
406
407
408 /**
409 Retrieves a pointer to a PCD token buffer based on a token name.
410
411 Returns a pointer to the buffer for the token specified by TokenName.
412 If TokenName is not a valid token in the token space, then the module will not build.
413
414 @param TokenName The name of the PCD token to retrieve a current value for.
415
416 @return A pointer to the buffer.
417
418 **/
419 #define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName
420
421
422 /**
423 Retrieves a Boolean PCD token value based on a token name.
424
425 Returns the Boolean value for the token specified by TokenName.
426 If TokenName is not a valid token in the token space, then the module will not build.
427
428 @param TokenName The name of the PCD token to retrieve a current value for.
429
430 @return A Boolean PCD token value.
431
432 **/
433 #define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName
434
435
436 /**
437 Sets an 8-bit PCD token value based on a token name.
438
439 Sets the 8-bit value for the token specified by TokenName. Value is returned.
440 If TokenName is not a valid token in the token space, then the module will not build.
441
442 @param TokenName The name of the PCD token to retrieve a current value for.
443 @param Value The 8-bit value to set.
444
445 @return Value.
446
447 **/
448 #define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))
449
450
451 /**
452 Sets a 16-bit PCD token value based on a token name.
453
454 Sets the 16-bit value for the token specified by TokenName. Value is returned.
455 If TokenName is not a valid token in the token space, then the module will not build.
456
457 @param TokenName The name of the PCD token to retrieve a current value for.
458 @param Value The 16-bit value to set.
459
460 @return Value.
461
462 **/
463 #define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))
464
465
466 /**
467 Sets a 32-bit PCD token value based on a token name.
468
469 Sets the 32-bit value for the token specified by TokenName. Value is returned.
470 If TokenName is not a valid token in the token space, then the module will not build.
471
472 @param TokenName The name of the PCD token to retrieve a current value for.
473 @param Value The 32-bit value to set.
474
475 @return Value.
476
477 **/
478 #define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))
479
480
481 /**
482 Sets a 64-bit PCD token value based on a token name.
483
484 Sets the 64-bit value for the token specified by TokenName. Value is returned.
485 If TokenName is not a valid token in the token space, then the module will not build.
486
487 @param TokenName The name of the PCD token to retrieve a current value for.
488 @param Value The 64-bit value to set.
489
490 @return Value.
491
492 **/
493 #define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))
494
495
496 /**
497 Sets a pointer to a PCD token buffer based on a token name.
498
499 Sets the buffer for the token specified by TokenName. Buffer is returned.
500 If SizeOfBuffer is greater than the maximum size supported by TokenName,
501 then set SizeOfBuffer to the maximum size supported by TokenName and return NULL
502 to indicate that the set operation was not actually performed. If SizeOfBuffer
503 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported
504 by TokenName and NULL must be returned.
505 If TokenName is not a valid token in the token space, then the module will not build.
506
507 If SizeOfBuffer is NULL, then ASSERT().
508 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
509
510 @param TokenName The name of the PCD token to set the current value for.
511 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
512 @param Buffer A pointer to the buffer to set.
513
514 @return Buffer.
515
516 **/
517 #define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \
518 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))
519
520 /**
521 Sets a Boolean PCD token value based on a token name.
522
523 Sets the Boolean value for the token specified by TokenName. Value is returned.
524 If TokenName is not a valid token in the token space, then the module will not build.
525
526 @param TokenName The name of the PCD token to set the current value for.
527 @param Buffer The Boolean value to set.
528
529 @return Value.
530
531 **/
532 #define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))
533
534
535 /**
536 Retrieves an 8-bit PCD token value based on a GUID and a token name.
537
538 Returns the 8-bit value for the token specified by Guid and TokenName.
539 If TokenName is not a valid token in the token space specified by Guid,
540 then the module will not build.
541
542 If Guid is NULL, then ASSERT().
543
544 @param Guid Pointer to a 128-bit unique value that designates
545 which namespace to retrieve a value from.
546 @param TokenName The name of the PCD token to retrieve a current value for.
547
548 @return An 8-bit PCD token value.
549
550 **/
551 #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), _PCD_TOKEN_##TokenName)
552
553
554 /**
555 Retrieves a 16-bit PCD token value based on a GUID and a token name.
556
557 Returns the 16-bit value for the token specified by Guid and TokenName.
558 If TokenName is not a valid token in the token space specified by Guid,
559 then the module will not build.
560
561 If Guid is NULL, then ASSERT().
562
563 @param Guid Pointer to a 128-bit unique value that designates
564 which namespace to retrieve a value from.
565 @param TokenName The name of the PCD token to retrieve a current value for.
566
567 @return A 16-bit PCD token value.
568
569 **/
570 #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), _PCD_TOKEN_##TokenName)
571
572
573 /**
574 Retrieves a 32-bit PCD token value based on a GUID and a token name.
575
576 Returns the 32-bit value for the token specified by Guid and TokenName.
577 If TokenName is not a valid token in the token space specified by Guid,
578 then the module will not build.
579
580 If Guid is NULL, then ASSERT().
581
582 @param Guid Pointer to a 128-bit unique value that designates
583 which namespace to retrieve a value from.
584 @param TokenName The name of the PCD token to retrieve a current value for.
585
586 @return A 32-bit PCD token value.
587
588 **/
589 #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), _PCD_TOKEN_##TokenName)
590
591
592 /**
593 Retrieves a 64-bit PCD token value based on a GUID and a token name.
594
595 Returns the 64-bit value for the token specified by Guid and TokenName.
596 If TokenName is not a valid token in the token space specified by Guid,
597 then the module will not build.
598
599 If Guid is NULL, then ASSERT().
600
601 @param Guid Pointer to a 128-bit unique value that designates
602 which namespace to retrieve a value from.
603 @param TokenName The name of the PCD token to retrieve a current value for.
604
605 @return A 64-bit PCD token value.
606
607 **/
608 #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), _PCD_TOKEN_##TokenName)
609
610
611 /**
612 Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
613
614 Returns a pointer to the buffer for the token specified by Guid and TokenName.
615 If TokenName is not a valid token in the token space specified by Guid,
616 then the module will not build.
617
618 If Guid is NULL, then ASSERT().
619
620 @param Guid Pointer to a 128-bit unique value that designates
621 which namespace to retrieve a value from.
622 @param TokenName The name of the PCD token to retrieve a current value for.
623
624 @return A pointer to a PCD token buffer.
625
626 **/
627 #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), _PCD_TOKEN_##TokenName)
628
629
630 /**
631 Retrieves a Boolean PCD token value based on a GUID and a token name.
632
633 Returns the Boolean value for the token specified by Guid and TokenName.
634 If TokenName is not a valid token in the token space specified by Guid,
635 then the module will not build.
636
637 If Guid is NULL, then ASSERT().
638
639 @param Guid Pointer to a 128-bit unique value that designates
640 which namespace to retrieve a value from.
641 @param TokenName The name of the PCD token to retrieve a current value for.
642
643 @return A Boolean PCD token value.
644
645 **/
646 #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), _PCD_TOKEN_##TokenName)
647
648
649 /**
650 Sets an 8-bit PCD token value based on a GUID and a token name.
651
652 Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
653 If TokenName is not a valid token in the token space specified by Guid,
654 then the module will not build.
655
656 If Guid is NULL, then ASSERT().
657
658 @param Guid Pointer to a 128-bit unique value that designates
659 which namespace to retrieve a value from.
660 @param TokenName The name of the PCD token to set the current value for.
661 @param Value The 8-bit value to set.
662
663 @return Value.
664
665 **/
666 #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), _PCD_TOKEN_##TokenName, (Value))
667
668
669 /**
670 Sets a 16-bit PCD token value based on a GUID and a token name.
671
672 Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
673 If TokenName is not a valid token in the token space specified by Guid,
674 then the module will not build.
675
676 If Guid is NULL, then ASSERT().
677
678 @param Guid Pointer to a 128-bit unique value that designates
679 which namespace to retrieve a value from.
680 @param TokenName The name of the PCD token to set the current value for.
681 @param Value The 16-bit value to set.
682
683 @return Value.
684
685 **/
686 #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), _PCD_TOKEN_##TokenName, (Value))
687
688
689 /**
690 Sets a 32-bit PCD token value based on a GUID and a token name.
691
692 Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
693 If TokenName is not a valid token in the token space specified by Guid,
694 then the module will not build.
695
696 If Guid is NULL, then ASSERT().
697
698 @param Guid Pointer to a 128-bit unique value that designates
699 which namespace to retrieve a value from.
700 @param TokenName The name of the PCD token to set the current value for.
701 @param Value The 32-bit value to set.
702
703 @return Value.
704
705 **/
706 #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), _PCD_TOKEN_##TokenName, (Value))
707
708
709 /**
710 Sets a 64-bit PCD token value based on a GUID and a token name.
711
712 Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
713 If TokenName is not a valid token in the token space specified by Guid,
714 then the module will not build.
715
716 If Guid is NULL, then ASSERT().
717
718 @param Guid Pointer to a 128-bit unique value that designates
719 which namespace to retrieve a value from.
720 @param TokenName The name of the PCD token to set the current value for.
721 @param Value The 64-bit value to set.
722
723 @return Value.
724
725 **/
726 #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), _PCD_TOKEN_##TokenName, (Value))
727
728
729 /**
730 Sets a pointer to a PCD token buffer based on a GUID and a token name.
731
732 Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
733 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
734 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
735 NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
736 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
737 Guid and TokenName and NULL must be returned.
738 If TokenName is not a valid token in the token space specified by Guid,
739 then the module will not build.
740
741 If Guid is NULL, then ASSERT().
742 If SizeOfBuffer is NULL, then ASSERT().
743 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
744
745 @param Guid Pointer to a 128-bit unique value that designates
746 which namespace to retrieve a value from.
747 @param TokenName The name of the PCD token to set the current value for.
748 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
749 @param Value Pointer to the buffer to set.
750
751 @return Buffer.
752
753 **/
754 #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
755 LibPcdSetExPtr ((Guid), _PCD_TOKEN_##TokenName, (SizeOfBuffer), (Buffer))
756
757
758 /**
759 Sets a Boolean PCD token value based on a GUID and a token name.
760
761 Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
762 If TokenName is not a valid token in the token space specified by Guid,
763 then the module will not build.
764
765 If Guid is NULL, then ASSERT().
766
767 @param Guid Pointer to a 128-bit unique value that designates
768 which namespace to retrieve a value from.
769 @param TokenName The name of the PCD token to set the current value for.
770 @param Value The Boolean value to set.
771
772 @return Value.
773
774 **/
775 #define PcdSetExBool(Guid, TokenName, Value) \
776 LibPcdSetExBool((Guid), _PCD_TOKEN_##TokenName, (Value))
777
778
779 /**
780 This function provides a means by which SKU support can be established in the PCD infrastructure.
781
782 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
783
784 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
785 set values associated with a PCD token.
786
787 If SkuId >= 0x100, then ASSERT().
788
789 @return Return the SKU ID that just be set.
790
791 **/
792 UINTN
793 EFIAPI
794 LibPcdSetSku (
795 IN UINTN SkuId
796 );
797
798
799 /**
800 This function provides a means by which to retrieve a value for a given PCD token.
801
802 Returns the 8-bit value for the token specified by TokenNumber.
803
804 @param[in] TokenNumber The PCD token number to retrieve a current value for.
805
806 @return Returns the 8-bit value for the token specified by TokenNumber.
807
808 **/
809 UINT8
810 EFIAPI
811 LibPcdGet8 (
812 IN UINTN TokenNumber
813 );
814
815
816 /**
817 This function provides a means by which to retrieve a value for a given PCD token.
818
819 Returns the 16-bit value for the token specified by TokenNumber.
820
821 @param[in] TokenNumber The PCD token number to retrieve a current value for.
822
823 @return Returns the 16-bit value for the token specified by TokenNumber.
824
825 **/
826 UINT16
827 EFIAPI
828 LibPcdGet16 (
829 IN UINTN TokenNumber
830 );
831
832
833 /**
834 This function provides a means by which to retrieve a value for a given PCD token.
835
836 Returns the 32-bit value for the token specified by TokenNumber.
837
838 @param[in] TokenNumber The PCD token number to retrieve a current value for.
839
840 @return Returns the 32-bit value for the token specified by TokenNumber.
841
842 **/
843 UINT32
844 EFIAPI
845 LibPcdGet32 (
846 IN UINTN TokenNumber
847 );
848
849
850 /**
851 This function provides a means by which to retrieve a value for a given PCD token.
852
853 Returns the 64-bit value for the token specified by TokenNumber.
854
855 @param[in] TokenNumber The PCD token number to retrieve a current value for.
856
857 @return Returns the 64-bit value for the token specified by TokenNumber.
858
859 **/
860 UINT64
861 EFIAPI
862 LibPcdGet64 (
863 IN UINTN TokenNumber
864 );
865
866
867 /**
868 This function provides a means by which to retrieve a value for a given PCD token.
869
870 Returns the pointer to the buffer of the token specified by TokenNumber.
871
872 @param[in] TokenNumber The PCD token number to retrieve a current value for.
873
874 @return Returns the pointer to the token specified by TokenNumber.
875
876 **/
877 VOID *
878 EFIAPI
879 LibPcdGetPtr (
880 IN UINTN TokenNumber
881 );
882
883
884 /**
885 This function provides a means by which to retrieve a value for a given PCD token.
886
887 Returns the Boolean value of the token specified by TokenNumber.
888
889 @param[in] TokenNumber The PCD token number to retrieve a current value for.
890
891 @return Returns the Boolean value of the token specified by TokenNumber.
892
893 **/
894 BOOLEAN
895 EFIAPI
896 LibPcdGetBool (
897 IN UINTN TokenNumber
898 );
899
900
901 /**
902 This function provides a means by which to retrieve the size of a given PCD token.
903
904 @param[in] TokenNumber The PCD token number to retrieve a current value for.
905
906 @return Returns the size of the token specified by TokenNumber.
907
908 **/
909 UINTN
910 EFIAPI
911 LibPcdGetSize (
912 IN UINTN TokenNumber
913 );
914
915
916 /**
917 This function provides a means by which to retrieve a value for a given PCD token.
918
919 Returns the 8-bit value for the token specified by TokenNumber and Guid.
920
921 If Guid is NULL, then ASSERT().
922
923 @param[in] Guid Pointer to a 128-bit unique value that designates
924 which namespace to retrieve a value from.
925 @param[in] TokenNumber The PCD token number to retrieve a current value for.
926
927 @return Return the UINT8.
928
929 **/
930 UINT8
931 EFIAPI
932 LibPcdGetEx8 (
933 IN CONST GUID *Guid,
934 IN UINTN TokenNumber
935 );
936
937
938 /**
939 This function provides a means by which to retrieve a value for a given PCD token.
940
941 Returns the 16-bit value for the token specified by TokenNumber and Guid.
942
943 If Guid is NULL, then ASSERT().
944
945 @param[in] Guid Pointer to a 128-bit unique value that designates
946 which namespace to retrieve a value from.
947 @param[in] TokenNumber The PCD token number to retrieve a current value for.
948
949 @return Return the UINT16.
950
951 **/
952 UINT16
953 EFIAPI
954 LibPcdGetEx16 (
955 IN CONST GUID *Guid,
956 IN UINTN TokenNumber
957 );
958
959
960 /**
961 Returns the 32-bit value for the token specified by TokenNumber and Guid.
962 If Guid is NULL, then ASSERT().
963
964 @param[in] Guid Pointer to a 128-bit unique value that designates
965 which namespace to retrieve a value from.
966 @param[in] TokenNumber The PCD token number to retrieve a current value for.
967
968 @return Return the UINT32.
969
970 **/
971 UINT32
972 EFIAPI
973 LibPcdGetEx32 (
974 IN CONST GUID *Guid,
975 IN UINTN TokenNumber
976 );
977
978
979 /**
980 This function provides a means by which to retrieve a value for a given PCD token.
981
982 Returns the 64-bit value for the token specified by TokenNumber and Guid.
983
984 If Guid is NULL, then ASSERT().
985
986 @param[in] Guid Pointer to a 128-bit unique value that designates
987 which namespace to retrieve a value from.
988 @param[in] TokenNumber The PCD token number to retrieve a current value for.
989
990 @return Return the UINT64.
991
992 **/
993 UINT64
994 EFIAPI
995 LibPcdGetEx64 (
996 IN CONST GUID *Guid,
997 IN UINTN TokenNumber
998 );
999
1000
1001 /**
1002 This function provides a means by which to retrieve a value for a given PCD token.
1003
1004 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
1005
1006 If Guid is NULL, then ASSERT().
1007
1008 @param[in] Guid Pointer to a 128-bit unique value that designates
1009 which namespace to retrieve a value from.
1010 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1011
1012 @return Return the VOID* pointer.
1013
1014 **/
1015 VOID *
1016 EFIAPI
1017 LibPcdGetExPtr (
1018 IN CONST GUID *Guid,
1019 IN UINTN TokenNumber
1020 );
1021
1022
1023 /**
1024 This function provides a means by which to retrieve a value for a given PCD token.
1025
1026 Returns the Boolean value of the token specified by TokenNumber and Guid.
1027
1028 If Guid is NULL, then ASSERT().
1029
1030 @param[in] Guid Pointer to a 128-bit unique value that designates
1031 which namespace to retrieve a value from.
1032 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1033
1034 @return Return the BOOLEAN.
1035
1036 **/
1037 BOOLEAN
1038 EFIAPI
1039 LibPcdGetExBool (
1040 IN CONST GUID *Guid,
1041 IN UINTN TokenNumber
1042 );
1043
1044
1045 /**
1046 This function provides a means by which to retrieve the size of a given PCD token.
1047
1048 Returns the size of the token specified by TokenNumber and Guid.
1049
1050 If Guid is NULL, then ASSERT().
1051
1052 @param[in] Guid Pointer to a 128-bit unique value that designates
1053 which namespace to retrieve a value from.
1054 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1055
1056 @return Return the size.
1057
1058 **/
1059 UINTN
1060 EFIAPI
1061 LibPcdGetExSize (
1062 IN CONST GUID *Guid,
1063 IN UINTN TokenNumber
1064 );
1065
1066
1067 /**
1068 This function provides a means by which to set a value for a given PCD token.
1069
1070 Sets the 8-bit value for the token specified by TokenNumber
1071 to the value specified by Value. Value is returned.
1072
1073 @param[in] TokenNumber The PCD token number to set a current value for.
1074 @param[in] Value The 8-bit value to set.
1075
1076 @return Return the value been set.
1077
1078 **/
1079 UINT8
1080 EFIAPI
1081 LibPcdSet8 (
1082 IN UINTN TokenNumber,
1083 IN UINT8 Value
1084 );
1085
1086
1087 /**
1088 This function provides a means by which to set a value for a given PCD token.
1089
1090 Sets the 16-bit value for the token specified by TokenNumber
1091 to the value specified by Value. Value is returned.
1092
1093 @param[in] TokenNumber The PCD token number to set a current value for.
1094 @param[in] Value The 16-bit value to set.
1095
1096 @return Return the value been set.
1097
1098 **/
1099 UINT16
1100 EFIAPI
1101 LibPcdSet16 (
1102 IN UINTN TokenNumber,
1103 IN UINT16 Value
1104 );
1105
1106
1107 /**
1108 This function provides a means by which to set a value for a given PCD token.
1109
1110 Sets the 32-bit value for the token specified by TokenNumber
1111 to the value specified by Value. Value is returned.
1112
1113 @param[in] TokenNumber The PCD token number to set a current value for.
1114 @param[in] Value The 32-bit value to set.
1115
1116 @return Return the value been set.
1117
1118 **/
1119 UINT32
1120 EFIAPI
1121 LibPcdSet32 (
1122 IN UINTN TokenNumber,
1123 IN UINT32 Value
1124 );
1125
1126
1127 /**
1128 This function provides a means by which to set a value for a given PCD token.
1129
1130 Sets the 64-bit value for the token specified by TokenNumber
1131 to the value specified by Value. Value is returned.
1132
1133 @param[in] TokenNumber The PCD token number to set a current value for.
1134 @param[in] Value The 64-bit value to set.
1135
1136 @return Return the value been set.
1137
1138 **/
1139 UINT64
1140 EFIAPI
1141 LibPcdSet64 (
1142 IN UINTN TokenNumber,
1143 IN UINT64 Value
1144 );
1145
1146
1147 /**
1148 This function provides a means by which to set a value for a given PCD token.
1149
1150 Sets a buffer for the token specified by TokenNumber to the value
1151 specified by Buffer and SizeOfBuffer. Buffer is returned.
1152 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
1153 then set SizeOfBuffer to the maximum size supported by TokenNumber and
1154 return NULL to indicate that the set operation was not actually performed.
1155
1156 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1157 maximum size supported by TokenName and NULL must be returned.
1158
1159 If SizeOfBuffer is NULL, then ASSERT().
1160 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1161
1162 @param[in] TokenNumber The PCD token number to set a current value for.
1163 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1164 @param[in] Buffer A pointer to the buffer to set.
1165
1166 @return Return the pointer for the buffer been set.
1167
1168 **/
1169 VOID *
1170 EFIAPI
1171 LibPcdSetPtr (
1172 IN UINTN TokenNumber,
1173 IN OUT UINTN *SizeOfBuffer,
1174 IN CONST VOID *Buffer
1175 );
1176
1177
1178 /**
1179 This function provides a means by which to set a value for a given PCD token.
1180
1181 Sets the Boolean value for the token specified by TokenNumber
1182 to the value specified by Value. Value is returned.
1183
1184 @param[in] TokenNumber The PCD token number to set a current value for.
1185 @param[in] Value The boolean value to set.
1186
1187 @return Return the value been set.
1188
1189 **/
1190 BOOLEAN
1191 EFIAPI
1192 LibPcdSetBool (
1193 IN UINTN TokenNumber,
1194 IN BOOLEAN Value
1195 );
1196
1197
1198 /**
1199 This function provides a means by which to set a value for a given PCD token.
1200
1201 Sets the 8-bit value for the token specified by TokenNumber and
1202 Guid to the value specified by Value. Value is returned.
1203
1204 If Guid is NULL, then ASSERT().
1205
1206 @param[in] Guid Pointer to a 128-bit unique value that
1207 designates which namespace to set a value from.
1208 @param[in] TokenNumber The PCD token number to set a current value for.
1209 @param[in] Value The 8-bit value to set.
1210
1211 @return Return the value been set.
1212
1213 **/
1214 UINT8
1215 EFIAPI
1216 LibPcdSetEx8 (
1217 IN CONST GUID *Guid,
1218 IN UINTN TokenNumber,
1219 IN UINT8 Value
1220 );
1221
1222
1223 /**
1224 This function provides a means by which to set a value for a given PCD token.
1225
1226 Sets the 16-bit value for the token specified by TokenNumber and
1227 Guid to the value specified by Value. Value is returned.
1228
1229 If Guid is NULL, then ASSERT().
1230
1231 @param[in] Guid Pointer to a 128-bit unique value that
1232 designates which namespace to set a value from.
1233 @param[in] TokenNumber The PCD token number to set a current value for.
1234 @param[in] Value The 16-bit value to set.
1235
1236 @return Return the value been set.
1237
1238 **/
1239 UINT16
1240 EFIAPI
1241 LibPcdSetEx16 (
1242 IN CONST GUID *Guid,
1243 IN UINTN TokenNumber,
1244 IN UINT16 Value
1245 );
1246
1247
1248 /**
1249 This function provides a means by which to set a value for a given PCD token.
1250
1251 Sets the 32-bit value for the token specified by TokenNumber and
1252 Guid to the value specified by Value. Value is returned.
1253
1254 If Guid is NULL, then ASSERT().
1255
1256 @param[in] Guid Pointer to a 128-bit unique value that
1257 designates which namespace to set a value from.
1258 @param[in] TokenNumber The PCD token number to set a current value for.
1259 @param[in] Value The 32-bit value to set.
1260
1261 @return Return the value been set.
1262
1263 **/
1264 UINT32
1265 EFIAPI
1266 LibPcdSetEx32 (
1267 IN CONST GUID *Guid,
1268 IN UINTN TokenNumber,
1269 IN UINT32 Value
1270 );
1271
1272
1273 /**
1274 This function provides a means by which to set a value for a given PCD token.
1275
1276 Sets the 64-bit value for the token specified by TokenNumber and
1277 Guid to the value specified by Value. Value is returned.
1278 If Guid is NULL, then ASSERT().
1279
1280 @param[in] Guid Pointer to a 128-bit unique value that
1281 designates which namespace to set a value from.
1282 @param[in] TokenNumber The PCD token number to set a current value for.
1283 @param[in] Value The 64-bit value to set.
1284
1285 @return Return the value been set.
1286
1287 **/
1288 UINT64
1289 EFIAPI
1290 LibPcdSetEx64 (
1291 IN CONST GUID *Guid,
1292 IN UINTN TokenNumber,
1293 IN UINT64 Value
1294 );
1295
1296
1297 /**
1298 This function provides a means by which to set a value for a given PCD token.
1299
1300 Sets a buffer for the token specified by TokenNumber to the value specified by
1301 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1302 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
1303 supported by TokenNumber and return NULL to indicate that the set operation
1304 was not actually performed.
1305
1306 If Guid is NULL, then ASSERT().
1307 If SizeOfBuffer is NULL, then ASSERT().
1308 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1309
1310 @param[in] Guid Pointer to a 128-bit unique value that
1311 designates which namespace to set a value from.
1312 @param[in] TokenNumber The PCD token number to set a current value for.
1313 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1314 @param[in] Buffer A pointer to the buffer to set.
1315
1316 @return Return the pinter to the buffer been set.
1317
1318 **/
1319 VOID *
1320 EFIAPI
1321 LibPcdSetExPtr (
1322 IN CONST GUID *Guid,
1323 IN UINTN TokenNumber,
1324 IN OUT UINTN *SizeOfBuffer,
1325 IN VOID *Buffer
1326 );
1327
1328
1329 /**
1330 This function provides a means by which to set a value for a given PCD token.
1331
1332 Sets the Boolean value for the token specified by TokenNumber and
1333 Guid to the value specified by Value. Value is returned.
1334
1335 If Guid is NULL, then ASSERT().
1336
1337 @param[in] Guid Pointer to a 128-bit unique value that
1338 designates which namespace to set a value from.
1339 @param[in] TokenNumber The PCD token number to set a current value for.
1340 @param[in] Value The Boolean value to set.
1341
1342 @return Return the value been set.
1343
1344 **/
1345 BOOLEAN
1346 EFIAPI
1347 LibPcdSetExBool (
1348 IN CONST GUID *Guid,
1349 IN UINTN TokenNumber,
1350 IN BOOLEAN Value
1351 );
1352
1353
1354 /**
1355 When the token specified by TokenNumber and Guid is set,
1356 then notification function specified by NotificationFunction is called.
1357 If Guid is NULL, then the default token space is used.
1358 If NotificationFunction is NULL, then ASSERT().
1359
1360 This notification function serves two purposes. Firstly, it notifies the module which
1361 did the registration that the value of this PCD token has been set. Secondly,
1362 it provides a mechanism for the module which did the registration to intercept
1363 the set operation and override the value been set if necessary. After the invocation
1364 of the callback function, TokenData will be used by PCD service PEIM or driver to
1365 modify the internal data in PCD database.
1366
1367
1368 @param[in] CallBackGuid The PCD token GUID being set.
1369 @param[in] CallBackToken The PCD token number being set.
1370 @param[in, out] TokenData A pointer to the token data being set.
1371 @param[in] TokenDataSize The size, in bytes, of the data being set.
1372
1373 **/
1374 typedef
1375 VOID
1376 (EFIAPI *PCD_CALLBACK)(
1377 IN CONST GUID *CallBackGuid, OPTIONAL
1378 IN UINTN CallBackToken,
1379 IN OUT VOID *TokenData,
1380 IN UINTN TokenDataSize
1381 );
1382
1383
1384 /**
1385 Set up a notification function that is called when a specified token is set.
1386
1387 When the token specified by TokenNumber and Guid is set,
1388 then notification function specified by NotificationFunction is called.
1389 If Guid is NULL, then the default token space is used.
1390
1391 If NotificationFunction is NULL, then ASSERT().
1392
1393 @param[in] Guid Pointer to a 128-bit unique value that designates which
1394 namespace to set a value from. If NULL, then the default
1395 token space is used.
1396 @param[in] TokenNumber The PCD token number to monitor.
1397 @param[in] NotificationFunction The function to call when the token
1398 specified by Guid and TokenNumber is set.
1399
1400 **/
1401 VOID
1402 EFIAPI
1403 LibPcdCallbackOnSet (
1404 IN CONST GUID *Guid, OPTIONAL
1405 IN UINTN TokenNumber,
1406 IN PCD_CALLBACK NotificationFunction
1407 );
1408
1409
1410 /**
1411 Disable a notification function that was established with LibPcdCallbackonSet().
1412
1413 Disable a notification function that was previously established with LibPcdCallbackOnSet().
1414
1415 If NotificationFunction is NULL, then ASSERT().
1416 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1417 and NotificationFunction, then ASSERT().
1418
1419 @param[in] Guid Specify the GUID token space.
1420 @param[in] TokenNumber Specify the token number.
1421 @param[in] NotificationFunction The callback function to be unregistered.
1422
1423 **/
1424 VOID
1425 EFIAPI
1426 LibPcdCancelCallback (
1427 IN CONST GUID *Guid, OPTIONAL
1428 IN UINTN TokenNumber,
1429 IN PCD_CALLBACK NotificationFunction
1430 );
1431
1432
1433 /**
1434 Retrieves the next token in a token space.
1435
1436 Retrieves the next PCD token number from the token space specified by Guid.
1437 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1438 then the first token number is returned. Otherwise, the token number that
1439 follows TokenNumber in the token space is returned. If TokenNumber is the last
1440 token number in the token space, then 0 is returned.
1441
1442 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1443
1444 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace
1445 to set a value from. If NULL, then the default token space is used.
1446 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1447 token number.
1448
1449 @return The next valid token number.
1450
1451 **/
1452 UINTN
1453 EFIAPI
1454 LibPcdGetNextToken (
1455 IN CONST GUID *Guid, OPTIONAL
1456 IN UINTN TokenNumber
1457 );
1458
1459
1460
1461 /**
1462 Used to retrieve the list of available PCD token space GUIDs.
1463
1464 Retrieves the next PCD token space from a token space specified by Guid.
1465 Guid of NULL is reserved to mark the default local token namespace on the current
1466 platform. If Guid is NULL, then the GUID of the first non-local token space of the
1467 current platform is returned. If Guid is the last non-local token space,
1468 then NULL is returned.
1469
1470 If Guid is not NULL and is not a valid token space in the current platform, then ASSERT().
1471
1472
1473
1474 @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace
1475 to start the search.
1476
1477 @return The next valid token namespace.
1478
1479 **/
1480 GUID *
1481 EFIAPI
1482 LibPcdGetNextTokenSpace (
1483 IN CONST GUID *TokenSpaceGuid
1484 );
1485
1486
1487 /**
1488 Sets a value of a patchable PCD entry that is type pointer.
1489
1490 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
1491 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1492 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
1493 NULL to indicate that the set operation was not actually performed.
1494 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1495 MaximumDatumSize and NULL must be returned.
1496
1497 If PatchVariable is NULL, then ASSERT().
1498 If SizeOfBuffer is NULL, then ASSERT().
1499 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1500
1501 @param[in] PatchVariable A pointer to the global variable in a module that is
1502 the target of the set operation.
1503 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1504 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1505 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1506
1507 @return Return the pointer to the buffer been set.
1508
1509 **/
1510 VOID *
1511 EFIAPI
1512 LibPatchPcdSetPtr (
1513 IN VOID *PatchVariable,
1514 IN UINTN MaximumDatumSize,
1515 IN OUT UINTN *SizeOfBuffer,
1516 IN CONST VOID *Buffer
1517 );
1518
1519 #endif