]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/PcdLib.h
MdePkg and MdeModulePkg Pcd: Add the new EFI_GET_PCD_INFO_PROTOCOL and EFI_GET_PCD_IN...
[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 a PCD usage macro interface for all PCD types.
5 It should be included in any module that uses PCD. If a module uses dynamic/dynamicex
6 PCD, module should be linked to a PEIM/DXE library instance to access that PCD.
7 If a module uses PatchableInModule type PCD, it also needs the library instance to produce
8 LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is
9 translated to a variable or macro that 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 - 2013, Intel Corporation. All rights reserved.<BR>
18 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 Return the Value that was set.
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 Return the Value that was set.
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 Return the Value that was set.
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 Return the Value that was set.
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 Return the Value that was set.
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 Return the pointer to the Buffer that was set.
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 Return the Value that was set.
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 Return the Value that was set.
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 Return the Value that was set.
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 Return the Value that was set.
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 Return the pointer to the Buffer that was set.
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 Return the Value that was set.
530
531 **/
532 #define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))
533
534
535 /**
536 Retrieves a token number based on a GUID and a token name.
537
538 Returns the token number for the token specified by Guid and TokenName.
539
540 @param Guid Pointer to a 128-bit unique value that designates
541 which namespace to retrieve a value from.
542 @param TokenName The name of the PCD token to retrieve a current value for.
543
544 @return Return the token number.
545
546 **/
547 #define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid)
548
549 /**
550 Retrieves an 8-bit PCD token value based on a GUID and a token name.
551
552 Returns the 8-bit value for the token specified by Guid and TokenName.
553 If TokenName is not a valid token in the token space specified by Guid,
554 then the module will not build.
555
556 If Guid is NULL, then ASSERT().
557
558 @param Guid Pointer to a 128-bit unique value that designates
559 which namespace to retrieve a value from.
560 @param TokenName The name of the PCD token to retrieve a current value for.
561
562 @return An 8-bit PCD token value.
563
564 **/
565 #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
566
567 /**
568 Retrieves a 16-bit PCD token value based on a GUID and a token name.
569
570 Returns the 16-bit value for the token specified by Guid and TokenName.
571 If TokenName is not a valid token in the token space specified by Guid,
572 then the module will not build.
573
574 If Guid is NULL, then ASSERT().
575
576 @param Guid Pointer to a 128-bit unique value that designates
577 which namespace to retrieve a value from.
578 @param TokenName The name of the PCD token to retrieve a current value for.
579
580 @return A 16-bit PCD token value.
581
582 **/
583 #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
584
585
586 /**
587 Retrieves a 32-bit PCD token value based on a GUID and a token name.
588
589 Returns the 32-bit value for the token specified by Guid and TokenName.
590 If TokenName is not a valid token in the token space specified by Guid,
591 then the module will not build.
592
593 If Guid is NULL, then ASSERT().
594
595 @param Guid Pointer to a 128-bit unique value that designates
596 which namespace to retrieve a value from.
597 @param TokenName The name of the PCD token to retrieve a current value for.
598
599 @return A 32-bit PCD token value.
600
601 **/
602 #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
603
604
605 /**
606 Retrieves a 64-bit PCD token value based on a GUID and a token name.
607
608 Returns the 64-bit value for the token specified by Guid and TokenName.
609 If TokenName is not a valid token in the token space specified by Guid,
610 then the module will not build.
611
612 If Guid is NULL, then ASSERT().
613
614 @param Guid Pointer to a 128-bit unique value that designates
615 which namespace to retrieve a value from.
616 @param TokenName The name of the PCD token to retrieve a current value for.
617
618 @return A 64-bit PCD token value.
619
620 **/
621 #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
622
623
624 /**
625 Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
626
627 Returns a pointer to the buffer for the token specified by Guid and TokenName.
628 If TokenName is not a valid token in the token space specified by Guid,
629 then the module will not build.
630
631 If Guid is NULL, then ASSERT().
632
633 @param Guid Pointer to a 128-bit unique value that designates
634 which namespace to retrieve a value from.
635 @param TokenName The name of the PCD token to retrieve a current value for.
636
637 @return A pointer to a PCD token buffer.
638
639 **/
640 #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
641
642
643 /**
644 Retrieves a Boolean PCD token value based on a GUID and a token name.
645
646 Returns the Boolean value for the token specified by Guid and TokenName.
647 If TokenName is not a valid token in the token space specified by Guid,
648 then the module will not build.
649
650 If Guid is NULL, then ASSERT().
651
652 @param Guid Pointer to a 128-bit unique value that designates
653 which namespace to retrieve a value from.
654 @param TokenName The name of the PCD token to retrieve a current value for.
655
656 @return A Boolean PCD token value.
657
658 **/
659 #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))
660
661
662 /**
663 Sets an 8-bit PCD token value based on a GUID and a token name.
664
665 Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
666 If TokenName is not a valid token in the token space specified by Guid,
667 then the module will not build.
668
669 If Guid is NULL, then ASSERT().
670
671 @param Guid Pointer to a 128-bit unique value that designates
672 which namespace to retrieve a value from.
673 @param TokenName The name of the PCD token to set the current value for.
674 @param Value The 8-bit value to set.
675
676 @return Return the Value that was set.
677
678 **/
679 #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
680
681
682 /**
683 Sets a 16-bit PCD token value based on a GUID and a token name.
684
685 Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
686 If TokenName is not a valid token in the token space specified by Guid,
687 then the module will not build.
688
689 If Guid is NULL, then ASSERT().
690
691 @param Guid Pointer to a 128-bit unique value that designates
692 which namespace to retrieve a value from.
693 @param TokenName The name of the PCD token to set the current value for.
694 @param Value The 16-bit value to set.
695
696 @return Return the Value that was set.
697
698 **/
699 #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
700
701
702 /**
703 Sets a 32-bit PCD token value based on a GUID and a token name.
704
705 Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
706 If TokenName is not a valid token in the token space specified by Guid,
707 then the module will not build.
708
709 If Guid is NULL, then ASSERT().
710
711 @param Guid Pointer to a 128-bit unique value that designates
712 which namespace to retrieve a value from.
713 @param TokenName The name of the PCD token to set the current value for.
714 @param Value The 32-bit value to set.
715
716 @return Return the Value that was set.
717
718 **/
719 #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
720
721
722 /**
723 Sets a 64-bit PCD token value based on a GUID and a token name.
724
725 Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
726 If TokenName is not a valid token in the token space specified by Guid,
727 then the module will not build.
728
729 If Guid is NULL, then ASSERT().
730
731 @param Guid Pointer to a 128-bit unique value that designates
732 which namespace to retrieve a value from.
733 @param TokenName The name of the PCD token to set the current value for.
734 @param Value The 64-bit value to set.
735
736 @return Return the Value that was set.
737
738 **/
739 #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
740
741
742 /**
743 Sets a pointer to a PCD token buffer based on a GUID and a token name.
744
745 Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
746 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
747 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
748 NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
749 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
750 Guid and TokenName and NULL must be returned.
751 If TokenName is not a valid token in the token space specified by Guid,
752 then the module will not build.
753
754 If Guid is NULL, then ASSERT().
755 If SizeOfBuffer is NULL, then ASSERT().
756 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
757
758 @param Guid Pointer to a 128-bit unique value that designates
759 which namespace to retrieve a value from.
760 @param TokenName The name of the PCD token to set the current value for.
761 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
762 @param Buffer Pointer to the buffer to set.
763
764 @return Return the pointer to the Buffer that was set.
765
766 **/
767 #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
768 LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
769
770
771 /**
772 Sets a Boolean PCD token value based on a GUID and a token name.
773
774 Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
775 If TokenName is not a valid token in the token space specified by Guid,
776 then the module will not build.
777
778 If Guid is NULL, then ASSERT().
779
780 @param Guid Pointer to a 128-bit unique value that designates
781 which namespace to retrieve a value from.
782 @param TokenName The name of the PCD token to set the current value for.
783 @param Value The Boolean value to set.
784
785 @return Return the Value that was set.
786
787 **/
788 #define PcdSetExBool(Guid, TokenName, Value) \
789 LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))
790
791
792 /**
793 This function provides a means by which SKU support can be established in the PCD infrastructure.
794
795 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
796 If SkuId >= PCD_MAX_SKU_ID, then ASSERT().
797
798 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values
799 associated with a PCD token.
800
801 @return Return the SKU ID that was set.
802
803 **/
804 UINTN
805 EFIAPI
806 LibPcdSetSku (
807 IN UINTN SkuId
808 );
809
810
811 /**
812 This function provides a means by which to retrieve a value for a given PCD token.
813
814 Returns the 8-bit value for the token specified by TokenNumber.
815
816 @param[in] TokenNumber The PCD token number to retrieve a current value for.
817
818 @return Returns the 8-bit value for the token specified by TokenNumber.
819
820 **/
821 UINT8
822 EFIAPI
823 LibPcdGet8 (
824 IN UINTN TokenNumber
825 );
826
827
828 /**
829 This function provides a means by which to retrieve a value for a given PCD token.
830
831 Returns the 16-bit value for the token specified by TokenNumber.
832
833 @param[in] TokenNumber The PCD token number to retrieve a current value for.
834
835 @return Returns the 16-bit value for the token specified by TokenNumber.
836
837 **/
838 UINT16
839 EFIAPI
840 LibPcdGet16 (
841 IN UINTN TokenNumber
842 );
843
844
845 /**
846 This function provides a means by which to retrieve a value for a given PCD token.
847
848 Returns the 32-bit value for the token specified by TokenNumber.
849
850 @param[in] TokenNumber The PCD token number to retrieve a current value for.
851
852 @return Returns the 32-bit value for the token specified by TokenNumber.
853
854 **/
855 UINT32
856 EFIAPI
857 LibPcdGet32 (
858 IN UINTN TokenNumber
859 );
860
861
862 /**
863 This function provides a means by which to retrieve a value for a given PCD token.
864
865 Returns the 64-bit value for the token specified by TokenNumber.
866
867 @param[in] TokenNumber The PCD token number to retrieve a current value for.
868
869 @return Returns the 64-bit value for the token specified by TokenNumber.
870
871 **/
872 UINT64
873 EFIAPI
874 LibPcdGet64 (
875 IN UINTN TokenNumber
876 );
877
878
879 /**
880 This function provides a means by which to retrieve a value for a given PCD token.
881
882 Returns the pointer to the buffer of the token specified by TokenNumber.
883
884 @param[in] TokenNumber The PCD token number to retrieve a current value for.
885
886 @return Returns the pointer to the token specified by TokenNumber.
887
888 **/
889 VOID *
890 EFIAPI
891 LibPcdGetPtr (
892 IN UINTN TokenNumber
893 );
894
895
896 /**
897 This function provides a means by which to retrieve a value for a given PCD token.
898
899 Returns the Boolean value of the token specified by TokenNumber.
900
901 @param[in] TokenNumber The PCD token number to retrieve a current value for.
902
903 @return Returns the Boolean value of the token specified by TokenNumber.
904
905 **/
906 BOOLEAN
907 EFIAPI
908 LibPcdGetBool (
909 IN UINTN TokenNumber
910 );
911
912
913 /**
914 This function provides a means by which to retrieve the size of a given PCD token.
915
916 @param[in] TokenNumber The PCD token number to retrieve a current value for.
917
918 @return Returns the size of the token specified by TokenNumber.
919
920 **/
921 UINTN
922 EFIAPI
923 LibPcdGetSize (
924 IN UINTN TokenNumber
925 );
926
927
928 /**
929 This function provides a means by which to retrieve a value for a given PCD token.
930
931 Returns the 8-bit value for the token specified by TokenNumber and Guid.
932
933 If Guid is NULL, then ASSERT().
934
935 @param[in] Guid Pointer to a 128-bit unique value that designates
936 which namespace to retrieve a value from.
937 @param[in] TokenNumber The PCD token number to retrieve a current value for.
938
939 @return Return the UINT8.
940
941 **/
942 UINT8
943 EFIAPI
944 LibPcdGetEx8 (
945 IN CONST GUID *Guid,
946 IN UINTN TokenNumber
947 );
948
949
950 /**
951 This function provides a means by which to retrieve a value for a given PCD token.
952
953 Returns the 16-bit value for the token specified by TokenNumber and Guid.
954
955 If Guid is NULL, then ASSERT().
956
957 @param[in] Guid Pointer to a 128-bit unique value that designates
958 which namespace to retrieve a value from.
959 @param[in] TokenNumber The PCD token number to retrieve a current value for.
960
961 @return Return the UINT16.
962
963 **/
964 UINT16
965 EFIAPI
966 LibPcdGetEx16 (
967 IN CONST GUID *Guid,
968 IN UINTN TokenNumber
969 );
970
971
972 /**
973 Returns the 32-bit value for the token specified by TokenNumber and Guid.
974 If Guid is NULL, then ASSERT().
975
976 @param[in] Guid Pointer to a 128-bit unique value that designates
977 which namespace to retrieve a value from.
978 @param[in] TokenNumber The PCD token number to retrieve a current value for.
979
980 @return Return the UINT32.
981
982 **/
983 UINT32
984 EFIAPI
985 LibPcdGetEx32 (
986 IN CONST GUID *Guid,
987 IN UINTN TokenNumber
988 );
989
990
991 /**
992 This function provides a means by which to retrieve a value for a given PCD token.
993
994 Returns the 64-bit value for the token specified by TokenNumber and Guid.
995
996 If Guid is NULL, then ASSERT().
997
998 @param[in] Guid Pointer to a 128-bit unique value that designates
999 which namespace to retrieve a value from.
1000 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1001
1002 @return Return the UINT64.
1003
1004 **/
1005 UINT64
1006 EFIAPI
1007 LibPcdGetEx64 (
1008 IN CONST GUID *Guid,
1009 IN UINTN TokenNumber
1010 );
1011
1012
1013 /**
1014 This function provides a means by which to retrieve a value for a given PCD token.
1015
1016 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
1017
1018 If Guid is NULL, then ASSERT().
1019
1020 @param[in] Guid Pointer to a 128-bit unique value that designates
1021 which namespace to retrieve a value from.
1022 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1023
1024 @return Return the VOID* pointer.
1025
1026 **/
1027 VOID *
1028 EFIAPI
1029 LibPcdGetExPtr (
1030 IN CONST GUID *Guid,
1031 IN UINTN TokenNumber
1032 );
1033
1034
1035 /**
1036 This function provides a means by which to retrieve a value for a given PCD token.
1037
1038 Returns the Boolean value of the token specified by TokenNumber and Guid.
1039
1040 If Guid is NULL, then ASSERT().
1041
1042 @param[in] Guid Pointer to a 128-bit unique value that designates
1043 which namespace to retrieve a value from.
1044 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1045
1046 @return Return the BOOLEAN.
1047
1048 **/
1049 BOOLEAN
1050 EFIAPI
1051 LibPcdGetExBool (
1052 IN CONST GUID *Guid,
1053 IN UINTN TokenNumber
1054 );
1055
1056
1057 /**
1058 This function provides a means by which to retrieve the size of a given PCD token.
1059
1060 Returns the size of the token specified by TokenNumber and Guid.
1061
1062 If Guid is NULL, then ASSERT().
1063
1064 @param[in] Guid Pointer to a 128-bit unique value that designates
1065 which namespace to retrieve a value from.
1066 @param[in] TokenNumber The PCD token number to retrieve a current value for.
1067
1068 @return Return the size.
1069
1070 **/
1071 UINTN
1072 EFIAPI
1073 LibPcdGetExSize (
1074 IN CONST GUID *Guid,
1075 IN UINTN TokenNumber
1076 );
1077
1078
1079 /**
1080 This function provides a means by which to set a value for a given PCD token.
1081
1082 Sets the 8-bit value for the token specified by TokenNumber
1083 to the value specified by Value. Value is returned.
1084
1085 @param[in] TokenNumber The PCD token number to set a current value for.
1086 @param[in] Value The 8-bit value to set.
1087
1088 @return Return the Value that was set.
1089
1090 **/
1091 UINT8
1092 EFIAPI
1093 LibPcdSet8 (
1094 IN UINTN TokenNumber,
1095 IN UINT8 Value
1096 );
1097
1098
1099 /**
1100 This function provides a means by which to set a value for a given PCD token.
1101
1102 Sets the 16-bit value for the token specified by TokenNumber
1103 to the value specified by Value. Value is returned.
1104
1105 @param[in] TokenNumber The PCD token number to set a current value for.
1106 @param[in] Value The 16-bit value to set.
1107
1108 @return Return the Value that was set.
1109
1110 **/
1111 UINT16
1112 EFIAPI
1113 LibPcdSet16 (
1114 IN UINTN TokenNumber,
1115 IN UINT16 Value
1116 );
1117
1118
1119 /**
1120 This function provides a means by which to set a value for a given PCD token.
1121
1122 Sets the 32-bit value for the token specified by TokenNumber
1123 to the value specified by Value. Value is returned.
1124
1125 @param[in] TokenNumber The PCD token number to set a current value for.
1126 @param[in] Value The 32-bit value to set.
1127
1128 @return Return the Value that was set.
1129
1130 **/
1131 UINT32
1132 EFIAPI
1133 LibPcdSet32 (
1134 IN UINTN TokenNumber,
1135 IN UINT32 Value
1136 );
1137
1138
1139 /**
1140 This function provides a means by which to set a value for a given PCD token.
1141
1142 Sets the 64-bit value for the token specified by TokenNumber
1143 to the value specified by Value. Value is returned.
1144
1145 @param[in] TokenNumber The PCD token number to set a current value for.
1146 @param[in] Value The 64-bit value to set.
1147
1148 @return Return the Value that was set.
1149
1150 **/
1151 UINT64
1152 EFIAPI
1153 LibPcdSet64 (
1154 IN UINTN TokenNumber,
1155 IN UINT64 Value
1156 );
1157
1158
1159 /**
1160 This function provides a means by which to set a value for a given PCD token.
1161
1162 Sets a buffer for the token specified by TokenNumber to the value
1163 specified by Buffer and SizeOfBuffer. Buffer is returned.
1164 If SizeOfBuffer is greater than the maximum size support by TokenNumber,
1165 then set SizeOfBuffer to the maximum size supported by TokenNumber and
1166 return NULL to indicate that the set operation was not actually performed.
1167
1168 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1169 maximum size supported by TokenName and NULL must be returned.
1170
1171 If SizeOfBuffer is NULL, then ASSERT().
1172 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1173
1174 @param[in] TokenNumber The PCD token number to set a current value for.
1175 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1176 @param[in] Buffer A pointer to the buffer to set.
1177
1178 @return Return the pointer for the Buffer that was set.
1179
1180 **/
1181 VOID *
1182 EFIAPI
1183 LibPcdSetPtr (
1184 IN UINTN TokenNumber,
1185 IN OUT UINTN *SizeOfBuffer,
1186 IN CONST VOID *Buffer
1187 );
1188
1189
1190 /**
1191 This function provides a means by which to set a value for a given PCD token.
1192
1193 Sets the Boolean value for the token specified by TokenNumber
1194 to the value specified by Value. Value is returned.
1195
1196 @param[in] TokenNumber The PCD token number to set a current value for.
1197 @param[in] Value The boolean value to set.
1198
1199 @return Return the Value that was set.
1200
1201 **/
1202 BOOLEAN
1203 EFIAPI
1204 LibPcdSetBool (
1205 IN UINTN TokenNumber,
1206 IN BOOLEAN Value
1207 );
1208
1209
1210 /**
1211 This function provides a means by which to set a value for a given PCD token.
1212
1213 Sets the 8-bit value for the token specified by TokenNumber and
1214 Guid to the value specified by Value. Value is returned.
1215
1216 If Guid is NULL, then ASSERT().
1217
1218 @param[in] Guid Pointer to a 128-bit unique value that
1219 designates which namespace to set a value from.
1220 @param[in] TokenNumber The PCD token number to set a current value for.
1221 @param[in] Value The 8-bit value to set.
1222
1223 @return Return the Value that was set.
1224
1225 **/
1226 UINT8
1227 EFIAPI
1228 LibPcdSetEx8 (
1229 IN CONST GUID *Guid,
1230 IN UINTN TokenNumber,
1231 IN UINT8 Value
1232 );
1233
1234
1235 /**
1236 This function provides a means by which to set a value for a given PCD token.
1237
1238 Sets the 16-bit value for the token specified by TokenNumber and
1239 Guid to the value specified by Value. Value is returned.
1240
1241 If Guid is NULL, then ASSERT().
1242
1243 @param[in] Guid Pointer to a 128-bit unique value that
1244 designates which namespace to set a value from.
1245 @param[in] TokenNumber The PCD token number to set a current value for.
1246 @param[in] Value The 16-bit value to set.
1247
1248 @return Return the Value that was set.
1249
1250 **/
1251 UINT16
1252 EFIAPI
1253 LibPcdSetEx16 (
1254 IN CONST GUID *Guid,
1255 IN UINTN TokenNumber,
1256 IN UINT16 Value
1257 );
1258
1259
1260 /**
1261 This function provides a means by which to set a value for a given PCD token.
1262
1263 Sets the 32-bit value for the token specified by TokenNumber and
1264 Guid to the value specified by Value. Value is returned.
1265
1266 If Guid is NULL, then ASSERT().
1267
1268 @param[in] Guid Pointer to a 128-bit unique value that
1269 designates which namespace to set a value from.
1270 @param[in] TokenNumber The PCD token number to set a current value for.
1271 @param[in] Value The 32-bit value to set.
1272
1273 @return Return the Value that was set.
1274
1275 **/
1276 UINT32
1277 EFIAPI
1278 LibPcdSetEx32 (
1279 IN CONST GUID *Guid,
1280 IN UINTN TokenNumber,
1281 IN UINT32 Value
1282 );
1283
1284
1285 /**
1286 This function provides a means by which to set a value for a given PCD token.
1287
1288 Sets the 64-bit value for the token specified by TokenNumber and
1289 Guid to the value specified by Value. Value is returned.
1290 If Guid is NULL, then ASSERT().
1291
1292 @param[in] Guid Pointer to a 128-bit unique value that
1293 designates which namespace to set a value from.
1294 @param[in] TokenNumber The PCD token number to set a current value for.
1295 @param[in] Value The 64-bit value to set.
1296
1297 @return Return the Value that was set.
1298
1299 **/
1300 UINT64
1301 EFIAPI
1302 LibPcdSetEx64 (
1303 IN CONST GUID *Guid,
1304 IN UINTN TokenNumber,
1305 IN UINT64 Value
1306 );
1307
1308
1309 /**
1310 This function provides a means by which to set a value for a given PCD token.
1311
1312 Sets a buffer for the token specified by TokenNumber to the value specified by
1313 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
1314 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
1315 supported by TokenNumber and return NULL to indicate that the set operation
1316 was not actually performed.
1317
1318 If Guid is NULL, then ASSERT().
1319 If SizeOfBuffer is NULL, then ASSERT().
1320 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1321
1322 @param[in] Guid Pointer to a 128-bit unique value that
1323 designates which namespace to set a value from.
1324 @param[in] TokenNumber The PCD token number to set a current value for.
1325 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
1326 @param[in] Buffer A pointer to the buffer to set.
1327
1328 @return Return the pointer to the Buffer that was set.
1329
1330 **/
1331 VOID *
1332 EFIAPI
1333 LibPcdSetExPtr (
1334 IN CONST GUID *Guid,
1335 IN UINTN TokenNumber,
1336 IN OUT UINTN *SizeOfBuffer,
1337 IN VOID *Buffer
1338 );
1339
1340
1341 /**
1342 This function provides a means by which to set a value for a given PCD token.
1343
1344 Sets the Boolean value for the token specified by TokenNumber and
1345 Guid to the value specified by Value. Value is returned.
1346
1347 If Guid is NULL, then ASSERT().
1348
1349 @param[in] Guid Pointer to a 128-bit unique value that
1350 designates which namespace to set a value from.
1351 @param[in] TokenNumber The PCD token number to set a current value for.
1352 @param[in] Value The Boolean value to set.
1353
1354 @return Return the Value that was set.
1355
1356 **/
1357 BOOLEAN
1358 EFIAPI
1359 LibPcdSetExBool (
1360 IN CONST GUID *Guid,
1361 IN UINTN TokenNumber,
1362 IN BOOLEAN Value
1363 );
1364
1365
1366 /**
1367 This notification function serves two purposes.
1368
1369 Firstly, it notifies the module that did the registration that the value of this
1370 PCD token has been set.
1371 Secondly, it provides a mechanism for the module that did the registration to intercept
1372 the set operation and override the value been set if necessary. After the invocation of
1373 the callback function, TokenData will be used by PCD service PEIM or driver to modify th
1374 internal data in PCD database.
1375
1376 @param[in] CallBackGuid The PCD token GUID being set.
1377 @param[in] CallBackToken The PCD token number being set.
1378 @param[in, out] TokenData A pointer to the token data being set.
1379 @param[in] TokenDataSize The size, in bytes, of the data being set.
1380
1381 **/
1382 typedef
1383 VOID
1384 (EFIAPI *PCD_CALLBACK)(
1385 IN CONST GUID *CallBackGuid, OPTIONAL
1386 IN UINTN CallBackToken,
1387 IN OUT VOID *TokenData,
1388 IN UINTN TokenDataSize
1389 );
1390
1391
1392 /**
1393 Set up a notification function that is called when a specified token is set.
1394
1395 When the token specified by TokenNumber and Guid is set,
1396 then notification function specified by NotificationFunction is called.
1397 If Guid is NULL, then the default token space is used.
1398 If NotificationFunction is NULL, then ASSERT().
1399
1400 @param[in] Guid Pointer to a 128-bit unique value that designates which
1401 namespace to set a value from. If NULL, then the default
1402 token space is used.
1403 @param[in] TokenNumber The PCD token number to monitor.
1404 @param[in] NotificationFunction The function to call when the token
1405 specified by Guid and TokenNumber is set.
1406
1407 **/
1408 VOID
1409 EFIAPI
1410 LibPcdCallbackOnSet (
1411 IN CONST GUID *Guid, OPTIONAL
1412 IN UINTN TokenNumber,
1413 IN PCD_CALLBACK NotificationFunction
1414 );
1415
1416
1417 /**
1418 Disable a notification function that was established with LibPcdCallbackonSet().
1419
1420 Disable a notification function that was previously established with LibPcdCallbackOnSet().
1421 If NotificationFunction is NULL, then ASSERT().
1422 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1423 and NotificationFunction, then ASSERT().
1424
1425 @param[in] Guid Specify the GUID token space.
1426 @param[in] TokenNumber Specify the token number.
1427 @param[in] NotificationFunction The callback function to be unregistered.
1428
1429 **/
1430 VOID
1431 EFIAPI
1432 LibPcdCancelCallback (
1433 IN CONST GUID *Guid, OPTIONAL
1434 IN UINTN TokenNumber,
1435 IN PCD_CALLBACK NotificationFunction
1436 );
1437
1438
1439 /**
1440 Retrieves the next token in a token space.
1441
1442 Retrieves the next PCD token number from the token space specified by Guid.
1443 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
1444 then the first token number is returned. Otherwise, the token number that
1445 follows TokenNumber in the token space is returned. If TokenNumber is the last
1446 token number in the token space, then 0 is returned.
1447
1448 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
1449
1450 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace
1451 to set a value from. If NULL, then the default token space is used.
1452 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
1453 token number.
1454
1455 @return The next valid token number.
1456
1457 **/
1458 UINTN
1459 EFIAPI
1460 LibPcdGetNextToken (
1461 IN CONST GUID *Guid, OPTIONAL
1462 IN UINTN TokenNumber
1463 );
1464
1465
1466
1467 /**
1468 Used to retrieve the list of available PCD token space GUIDs.
1469
1470 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
1471 in the platform.
1472 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
1473 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
1474
1475 @param TokenSpaceGuid Pointer to the a PCD token space GUID
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 that was 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 typedef enum {
1520 PCD_TYPE_8,
1521 PCD_TYPE_16,
1522 PCD_TYPE_32,
1523 PCD_TYPE_64,
1524 PCD_TYPE_BOOL,
1525 PCD_TYPE_PTR
1526 } PCD_TYPE;
1527
1528 typedef struct {
1529 ///
1530 /// The returned information associated with the requested TokenNumber. If
1531 /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.
1532 ///
1533 PCD_TYPE PcdType;
1534 ///
1535 /// The size of the data in bytes associated with the TokenNumber specified. If
1536 /// TokenNumber is 0, then PcdSize is set 0.
1537 ///
1538 UINTN PcdSize;
1539 ///
1540 /// The null-terminated ASCII string associated with a given token. If the
1541 /// TokenNumber specified was 0, then this field corresponds to the null-terminated
1542 /// ASCII string associated with the token's namespace Guid. If NULL, there is no
1543 /// name associated with this request.
1544 ///
1545 CHAR8 *PcdName;
1546 } PCD_INFO;
1547
1548
1549 /**
1550 Retrieve additional information associated with a PCD token.
1551
1552 This includes information such as the type of value the TokenNumber is associated with as well as possible
1553 human readable name that is associated with the token.
1554
1555 If TokenNumber is not in the default token space specified, then ASSERT().
1556
1557 @param[in] TokenNumber The PCD token number.
1558 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1559 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1560 **/
1561 VOID
1562 EFIAPI
1563 LibPcdGetInfo (
1564 IN UINTN TokenNumber,
1565 OUT PCD_INFO *PcdInfo
1566 );
1567
1568 /**
1569 Retrieve additional information associated with a PCD token.
1570
1571 This includes information such as the type of value the TokenNumber is associated with as well as possible
1572 human readable name that is associated with the token.
1573
1574 If TokenNumber is not in the token space specified by Guid, then ASSERT().
1575
1576 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
1577 @param[in] TokenNumber The PCD token number.
1578 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1579 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1580 **/
1581 VOID
1582 EFIAPI
1583 LibPcdGetInfoEx (
1584 IN CONST GUID *Guid,
1585 IN UINTN TokenNumber,
1586 OUT PCD_INFO *PcdInfo
1587 );
1588
1589 /**
1590 Retrieve the currently set SKU Id.
1591
1592 If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().
1593
1594 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
1595 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
1596 Id is returned.
1597 **/
1598 UINTN
1599 EFIAPI
1600 LibPcdGetSku (
1601 VOID
1602 );
1603
1604 #endif