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