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