]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/PcdLib.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Library / PcdLib.h
... / ...
CommitLineData
1/** @file\r
2 Provides library services to get and set Platform Configuration Database entries.\r
3\r
4 PCD Library Class provides a PCD usage macro interface for all PCD types.\r
5 It should be included in any module that uses PCD. If a module uses dynamic/dynamicex\r
6 PCD, module should be linked to a PEIM/DXE library instance to access that PCD.\r
7 If a module uses PatchableInModule type PCD, it also needs the library instance to produce\r
8 LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is\r
9 translated to a variable or macro that is auto-generated by build tool in\r
10 module's autogen.h/autogen.c.\r
11 The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are\r
12 only available prior to ExitBootServices(). If access to PCD values are required\r
13 at runtime, then their values must be collected prior to ExitBootServices().\r
14 There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),\r
15 PatchPcdGetXX(), and PatchPcdSetXX().\r
16\r
17Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
18This program and the accompanying materials\r
19are licensed and made available under the terms and conditions of the BSD License\r
20which accompanies this distribution. The full text of the license may be found at\r
21http://opensource.org/licenses/bsd-license.php\r
22\r
23THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
24WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
25\r
26**/\r
27\r
28#ifndef __PCD_LIB_H__\r
29#define __PCD_LIB_H__\r
30\r
31\r
32/**\r
33 Retrieves a token number based on a token name.\r
34\r
35 Returns the token number associated with the PCD token specified by TokenName.\r
36 If TokenName is not a valid token in the token space, then the module will not build.\r
37\r
38 @param TokenName The name of the PCD token to retrieve the token number for.\r
39\r
40 @return The token number associated with the PCD.\r
41\r
42**/\r
43#define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r
44\r
45\r
46/**\r
47 Retrieves a Boolean PCD feature flag based on a token name.\r
48\r
49 Returns the Boolean value for the PCD feature flag specified by TokenName.\r
50 If TokenName is not a valid token in the token space, then the module will not build.\r
51 If TokenName is not a feature flag PCD, then the module will not build.\r
52\r
53 @param TokenName The name of the PCD token to retrieve a current value for.\r
54\r
55 @return Boolean value for the PCD feature flag.\r
56\r
57**/\r
58#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
59\r
60\r
61/**\r
62 Retrieves an 8-bit fixed PCD token value based on a token name.\r
63\r
64 Returns the 8-bit value for the token specified by TokenName.\r
65 If TokenName is not a valid token in the token space, then the module will not build.\r
66 If TokenName is not a fixed at build PCD, then the module will not build.\r
67\r
68 @param TokenName The name of the PCD token to retrieve a current value for.\r
69\r
70 @return 8-bit value for the token specified by TokenName.\r
71\r
72**/\r
73#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName\r
74\r
75\r
76/**\r
77 Retrieves a 16-bit fixed PCD token value based on a token name.\r
78\r
79 Returns the 16-bit value for the token specified by TokenName.\r
80 If TokenName is not a valid token in the token space, then the module will not build.\r
81 If TokenName is not a fixed at build PCD, then the module will not build.\r
82\r
83 @param TokenName The name of the PCD token to retrieve a current value for.\r
84\r
85 @return 16-bit value for the token specified by TokenName.\r
86\r
87**/\r
88#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName\r
89\r
90\r
91/**\r
92 Retrieves a 32-bit fixed PCD token value based on a token name.\r
93\r
94 Returns the 32-bit value for the token specified by TokenName.\r
95 If TokenName is not a valid token in the token space, then the module will not build.\r
96 If TokenName is not a fixed at build PCD, then the module will not build.\r
97\r
98 @param TokenName The name of the PCD token to retrieve a current value for.\r
99\r
100 @return 32-bit value for the token specified by TokenName.\r
101\r
102**/\r
103#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName\r
104\r
105\r
106/**\r
107 Retrieves a 64-bit fixed PCD token value based on a token name.\r
108\r
109 Returns the 64-bit value for the token specified by TokenName.\r
110 If TokenName is not a valid token in the token space, then the module will not build.\r
111 If TokenName is not a fixed at build PCD, then the module will not build.\r
112\r
113 @param TokenName The name of the PCD token to retrieve a current value for.\r
114\r
115 @return 64-bit value for the token specified by TokenName.\r
116\r
117**/\r
118#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName\r
119\r
120\r
121/**\r
122 Retrieves a Boolean fixed PCD token value based on a token name.\r
123\r
124 Returns the Boolean value for the token specified by TokenName.\r
125 If TokenName is not a valid token in the token space, then the module will not build.\r
126 If TokenName is not a fixed at build PCD, then the module will not build.\r
127\r
128 @param TokenName The name of the PCD token to retrieve a current value for.\r
129\r
130 @return The Boolean value for the token.\r
131\r
132**/\r
133#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName\r
134\r
135\r
136/**\r
137 Retrieves a pointer to a fixed PCD token buffer based on a token name.\r
138\r
139 Returns a pointer to the buffer for the token specified by TokenName.\r
140 If TokenName is not a valid token in the token space, then the module will not build.\r
141 If TokenName is not a fixed at build PCD, then the module will not build.\r
142\r
143 @param TokenName The name of the PCD token to retrieve a current value for.\r
144\r
145 @return A pointer to the buffer.\r
146\r
147**/\r
148#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r
149\r
150\r
151/**\r
152 Retrieves an 8-bit binary patchable PCD token value based on a token name.\r
153\r
154 Returns the 8-bit value for the token specified by TokenName.\r
155 If TokenName is not a valid token in the token space, then the module will not build.\r
156 If TokenName is not a patchable in module PCD, then the module will not build.\r
157\r
158 @param TokenName The name of the PCD token to retrieve a current value for.\r
159\r
160 @return An 8-bit binary patchable PCD token value.\r
161\r
162**/\r
163#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName\r
164\r
165/**\r
166 Retrieves a 16-bit binary patchable PCD token value based on a token name.\r
167\r
168 Returns the 16-bit value for the token specified by TokenName.\r
169 If TokenName is not a valid token in the token space, then the module will not build.\r
170 If TokenName is not a patchable in module PCD, then the module will not build.\r
171\r
172 @param TokenName The name of the PCD token to retrieve a current value for.\r
173\r
174 @return A 16-bit binary patchable PCD token value.\r
175\r
176**/\r
177#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName\r
178\r
179\r
180/**\r
181 Retrieves a 32-bit binary patchable PCD token value based on a token name.\r
182\r
183 Returns the 32-bit value for the token specified by TokenName.\r
184 If TokenName is not a valid token in the token space, then the module will not build.\r
185 If TokenName is not a patchable in module PCD, then the module will not build.\r
186\r
187 @param TokenName The name of the PCD token to retrieve a current value for.\r
188\r
189 @return A 32-bit binary patchable PCD token value.\r
190\r
191**/\r
192#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName\r
193\r
194\r
195/**\r
196 Retrieves a 64-bit binary patchable PCD token value based on a token name.\r
197\r
198 Returns the 64-bit value for the token specified by TokenName.\r
199 If TokenName is not a valid token in the token space, then the module will not build.\r
200 If TokenName is not a patchable in module PCD, then the module will not build.\r
201\r
202 @param TokenName The name of the PCD token to retrieve a current value for.\r
203\r
204 @return A 64-bit binary patchable PCD token value.\r
205\r
206**/\r
207#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName\r
208\r
209\r
210/**\r
211 Retrieves a Boolean binary patchable PCD token value based on a token name.\r
212\r
213 Returns the Boolean value for the token specified by TokenName.\r
214 If TokenName is not a valid token in the token space, then the module will not build.\r
215 If TokenName is not a patchable in module PCD, then the module will not build.\r
216\r
217 @param TokenName The name of the PCD token to retrieve a current value for.\r
218\r
219 @return The Boolean value for the token.\r
220\r
221**/\r
222#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName\r
223\r
224\r
225/**\r
226 Retrieves a pointer to a binary patchable PCD token buffer based on a token name.\r
227\r
228 Returns a pointer to the buffer for the token specified by TokenName.\r
229 If TokenName is not a valid token in the token space, then the module will not build.\r
230 If TokenName is not a patchable in module PCD, then the module will not build.\r
231\r
232 @param TokenName The name of the PCD token to retrieve a current value for.\r
233\r
234 @return A pointer to the buffer for the token.\r
235\r
236**/\r
237#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)\r
238\r
239\r
240/**\r
241 Sets an 8-bit binary patchable PCD token value based on a token name.\r
242\r
243 Sets the 8-bit value for the token specified by TokenName. Value is returned.\r
244 If TokenName is not a valid token in the token space, then the module will not build.\r
245 If TokenName is not a patchable in module PCD, then the module will not build.\r
246\r
247 @param TokenName The name of the binary patchable PCD token to set the current value for.\r
248 @param Value The 8-bit value to set.\r
249\r
250 @return Return the Value that was set.\r
251\r
252**/\r
253#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
254\r
255\r
256/**\r
257 Sets a 16-bit binary patchable PCD token value based on a token name.\r
258\r
259 Sets the 16-bit value for the token specified by TokenName. Value is returned.\r
260 If TokenName is not a valid token in the token space, then the module will not build.\r
261 If TokenName is not a patchable in module PCD, then the module will not build.\r
262\r
263 @param TokenName The name of the binary patchable PCD token to set the current value for.\r
264 @param Value The 16-bit value to set.\r
265\r
266 @return Return the Value that was set.\r
267\r
268**/\r
269#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
270\r
271\r
272/**\r
273 Sets a 32-bit binary patchable PCD token value based on a token name.\r
274\r
275 Sets the 32-bit value for the token specified by TokenName. Value is returned.\r
276 If TokenName is not a valid token in the token space, then the module will not build.\r
277 If TokenName is not a patchable in module PCD, then the module will not build.\r
278\r
279 @param TokenName The name of the binary patchable PCD token to set the current value for.\r
280 @param Value The 32-bit value to set.\r
281\r
282 @return Return the Value that was set.\r
283\r
284**/\r
285#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
286\r
287\r
288/**\r
289 Sets a 64-bit binary patchable PCD token value based on a token name.\r
290\r
291 Sets the 64-bit value for the token specified by TokenName. Value is returned.\r
292 If TokenName is not a valid token in the token space, then the module will not build.\r
293 If TokenName is not a patchable in module PCD, then the module will not build.\r
294\r
295 @param TokenName The name of the binary patchable PCD token to set the current value for.\r
296 @param Value The 64-bit value to set.\r
297\r
298 @return Return the Value that was set.\r
299\r
300**/\r
301#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
302\r
303\r
304/**\r
305 Sets a Boolean binary patchable PCD token value based on a token name.\r
306\r
307 Sets the Boolean value for the token specified by TokenName. Value is returned.\r
308 If TokenName is not a valid token in the token space, then the module will not build.\r
309 If TokenName is not a patchable in module PCD, then the module will not build.\r
310\r
311 @param TokenName The name of the binary patchable PCD token to set the current value for.\r
312 @param Value The boolean value to set.\r
313\r
314 @return Return the Value that was set.\r
315\r
316**/\r
317#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
318\r
319\r
320/**\r
321 Sets a pointer to a binary patchable PCD token buffer based on a token name.\r
322\r
323 Sets the buffer for the token specified by TokenName. Buffer is returned.\r
324 If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer\r
325 to the maximum size supported by TokenName and return NULL to indicate that the set operation\r
326 was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be\r
327 set to the maximum size supported by TokenName and NULL must be returned.\r
328 If TokenName is not a valid token in the token space, then the module will not build.\r
329 If TokenName is not a patchable in module PCD, then the module will not build.\r
330\r
331 If SizeOfBuffer is NULL, then ASSERT().\r
332 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
333\r
334 @param TokenName The name of the binary patchable PCD token to set the current value for.\r
335 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
336 @param Buffer Pointer to the value to set.\r
337\r
338 @return Return the pointer to the Buffer that was set.\r
339\r
340**/\r
341#define PatchPcdSetPtr(TokenName, Size, Buffer) \\r
342 LibPatchPcdSetPtrAndSize ( \\r
343 (VOID *)_gPcd_BinaryPatch_##TokenName, \\r
344 &_gPcd_BinaryPatch_Size_##TokenName, \\r
345 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \\r
346 (Size), \\r
347 (Buffer) \\r
348 )\r
349/**\r
350 Retrieves an 8-bit PCD token value based on a token name.\r
351\r
352 Returns the 8-bit value for the token specified by TokenName.\r
353 If TokenName is not a valid token in the token space, then the module will not build.\r
354\r
355 @param TokenName The name of the PCD token to retrieve a current value for.\r
356\r
357 @return 8-bit value for the token specified by TokenName.\r
358\r
359**/\r
360#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName\r
361\r
362\r
363/**\r
364 Retrieves a 16-bit PCD token value based on a token name.\r
365\r
366 Returns the 16-bit value for the token specified by TokenName.\r
367 If TokenName is not a valid token in the token space, then the module will not build.\r
368\r
369 @param TokenName The name of the PCD token to retrieve a current value for.\r
370\r
371 @return 16-bit value for the token specified by TokenName.\r
372\r
373**/\r
374#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName\r
375\r
376\r
377/**\r
378 Retrieves a 32-bit PCD token value based on a token name.\r
379\r
380 Returns the 32-bit value for the token specified by TokenName.\r
381 If TokenName is not a valid token in the token space, then the module will not build.\r
382\r
383 @param TokenName The name of the PCD token to retrieve a current value for.\r
384\r
385 @return 32-bit value for the token specified by TokenName.\r
386\r
387**/\r
388#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName\r
389\r
390\r
391/**\r
392 Retrieves a 64-bit PCD token value based on a token name.\r
393\r
394 Returns the 64-bit value for the token specified by TokenName.\r
395 If TokenName is not a valid token in the token space, then the module will not build.\r
396\r
397 @param TokenName The name of the PCD token to retrieve a current value for.\r
398\r
399 @return 64-bit value for the token specified by TokenName.\r
400\r
401**/\r
402#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName\r
403\r
404\r
405/**\r
406 Retrieves a pointer to a PCD token buffer based on a token name.\r
407\r
408 Returns a pointer to the buffer for the token specified by TokenName.\r
409 If TokenName is not a valid token in the token space, then the module will not build.\r
410\r
411 @param TokenName The name of the PCD token to retrieve a current value for.\r
412\r
413 @return A pointer to the buffer.\r
414\r
415**/\r
416#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName\r
417\r
418\r
419/**\r
420 Retrieves a Boolean PCD token value based on a token name.\r
421\r
422 Returns the Boolean value for the token specified by TokenName.\r
423 If TokenName is not a valid token in the token space, then the module will not build.\r
424\r
425 @param TokenName The name of the PCD token to retrieve a current value for.\r
426\r
427 @return A Boolean PCD token value.\r
428\r
429**/\r
430#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
431\r
432\r
433/**\r
434 Retrieves the size of a fixed PCD token based on a token name.\r
435\r
436 Returns the size of the token specified by TokenName.\r
437 If TokenName is not a valid token in the token space, then the module will not build.\r
438\r
439 @param[in] TokenName The name of the PCD token to retrieve a current value size for.\r
440\r
441 @return Return the size\r
442\r
443**/\r
444#define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName\r
445\r
446\r
447/**\r
448 Retrieves the size of a binary patchable PCD token based on a token name.\r
449\r
450 Returns the size of the token specified by TokenName.\r
451 If TokenName is not a valid token in the token space, then the module will not build.\r
452\r
453 @param[in] TokenName The name of the PCD token to retrieve a current value size for.\r
454\r
455 @return Return the size\r
456\r
457**/\r
458#define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName\r
459\r
460\r
461/**\r
462 Retrieves the size of the PCD token based on a token name.\r
463\r
464 Returns the size of the token specified by TokenName.\r
465 If TokenName is not a valid token in the token space, then the module will not build.\r
466\r
467 @param[in] TokenName The name of the PCD token to retrieve a current value size for.\r
468\r
469 @return Return the size\r
470\r
471**/\r
472#define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName\r
473\r
474\r
475/**\r
476 Retrieve the size of a given PCD token.\r
477\r
478 Returns the size of the token specified by TokenNumber and Guid.\r
479 If Guid is NULL, then ASSERT().\r
480\r
481 @param[in] Guid Pointer to a 128-bit unique value that designates\r
482 which namespace to retrieve a value from.\r
483 @param[in] TokenNumber The PCD token number to retrieve a current value size for.\r
484\r
485 @return Return the size.\r
486\r
487**/\r
488#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))\r
489\r
490#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
491/**\r
492 Sets an 8-bit PCD token value based on a token name.\r
493\r
494 Sets the 8-bit value for the token specified by TokenName. Value is returned.\r
495 If TokenName is not a valid token in the token space, then the module will not build.\r
496\r
497 @param TokenName The name of the PCD token to retrieve a current value for.\r
498 @param Value The 8-bit value to set.\r
499\r
500 @return Return the Value that was set.\r
501\r
502**/\r
503#define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))\r
504\r
505\r
506/**\r
507 Sets a 16-bit PCD token value based on a token name.\r
508\r
509 Sets the 16-bit value for the token specified by TokenName. Value is returned.\r
510 If TokenName is not a valid token in the token space, then the module will not build.\r
511\r
512 @param TokenName The name of the PCD token to retrieve a current value for.\r
513 @param Value The 16-bit value to set.\r
514\r
515 @return Return the Value that was set.\r
516\r
517**/\r
518#define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))\r
519\r
520\r
521/**\r
522 Sets a 32-bit PCD token value based on a token name.\r
523\r
524 Sets the 32-bit value for the token specified by TokenName. Value is returned.\r
525 If TokenName is not a valid token in the token space, then the module will not build.\r
526\r
527 @param TokenName The name of the PCD token to retrieve a current value for.\r
528 @param Value The 32-bit value to set.\r
529\r
530 @return Return the Value that was set.\r
531\r
532**/\r
533#define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))\r
534\r
535\r
536/**\r
537 Sets a 64-bit PCD token value based on a token name.\r
538\r
539 Sets the 64-bit value for the token specified by TokenName. Value is returned.\r
540 If TokenName is not a valid token in the token space, then the module will not build.\r
541\r
542 @param TokenName The name of the PCD token to retrieve a current value for.\r
543 @param Value The 64-bit value to set.\r
544\r
545 @return Return the Value that was set.\r
546\r
547**/\r
548#define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))\r
549\r
550\r
551/**\r
552 Sets a pointer to a PCD token buffer based on a token name.\r
553\r
554 Sets the buffer for the token specified by TokenName. Buffer is returned.\r
555 If SizeOfBuffer is greater than the maximum size supported by TokenName,\r
556 then set SizeOfBuffer to the maximum size supported by TokenName and return NULL\r
557 to indicate that the set operation was not actually performed. If SizeOfBuffer\r
558 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported\r
559 by TokenName and NULL must be returned.\r
560 If TokenName is not a valid token in the token space, then the module will not build.\r
561\r
562 If SizeOfBuffer is NULL, then ASSERT().\r
563 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
564\r
565 @param TokenName The name of the PCD token to set the current value for.\r
566 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
567 @param Buffer A pointer to the buffer to set.\r
568\r
569 @return Return the pointer to the Buffer that was set.\r
570\r
571**/\r
572#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \\r
573 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))\r
574\r
575/**\r
576 Sets a Boolean PCD token value based on a token name.\r
577\r
578 Sets the Boolean value for the token specified by TokenName. Value is returned.\r
579 If TokenName is not a valid token in the token space, then the module will not build.\r
580\r
581 @param TokenName The name of the PCD token to set the current value for.\r
582 @param Buffer The Boolean value to set.\r
583\r
584 @return Return the Value that was set.\r
585\r
586**/\r
587#define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))\r
588#endif\r
589\r
590/**\r
591 Sets a 8-bit PCD token value based on a token name.\r
592\r
593 Sets the 8-bit value for the token specified by TokenName.\r
594 If TokenName is not a valid token in the token space, then the module will not build.\r
595\r
596 @param TokenName The name of the PCD token to retrieve a current value for.\r
597 @param Value The 8-bit value to set.\r
598\r
599 @return The status of the set operation.\r
600\r
601**/\r
602#define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value))\r
603\r
604/**\r
605 Sets a 16-bit PCD token value based on a token name.\r
606\r
607 Sets the 16-bit value for the token specified by TokenName.\r
608 If TokenName is not a valid token in the token space, then the module will not build.\r
609\r
610 @param TokenName The name of the PCD token to retrieve a current value for.\r
611 @param Value The 16-bit value to set.\r
612\r
613 @return The status of the set operation.\r
614\r
615**/\r
616#define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value))\r
617\r
618/**\r
619 Sets a 32-bit PCD token value based on a token name.\r
620\r
621 Sets the 32-bit value for the token specified by TokenName.\r
622 If TokenName is not a valid token in the token space, then the module will not build.\r
623\r
624 @param TokenName The name of the PCD token to retrieve a current value for.\r
625 @param Value The 32-bit value to set.\r
626\r
627 @return The status of the set operation.\r
628\r
629**/\r
630#define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value))\r
631\r
632/**\r
633 Sets a 64-bit PCD token value based on a token name.\r
634\r
635 Sets the 64-bit value for the token specified by TokenName.\r
636 If TokenName is not a valid token in the token space, then the module will not build.\r
637\r
638 @param TokenName The name of the PCD token to retrieve a current value for.\r
639 @param Value The 64-bit value to set.\r
640\r
641 @return The status of the set operation.\r
642\r
643**/\r
644#define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value))\r
645\r
646/**\r
647 Sets a pointer to a PCD token buffer based on a token name.\r
648\r
649 Sets the buffer for the token specified by TokenName.\r
650 If SizeOfBuffer is greater than the maximum size supported by TokenName,\r
651 then set SizeOfBuffer to the maximum size supported by TokenName and return\r
652 RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.\r
653 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size\r
654 supported by TokenName and RETURN_INVALID_PARAMETER must be returned.\r
655 If TokenName is not a valid token in the token space, then the module will not build.\r
656\r
657 If SizeOfBuffer is NULL, then ASSERT().\r
658 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
659\r
660 @param TokenName The name of the PCD token to set the current value for.\r
661 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
662 @param Buffer A pointer to the buffer to set.\r
663\r
664 @return The status of the set operation.\r
665\r
666**/\r
667#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \\r
668 _PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer))\r
669\r
670\r
671\r
672/**\r
673 Sets a boolean PCD token value based on a token name.\r
674\r
675 Sets the boolean value for the token specified by TokenName.\r
676 If TokenName is not a valid token in the token space, then the module will not build.\r
677\r
678 @param TokenName The name of the PCD token to retrieve a current value for.\r
679 @param Value The boolean value to set.\r
680\r
681 @return The status of the set operation.\r
682\r
683**/\r
684#define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value))\r
685\r
686/**\r
687 Retrieves a token number based on a GUID and a token name.\r
688\r
689 Returns the token number for the token specified by Guid and TokenName.\r
690 If TokenName is not a valid token in the token space, then the module will not build.\r
691\r
692 @param Guid Pointer to a 128-bit unique value that designates\r
693 which namespace to retrieve a value from.\r
694 @param TokenName The name of the PCD token to retrieve a current value for.\r
695\r
696 @return Return the token number.\r
697\r
698**/\r
699#define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid)\r
700\r
701/**\r
702 Retrieves an 8-bit PCD token value based on a GUID and a token name.\r
703\r
704 Returns the 8-bit value for the token specified by Guid and TokenName.\r
705 If TokenName is not a valid token in the token space specified by Guid,\r
706 then the module will not build.\r
707\r
708 If Guid is NULL, then ASSERT().\r
709\r
710 @param Guid Pointer to a 128-bit unique value that designates\r
711 which namespace to retrieve a value from.\r
712 @param TokenName The name of the PCD token to retrieve a current value for.\r
713\r
714 @return An 8-bit PCD token value.\r
715\r
716**/\r
717#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))\r
718\r
719/**\r
720 Retrieves a 16-bit PCD token value based on a GUID and a token name.\r
721\r
722 Returns the 16-bit value for the token specified by Guid and TokenName.\r
723 If TokenName is not a valid token in the token space specified by Guid,\r
724 then the module will not build.\r
725\r
726 If Guid is NULL, then ASSERT().\r
727\r
728 @param Guid Pointer to a 128-bit unique value that designates\r
729 which namespace to retrieve a value from.\r
730 @param TokenName The name of the PCD token to retrieve a current value for.\r
731\r
732 @return A 16-bit PCD token value.\r
733\r
734**/\r
735#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))\r
736\r
737\r
738/**\r
739 Retrieves a 32-bit PCD token value based on a GUID and a token name.\r
740\r
741 Returns the 32-bit value for the token specified by Guid and TokenName.\r
742 If TokenName is not a valid token in the token space specified by Guid,\r
743 then the module will not build.\r
744\r
745 If Guid is NULL, then ASSERT().\r
746\r
747 @param Guid Pointer to a 128-bit unique value that designates\r
748 which namespace to retrieve a value from.\r
749 @param TokenName The name of the PCD token to retrieve a current value for.\r
750\r
751 @return A 32-bit PCD token value.\r
752\r
753**/\r
754#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))\r
755\r
756\r
757/**\r
758 Retrieves a 64-bit PCD token value based on a GUID and a token name.\r
759\r
760 Returns the 64-bit value for the token specified by Guid and TokenName.\r
761 If TokenName is not a valid token in the token space specified by Guid,\r
762 then the module will not build.\r
763\r
764 If Guid is NULL, then ASSERT().\r
765\r
766 @param Guid Pointer to a 128-bit unique value that designates\r
767 which namespace to retrieve a value from.\r
768 @param TokenName The name of the PCD token to retrieve a current value for.\r
769\r
770 @return A 64-bit PCD token value.\r
771\r
772**/\r
773#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))\r
774\r
775\r
776/**\r
777 Retrieves a pointer to a PCD token buffer based on a GUID and a token name.\r
778\r
779 Returns a pointer to the buffer for the token specified by Guid and TokenName.\r
780 If TokenName is not a valid token in the token space specified by Guid,\r
781 then the module will not build.\r
782\r
783 If Guid is NULL, then ASSERT().\r
784\r
785 @param Guid Pointer to a 128-bit unique value that designates\r
786 which namespace to retrieve a value from.\r
787 @param TokenName The name of the PCD token to retrieve a current value for.\r
788\r
789 @return A pointer to a PCD token buffer.\r
790\r
791**/\r
792#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))\r
793\r
794\r
795/**\r
796 Retrieves a Boolean PCD token value based on a GUID and a token name.\r
797\r
798 Returns the Boolean value for the token specified by Guid and TokenName.\r
799 If TokenName is not a valid token in the token space specified by Guid,\r
800 then the module will not build.\r
801\r
802 If Guid is NULL, then ASSERT().\r
803\r
804 @param Guid Pointer to a 128-bit unique value that designates\r
805 which namespace to retrieve a value from.\r
806 @param TokenName The name of the PCD token to retrieve a current value for.\r
807\r
808 @return A Boolean PCD token value.\r
809\r
810**/\r
811#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))\r
812\r
813\r
814\r
815#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
816/**\r
817 Sets an 8-bit PCD token value based on a GUID and a token name.\r
818\r
819 Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.\r
820 If TokenName is not a valid token in the token space specified by Guid,\r
821 then the module will not build.\r
822\r
823 If Guid is NULL, then ASSERT().\r
824\r
825 @param Guid Pointer to a 128-bit unique value that designates\r
826 which namespace to retrieve a value from.\r
827 @param TokenName The name of the PCD token to set the current value for.\r
828 @param Value The 8-bit value to set.\r
829\r
830 @return Return the Value that was set.\r
831\r
832**/\r
833#define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
834\r
835\r
836/**\r
837 Sets a 16-bit PCD token value based on a GUID and a token name.\r
838\r
839 Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.\r
840 If TokenName is not a valid token in the token space specified by Guid,\r
841 then the module will not build.\r
842\r
843 If Guid is NULL, then ASSERT().\r
844\r
845 @param Guid Pointer to a 128-bit unique value that designates\r
846 which namespace to retrieve a value from.\r
847 @param TokenName The name of the PCD token to set the current value for.\r
848 @param Value The 16-bit value to set.\r
849\r
850 @return Return the Value that was set.\r
851\r
852**/\r
853#define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
854\r
855\r
856/**\r
857 Sets a 32-bit PCD token value based on a GUID and a token name.\r
858\r
859 Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.\r
860 If TokenName is not a valid token in the token space specified by Guid,\r
861 then the module will not build.\r
862\r
863 If Guid is NULL, then ASSERT().\r
864\r
865 @param Guid Pointer to a 128-bit unique value that designates\r
866 which namespace to retrieve a value from.\r
867 @param TokenName The name of the PCD token to set the current value for.\r
868 @param Value The 32-bit value to set.\r
869\r
870 @return Return the Value that was set.\r
871\r
872**/\r
873#define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
874\r
875\r
876/**\r
877 Sets a 64-bit PCD token value based on a GUID and a token name.\r
878\r
879 Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.\r
880 If TokenName is not a valid token in the token space specified by Guid,\r
881 then the module will not build.\r
882\r
883 If Guid is NULL, then ASSERT().\r
884\r
885 @param Guid Pointer to a 128-bit unique value that designates\r
886 which namespace to retrieve a value from.\r
887 @param TokenName The name of the PCD token to set the current value for.\r
888 @param Value The 64-bit value to set.\r
889\r
890 @return Return the Value that was set.\r
891\r
892**/\r
893#define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
894\r
895\r
896/**\r
897 Sets a pointer to a PCD token buffer based on a GUID and a token name.\r
898\r
899 Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.\r
900 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,\r
901 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return\r
902 NULL to indicate that the set operation was not actually performed. If SizeOfBuffer\r
903 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by\r
904 Guid and TokenName and NULL must be returned.\r
905 If TokenName is not a valid token in the token space specified by Guid,\r
906 then the module will not build.\r
907\r
908 If Guid is NULL, then ASSERT().\r
909 If SizeOfBuffer is NULL, then ASSERT().\r
910 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
911\r
912 @param Guid Pointer to a 128-bit unique value that designates\r
913 which namespace to retrieve a value from.\r
914 @param TokenName The name of the PCD token to set the current value for.\r
915 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
916 @param Buffer Pointer to the buffer to set.\r
917\r
918 @return Return the pointer to the Buffer that was set.\r
919\r
920**/\r
921#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \\r
922 LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))\r
923\r
924\r
925/**\r
926 Sets a Boolean PCD token value based on a GUID and a token name.\r
927\r
928 Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.\r
929 If TokenName is not a valid token in the token space specified by Guid,\r
930 then the module will not build.\r
931\r
932 If Guid is NULL, then ASSERT().\r
933\r
934 @param Guid Pointer to a 128-bit unique value that designates\r
935 which namespace to retrieve a value from.\r
936 @param TokenName The name of the PCD token to set the current value for.\r
937 @param Value The Boolean value to set.\r
938\r
939 @return Return the Value that was set.\r
940\r
941**/\r
942#define PcdSetExBool(Guid, TokenName, Value) \\r
943 LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
944#endif\r
945\r
946/**\r
947 Sets an 8-bit PCD token value based on a GUID and a token name.\r
948\r
949 Sets the 8-bit value for the token specified by Guid and TokenName.\r
950 If TokenName is not a valid token in the token space specified by Guid,\r
951 then the module will not build.\r
952\r
953 If Guid is NULL, then ASSERT().\r
954\r
955 @param Guid Pointer to a 128-bit unique value that designates\r
956 which namespace to retrieve a value from.\r
957 @param TokenName The name of the PCD token to set the current value for.\r
958 @param Value The 8-bit value to set.\r
959\r
960 @return The status of the set operation.\r
961\r
962**/\r
963#define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
964\r
965/**\r
966 Sets an 16-bit PCD token value based on a GUID and a token name.\r
967\r
968 Sets the 16-bit value for the token specified by Guid and TokenName.\r
969 If TokenName is not a valid token in the token space specified by Guid,\r
970 then the module will not build.\r
971\r
972 If Guid is NULL, then ASSERT().\r
973\r
974 @param Guid Pointer to a 128-bit unique value that designates\r
975 which namespace to retrieve a value from.\r
976 @param TokenName The name of the PCD token to set the current value for.\r
977 @param Value The 16-bit value to set.\r
978\r
979 @return The status of the set operation.\r
980\r
981**/\r
982#define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
983\r
984/**\r
985 Sets an 32-bit PCD token value based on a GUID and a token name.\r
986\r
987 Sets the 32-bit value for the token specified by Guid and TokenName.\r
988 If TokenName is not a valid token in the token space specified by Guid,\r
989 then the module will not build.\r
990\r
991 If Guid is NULL, then ASSERT().\r
992\r
993 @param Guid Pointer to a 128-bit unique value that designates\r
994 which namespace to retrieve a value from.\r
995 @param TokenName The name of the PCD token to set the current value for.\r
996 @param Value The 32-bit value to set.\r
997\r
998 @return The status of the set operation.\r
999\r
1000**/\r
1001#define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
1002\r
1003/**\r
1004 Sets an 64-bit PCD token value based on a GUID and a token name.\r
1005\r
1006 Sets the 64-bit value for the token specified by Guid and TokenName.\r
1007 If TokenName is not a valid token in the token space specified by Guid,\r
1008 then the module will not build.\r
1009\r
1010 If Guid is NULL, then ASSERT().\r
1011\r
1012 @param Guid Pointer to a 128-bit unique value that designates\r
1013 which namespace to retrieve a value from.\r
1014 @param TokenName The name of the PCD token to set the current value for.\r
1015 @param Value The 64-bit value to set.\r
1016\r
1017 @return The status of the set operation.\r
1018\r
1019**/\r
1020#define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
1021\r
1022/**\r
1023 Sets a pointer to a PCD token buffer based on a GUID and a token name.\r
1024\r
1025 Sets the buffer for the token specified by Guid and TokenName.\r
1026 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,\r
1027 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return\r
1028 RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.\r
1029 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size\r
1030 supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned.\r
1031 If TokenName is not a valid token in the token space specified by Guid,\r
1032 then the module will not build.\r
1033\r
1034 If Guid is NULL, then ASSERT().\r
1035 If SizeOfBuffer is NULL, then ASSERT().\r
1036 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1037\r
1038 @param Guid Pointer to a 128-bit unique value that designates\r
1039 which namespace to retrieve a value from.\r
1040 @param TokenName The name of the PCD token to set the current value for.\r
1041 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
1042 @param Buffer Pointer to the buffer to set.\r
1043\r
1044 @return The status of the set operation.\r
1045\r
1046**/\r
1047#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \\r
1048 LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))\r
1049\r
1050\r
1051/**\r
1052 Sets an boolean PCD token value based on a GUID and a token name.\r
1053\r
1054 Sets the boolean value for the token specified by Guid and TokenName.\r
1055 If TokenName is not a valid token in the token space specified by Guid,\r
1056 then the module will not build.\r
1057\r
1058 If Guid is NULL, then ASSERT().\r
1059\r
1060 @param Guid Pointer to a 128-bit unique value that designates\r
1061 which namespace to retrieve a value from.\r
1062 @param TokenName The name of the PCD token to set the current value for.\r
1063 @param Value The boolean value to set.\r
1064\r
1065 @return The status of the set operation.\r
1066\r
1067**/\r
1068#define PcdSetExBoolS(Guid, TokenName, Value) \\r
1069 LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
1070\r
1071/**\r
1072 This function provides a means by which SKU support can be established in the PCD infrastructure.\r
1073\r
1074 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
1075\r
1076 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values\r
1077 associated with a PCD token.\r
1078\r
1079 @return Return the SKU ID that was set.\r
1080\r
1081**/\r
1082UINTN\r
1083EFIAPI\r
1084LibPcdSetSku (\r
1085 IN UINTN SkuId\r
1086 );\r
1087\r
1088\r
1089/**\r
1090 This function provides a means by which to retrieve a value for a given PCD token.\r
1091\r
1092 Returns the 8-bit value for the token specified by TokenNumber.\r
1093\r
1094 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1095\r
1096 @return Returns the 8-bit value for the token specified by TokenNumber.\r
1097\r
1098**/\r
1099UINT8\r
1100EFIAPI\r
1101LibPcdGet8 (\r
1102 IN UINTN TokenNumber\r
1103 );\r
1104\r
1105\r
1106/**\r
1107 This function provides a means by which to retrieve a value for a given PCD token.\r
1108\r
1109 Returns the 16-bit value for the token specified by TokenNumber.\r
1110\r
1111 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1112\r
1113 @return Returns the 16-bit value for the token specified by TokenNumber.\r
1114\r
1115**/\r
1116UINT16\r
1117EFIAPI\r
1118LibPcdGet16 (\r
1119 IN UINTN TokenNumber\r
1120 );\r
1121\r
1122\r
1123/**\r
1124 This function provides a means by which to retrieve a value for a given PCD token.\r
1125\r
1126 Returns the 32-bit value for the token specified by TokenNumber.\r
1127\r
1128 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1129\r
1130 @return Returns the 32-bit value for the token specified by TokenNumber.\r
1131\r
1132**/\r
1133UINT32\r
1134EFIAPI\r
1135LibPcdGet32 (\r
1136 IN UINTN TokenNumber\r
1137 );\r
1138\r
1139\r
1140/**\r
1141 This function provides a means by which to retrieve a value for a given PCD token.\r
1142\r
1143 Returns the 64-bit value for the token specified by TokenNumber.\r
1144\r
1145 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1146\r
1147 @return Returns the 64-bit value for the token specified by TokenNumber.\r
1148\r
1149**/\r
1150UINT64\r
1151EFIAPI\r
1152LibPcdGet64 (\r
1153 IN UINTN TokenNumber\r
1154 );\r
1155\r
1156\r
1157/**\r
1158 This function provides a means by which to retrieve a value for a given PCD token.\r
1159\r
1160 Returns the pointer to the buffer of the token specified by TokenNumber.\r
1161\r
1162 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1163\r
1164 @return Returns the pointer to the token specified by TokenNumber.\r
1165\r
1166**/\r
1167VOID *\r
1168EFIAPI\r
1169LibPcdGetPtr (\r
1170 IN UINTN TokenNumber\r
1171 );\r
1172\r
1173\r
1174/**\r
1175 This function provides a means by which to retrieve a value for a given PCD token.\r
1176\r
1177 Returns the Boolean value of the token specified by TokenNumber.\r
1178\r
1179 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1180\r
1181 @return Returns the Boolean value of the token specified by TokenNumber.\r
1182\r
1183**/\r
1184BOOLEAN\r
1185EFIAPI\r
1186LibPcdGetBool (\r
1187 IN UINTN TokenNumber\r
1188 );\r
1189\r
1190\r
1191/**\r
1192 This function provides a means by which to retrieve the size of a given PCD token.\r
1193\r
1194 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1195\r
1196 @return Returns the size of the token specified by TokenNumber.\r
1197\r
1198**/\r
1199UINTN\r
1200EFIAPI\r
1201LibPcdGetSize (\r
1202 IN UINTN TokenNumber\r
1203 );\r
1204\r
1205\r
1206/**\r
1207 This function provides a means by which to retrieve a value for a given PCD token.\r
1208\r
1209 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
1210\r
1211 If Guid is NULL, then ASSERT().\r
1212\r
1213 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1214 which namespace to retrieve a value from.\r
1215 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1216\r
1217 @return Return the UINT8.\r
1218\r
1219**/\r
1220UINT8\r
1221EFIAPI\r
1222LibPcdGetEx8 (\r
1223 IN CONST GUID *Guid,\r
1224 IN UINTN TokenNumber\r
1225 );\r
1226\r
1227\r
1228/**\r
1229 This function provides a means by which to retrieve a value for a given PCD token.\r
1230\r
1231 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
1232\r
1233 If Guid is NULL, then ASSERT().\r
1234\r
1235 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1236 which namespace to retrieve a value from.\r
1237 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1238\r
1239 @return Return the UINT16.\r
1240\r
1241**/\r
1242UINT16\r
1243EFIAPI\r
1244LibPcdGetEx16 (\r
1245 IN CONST GUID *Guid,\r
1246 IN UINTN TokenNumber\r
1247 );\r
1248\r
1249\r
1250/**\r
1251 Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
1252 If Guid is NULL, then ASSERT().\r
1253\r
1254 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1255 which namespace to retrieve a value from.\r
1256 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1257\r
1258 @return Return the UINT32.\r
1259\r
1260**/\r
1261UINT32\r
1262EFIAPI\r
1263LibPcdGetEx32 (\r
1264 IN CONST GUID *Guid,\r
1265 IN UINTN TokenNumber\r
1266 );\r
1267\r
1268\r
1269/**\r
1270 This function provides a means by which to retrieve a value for a given PCD token.\r
1271\r
1272 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
1273\r
1274 If Guid is NULL, then ASSERT().\r
1275\r
1276 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1277 which namespace to retrieve a value from.\r
1278 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1279\r
1280 @return Return the UINT64.\r
1281\r
1282**/\r
1283UINT64\r
1284EFIAPI\r
1285LibPcdGetEx64 (\r
1286 IN CONST GUID *Guid,\r
1287 IN UINTN TokenNumber\r
1288 );\r
1289\r
1290\r
1291/**\r
1292 This function provides a means by which to retrieve a value for a given PCD token.\r
1293\r
1294 Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
1295\r
1296 If Guid is NULL, then ASSERT().\r
1297\r
1298 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1299 which namespace to retrieve a value from.\r
1300 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1301\r
1302 @return Return the VOID* pointer.\r
1303\r
1304**/\r
1305VOID *\r
1306EFIAPI\r
1307LibPcdGetExPtr (\r
1308 IN CONST GUID *Guid,\r
1309 IN UINTN TokenNumber\r
1310 );\r
1311\r
1312\r
1313/**\r
1314 This function provides a means by which to retrieve a value for a given PCD token.\r
1315\r
1316 Returns the Boolean value of the token specified by TokenNumber and Guid.\r
1317\r
1318 If Guid is NULL, then ASSERT().\r
1319\r
1320 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1321 which namespace to retrieve a value from.\r
1322 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1323\r
1324 @return Return the BOOLEAN.\r
1325\r
1326**/\r
1327BOOLEAN\r
1328EFIAPI\r
1329LibPcdGetExBool (\r
1330 IN CONST GUID *Guid,\r
1331 IN UINTN TokenNumber\r
1332 );\r
1333\r
1334\r
1335/**\r
1336 This function provides a means by which to retrieve the size of a given PCD token.\r
1337\r
1338 Returns the size of the token specified by TokenNumber and Guid.\r
1339\r
1340 If Guid is NULL, then ASSERT().\r
1341\r
1342 @param[in] Guid Pointer to a 128-bit unique value that designates\r
1343 which namespace to retrieve a value from.\r
1344 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1345\r
1346 @return Return the size.\r
1347\r
1348**/\r
1349UINTN\r
1350EFIAPI\r
1351LibPcdGetExSize (\r
1352 IN CONST GUID *Guid,\r
1353 IN UINTN TokenNumber\r
1354 );\r
1355\r
1356\r
1357#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
1358/**\r
1359 This function provides a means by which to set a value for a given PCD token.\r
1360\r
1361 Sets the 8-bit value for the token specified by TokenNumber\r
1362 to the value specified by Value. Value is returned.\r
1363\r
1364 @param[in] TokenNumber The PCD token number to set a current value for.\r
1365 @param[in] Value The 8-bit value to set.\r
1366\r
1367 @return Return the Value that was set.\r
1368\r
1369**/\r
1370UINT8\r
1371EFIAPI\r
1372LibPcdSet8 (\r
1373 IN UINTN TokenNumber,\r
1374 IN UINT8 Value\r
1375 );\r
1376\r
1377\r
1378/**\r
1379 This function provides a means by which to set a value for a given PCD token.\r
1380\r
1381 Sets the 16-bit value for the token specified by TokenNumber\r
1382 to the value specified by Value. Value is returned.\r
1383\r
1384 @param[in] TokenNumber The PCD token number to set a current value for.\r
1385 @param[in] Value The 16-bit value to set.\r
1386\r
1387 @return Return the Value that was set.\r
1388\r
1389**/\r
1390UINT16\r
1391EFIAPI\r
1392LibPcdSet16 (\r
1393 IN UINTN TokenNumber,\r
1394 IN UINT16 Value\r
1395 );\r
1396\r
1397\r
1398/**\r
1399 This function provides a means by which to set a value for a given PCD token.\r
1400\r
1401 Sets the 32-bit value for the token specified by TokenNumber\r
1402 to the value specified by Value. Value is returned.\r
1403\r
1404 @param[in] TokenNumber The PCD token number to set a current value for.\r
1405 @param[in] Value The 32-bit value to set.\r
1406\r
1407 @return Return the Value that was set.\r
1408\r
1409**/\r
1410UINT32\r
1411EFIAPI\r
1412LibPcdSet32 (\r
1413 IN UINTN TokenNumber,\r
1414 IN UINT32 Value\r
1415 );\r
1416\r
1417\r
1418/**\r
1419 This function provides a means by which to set a value for a given PCD token.\r
1420\r
1421 Sets the 64-bit value for the token specified by TokenNumber\r
1422 to the value specified by Value. Value is returned.\r
1423\r
1424 @param[in] TokenNumber The PCD token number to set a current value for.\r
1425 @param[in] Value The 64-bit value to set.\r
1426\r
1427 @return Return the Value that was set.\r
1428\r
1429**/\r
1430UINT64\r
1431EFIAPI\r
1432LibPcdSet64 (\r
1433 IN UINTN TokenNumber,\r
1434 IN UINT64 Value\r
1435 );\r
1436\r
1437\r
1438/**\r
1439 This function provides a means by which to set a value for a given PCD token.\r
1440\r
1441 Sets a buffer for the token specified by TokenNumber to the value\r
1442 specified by Buffer and SizeOfBuffer. Buffer is returned.\r
1443 If SizeOfBuffer is greater than the maximum size support by TokenNumber,\r
1444 then set SizeOfBuffer to the maximum size supported by TokenNumber and\r
1445 return NULL to indicate that the set operation was not actually performed.\r
1446\r
1447 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the\r
1448 maximum size supported by TokenName and NULL must be returned.\r
1449\r
1450 If SizeOfBuffer is NULL, then ASSERT().\r
1451 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1452\r
1453 @param[in] TokenNumber The PCD token number to set a current value for.\r
1454 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1455 @param[in] Buffer A pointer to the buffer to set.\r
1456\r
1457 @return Return the pointer for the Buffer that was set.\r
1458\r
1459**/\r
1460VOID *\r
1461EFIAPI\r
1462LibPcdSetPtr (\r
1463 IN UINTN TokenNumber,\r
1464 IN OUT UINTN *SizeOfBuffer,\r
1465 IN CONST VOID *Buffer\r
1466 );\r
1467\r
1468\r
1469/**\r
1470 This function provides a means by which to set a value for a given PCD token.\r
1471\r
1472 Sets the Boolean value for the token specified by TokenNumber\r
1473 to the value specified by Value. Value is returned.\r
1474\r
1475 @param[in] TokenNumber The PCD token number to set a current value for.\r
1476 @param[in] Value The boolean value to set.\r
1477\r
1478 @return Return the Value that was set.\r
1479\r
1480**/\r
1481BOOLEAN\r
1482EFIAPI\r
1483LibPcdSetBool (\r
1484 IN UINTN TokenNumber,\r
1485 IN BOOLEAN Value\r
1486 );\r
1487\r
1488\r
1489/**\r
1490 This function provides a means by which to set a value for a given PCD token.\r
1491\r
1492 Sets the 8-bit value for the token specified by TokenNumber and\r
1493 Guid to the value specified by Value. Value is returned.\r
1494\r
1495 If Guid is NULL, then ASSERT().\r
1496\r
1497 @param[in] Guid Pointer to a 128-bit unique value that\r
1498 designates which namespace to set a value from.\r
1499 @param[in] TokenNumber The PCD token number to set a current value for.\r
1500 @param[in] Value The 8-bit value to set.\r
1501\r
1502 @return Return the Value that was set.\r
1503\r
1504**/\r
1505UINT8\r
1506EFIAPI\r
1507LibPcdSetEx8 (\r
1508 IN CONST GUID *Guid,\r
1509 IN UINTN TokenNumber,\r
1510 IN UINT8 Value\r
1511 );\r
1512\r
1513\r
1514/**\r
1515 This function provides a means by which to set a value for a given PCD token.\r
1516\r
1517 Sets the 16-bit value for the token specified by TokenNumber and\r
1518 Guid to the value specified by Value. Value is returned.\r
1519\r
1520 If Guid is NULL, then ASSERT().\r
1521\r
1522 @param[in] Guid Pointer to a 128-bit unique value that\r
1523 designates which namespace to set a value from.\r
1524 @param[in] TokenNumber The PCD token number to set a current value for.\r
1525 @param[in] Value The 16-bit value to set.\r
1526\r
1527 @return Return the Value that was set.\r
1528\r
1529**/\r
1530UINT16\r
1531EFIAPI\r
1532LibPcdSetEx16 (\r
1533 IN CONST GUID *Guid,\r
1534 IN UINTN TokenNumber,\r
1535 IN UINT16 Value\r
1536 );\r
1537\r
1538\r
1539/**\r
1540 This function provides a means by which to set a value for a given PCD token.\r
1541\r
1542 Sets the 32-bit value for the token specified by TokenNumber and\r
1543 Guid to the value specified by Value. Value is returned.\r
1544\r
1545 If Guid is NULL, then ASSERT().\r
1546\r
1547 @param[in] Guid Pointer to a 128-bit unique value that\r
1548 designates which namespace to set a value from.\r
1549 @param[in] TokenNumber The PCD token number to set a current value for.\r
1550 @param[in] Value The 32-bit value to set.\r
1551\r
1552 @return Return the Value that was set.\r
1553\r
1554**/\r
1555UINT32\r
1556EFIAPI\r
1557LibPcdSetEx32 (\r
1558 IN CONST GUID *Guid,\r
1559 IN UINTN TokenNumber,\r
1560 IN UINT32 Value\r
1561 );\r
1562\r
1563\r
1564/**\r
1565 This function provides a means by which to set a value for a given PCD token.\r
1566\r
1567 Sets the 64-bit value for the token specified by TokenNumber and\r
1568 Guid to the value specified by Value. Value is returned.\r
1569\r
1570 If Guid is NULL, then ASSERT().\r
1571\r
1572 @param[in] Guid Pointer to a 128-bit unique value that\r
1573 designates which namespace to set a value from.\r
1574 @param[in] TokenNumber The PCD token number to set a current value for.\r
1575 @param[in] Value The 64-bit value to set.\r
1576\r
1577 @return Return the Value that was set.\r
1578\r
1579**/\r
1580UINT64\r
1581EFIAPI\r
1582LibPcdSetEx64 (\r
1583 IN CONST GUID *Guid,\r
1584 IN UINTN TokenNumber,\r
1585 IN UINT64 Value\r
1586 );\r
1587\r
1588\r
1589/**\r
1590 This function provides a means by which to set a value for a given PCD token.\r
1591\r
1592 Sets a buffer for the token specified by TokenNumber to the value specified by\r
1593 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than\r
1594 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size\r
1595 supported by TokenNumber and return NULL to indicate that the set operation\r
1596 was not actually performed.\r
1597\r
1598 If Guid is NULL, then ASSERT().\r
1599 If SizeOfBuffer is NULL, then ASSERT().\r
1600 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1601\r
1602 @param[in] Guid Pointer to a 128-bit unique value that\r
1603 designates which namespace to set a value from.\r
1604 @param[in] TokenNumber The PCD token number to set a current value for.\r
1605 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1606 @param[in] Buffer A pointer to the buffer to set.\r
1607\r
1608 @return Return the pointer to the Buffer that was set.\r
1609\r
1610**/\r
1611VOID *\r
1612EFIAPI\r
1613LibPcdSetExPtr (\r
1614 IN CONST GUID *Guid,\r
1615 IN UINTN TokenNumber,\r
1616 IN OUT UINTN *SizeOfBuffer,\r
1617 IN VOID *Buffer\r
1618 );\r
1619\r
1620\r
1621/**\r
1622 This function provides a means by which to set a value for a given PCD token.\r
1623\r
1624 Sets the Boolean value for the token specified by TokenNumber and\r
1625 Guid to the value specified by Value. Value is returned.\r
1626\r
1627 If Guid is NULL, then ASSERT().\r
1628\r
1629 @param[in] Guid Pointer to a 128-bit unique value that\r
1630 designates which namespace to set a value from.\r
1631 @param[in] TokenNumber The PCD token number to set a current value for.\r
1632 @param[in] Value The Boolean value to set.\r
1633\r
1634 @return Return the Value that was set.\r
1635\r
1636**/\r
1637BOOLEAN\r
1638EFIAPI\r
1639LibPcdSetExBool (\r
1640 IN CONST GUID *Guid,\r
1641 IN UINTN TokenNumber,\r
1642 IN BOOLEAN Value\r
1643 );\r
1644#endif\r
1645\r
1646/**\r
1647 This function provides a means by which to set a value for a given PCD token.\r
1648\r
1649 Sets the 8-bit value for the token specified by TokenNumber\r
1650 to the value specified by Value.\r
1651\r
1652 @param[in] TokenNumber The PCD token number to set a current value for.\r
1653 @param[in] Value The 8-bit value to set.\r
1654\r
1655 @return The status of the set operation.\r
1656\r
1657**/\r
1658RETURN_STATUS\r
1659EFIAPI\r
1660LibPcdSet8S (\r
1661 IN UINTN TokenNumber,\r
1662 IN UINT8 Value\r
1663 );\r
1664\r
1665/**\r
1666 This function provides a means by which to set a value for a given PCD token.\r
1667\r
1668 Sets the 16-bit value for the token specified by TokenNumber\r
1669 to the value specified by Value.\r
1670\r
1671 @param[in] TokenNumber The PCD token number to set a current value for.\r
1672 @param[in] Value The 16-bit value to set.\r
1673\r
1674 @return The status of the set operation.\r
1675\r
1676**/\r
1677RETURN_STATUS\r
1678EFIAPI\r
1679LibPcdSet16S (\r
1680 IN UINTN TokenNumber,\r
1681 IN UINT16 Value\r
1682 );\r
1683\r
1684/**\r
1685 This function provides a means by which to set a value for a given PCD token.\r
1686\r
1687 Sets the 32-bit value for the token specified by TokenNumber\r
1688 to the value specified by Value.\r
1689\r
1690 @param[in] TokenNumber The PCD token number to set a current value for.\r
1691 @param[in] Value The 32-bit value to set.\r
1692\r
1693 @return The status of the set operation.\r
1694\r
1695**/\r
1696RETURN_STATUS\r
1697EFIAPI\r
1698LibPcdSet32S (\r
1699 IN UINTN TokenNumber,\r
1700 IN UINT32 Value\r
1701 );\r
1702\r
1703/**\r
1704 This function provides a means by which to set a value for a given PCD token.\r
1705\r
1706 Sets the 64-bit value for the token specified by TokenNumber\r
1707 to the value specified by Value.\r
1708\r
1709 @param[in] TokenNumber The PCD token number to set a current value for.\r
1710 @param[in] Value The 64-bit value to set.\r
1711\r
1712 @return The status of the set operation.\r
1713\r
1714**/\r
1715RETURN_STATUS\r
1716EFIAPI\r
1717LibPcdSet64S (\r
1718 IN UINTN TokenNumber,\r
1719 IN UINT64 Value\r
1720 );\r
1721\r
1722/**\r
1723 This function provides a means by which to set a value for a given PCD token.\r
1724\r
1725 Sets a buffer for the token specified by TokenNumber to the value specified\r
1726 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size\r
1727 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by\r
1728 TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation\r
1729 was not actually performed.\r
1730\r
1731 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the\r
1732 maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned.\r
1733\r
1734 If SizeOfBuffer is NULL, then ASSERT().\r
1735 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1736\r
1737 @param[in] TokenNumber The PCD token number to set a current value for.\r
1738 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1739 @param[in] Buffer A pointer to the buffer to set.\r
1740\r
1741 @return The status of the set operation.\r
1742\r
1743**/\r
1744RETURN_STATUS\r
1745EFIAPI\r
1746LibPcdSetPtrS (\r
1747 IN UINTN TokenNumber,\r
1748 IN OUT UINTN *SizeOfBuffer,\r
1749 IN CONST VOID *Buffer\r
1750 );\r
1751\r
1752/**\r
1753 This function provides a means by which to set a value for a given PCD token.\r
1754\r
1755 Sets the boolean value for the token specified by TokenNumber\r
1756 to the value specified by Value.\r
1757\r
1758 @param[in] TokenNumber The PCD token number to set a current value for.\r
1759 @param[in] Value The boolean value to set.\r
1760\r
1761 @return The status of the set operation.\r
1762\r
1763**/\r
1764RETURN_STATUS\r
1765EFIAPI\r
1766LibPcdSetBoolS (\r
1767 IN UINTN TokenNumber,\r
1768 IN BOOLEAN Value\r
1769 );\r
1770\r
1771/**\r
1772 This function provides a means by which to set a value for a given PCD token.\r
1773\r
1774 Sets the 8-bit value for the token specified by TokenNumber\r
1775 to the value specified by Value.\r
1776\r
1777 If Guid is NULL, then ASSERT().\r
1778\r
1779 @param[in] Guid The pointer to a 128-bit unique value that\r
1780 designates which namespace to set a value from.\r
1781 @param[in] TokenNumber The PCD token number to set a current value for.\r
1782 @param[in] Value The 8-bit value to set.\r
1783\r
1784 @return The status of the set operation.\r
1785\r
1786**/\r
1787RETURN_STATUS\r
1788EFIAPI\r
1789LibPcdSetEx8S (\r
1790 IN CONST GUID *Guid,\r
1791 IN UINTN TokenNumber,\r
1792 IN UINT8 Value\r
1793 );\r
1794\r
1795/**\r
1796 This function provides a means by which to set a value for a given PCD token.\r
1797\r
1798 Sets the 16-bit value for the token specified by TokenNumber\r
1799 to the value specified by Value.\r
1800\r
1801 If Guid is NULL, then ASSERT().\r
1802\r
1803 @param[in] Guid The pointer to a 128-bit unique value that\r
1804 designates which namespace to set a value from.\r
1805 @param[in] TokenNumber The PCD token number to set a current value for.\r
1806 @param[in] Value The 16-bit value to set.\r
1807\r
1808 @return The status of the set operation.\r
1809\r
1810**/\r
1811RETURN_STATUS\r
1812EFIAPI\r
1813LibPcdSetEx16S (\r
1814 IN CONST GUID *Guid,\r
1815 IN UINTN TokenNumber,\r
1816 IN UINT16 Value\r
1817 );\r
1818\r
1819/**\r
1820 This function provides a means by which to set a value for a given PCD token.\r
1821\r
1822 Sets the 32-bit value for the token specified by TokenNumber\r
1823 to the value specified by Value.\r
1824\r
1825 If Guid is NULL, then ASSERT().\r
1826\r
1827 @param[in] Guid The pointer to a 128-bit unique value that\r
1828 designates which namespace to set a value from.\r
1829 @param[in] TokenNumber The PCD token number to set a current value for.\r
1830 @param[in] Value The 32-bit value to set.\r
1831\r
1832 @return The status of the set operation.\r
1833\r
1834**/\r
1835RETURN_STATUS\r
1836EFIAPI\r
1837LibPcdSetEx32S (\r
1838 IN CONST GUID *Guid,\r
1839 IN UINTN TokenNumber,\r
1840 IN UINT32 Value\r
1841 );\r
1842\r
1843/**\r
1844 This function provides a means by which to set a value for a given PCD token.\r
1845\r
1846 Sets the 64-bit value for the token specified by TokenNumber\r
1847 to the value specified by Value.\r
1848\r
1849 If Guid is NULL, then ASSERT().\r
1850\r
1851 @param[in] Guid The pointer to a 128-bit unique value that\r
1852 designates which namespace to set a value from.\r
1853 @param[in] TokenNumber The PCD token number to set a current value for.\r
1854 @param[in] Value The 64-bit value to set.\r
1855\r
1856 @return The status of the set operation.\r
1857\r
1858**/\r
1859RETURN_STATUS\r
1860EFIAPI\r
1861LibPcdSetEx64S (\r
1862 IN CONST GUID *Guid,\r
1863 IN UINTN TokenNumber,\r
1864 IN UINT64 Value\r
1865 );\r
1866\r
1867/**\r
1868 This function provides a means by which to set a value for a given PCD token.\r
1869\r
1870 Sets a buffer for the token specified by TokenNumber to the value specified by\r
1871 Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size\r
1872 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by\r
1873 TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation\r
1874 was not actually performed.\r
1875\r
1876 If Guid is NULL, then ASSERT().\r
1877 If SizeOfBuffer is NULL, then ASSERT().\r
1878 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1879\r
1880 @param[in] Guid Pointer to a 128-bit unique value that\r
1881 designates which namespace to set a value from.\r
1882 @param[in] TokenNumber The PCD token number to set a current value for.\r
1883 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1884 @param[in] Buffer A pointer to the buffer to set.\r
1885\r
1886 @return The status of the set operation.\r
1887\r
1888**/\r
1889RETURN_STATUS\r
1890EFIAPI\r
1891LibPcdSetExPtrS (\r
1892 IN CONST GUID *Guid,\r
1893 IN UINTN TokenNumber,\r
1894 IN OUT UINTN *SizeOfBuffer,\r
1895 IN VOID *Buffer\r
1896 );\r
1897\r
1898/**\r
1899 This function provides a means by which to set a value for a given PCD token.\r
1900\r
1901 Sets the boolean value for the token specified by TokenNumber\r
1902 to the value specified by Value.\r
1903\r
1904 If Guid is NULL, then ASSERT().\r
1905\r
1906 @param[in] Guid The pointer to a 128-bit unique value that\r
1907 designates which namespace to set a value from.\r
1908 @param[in] TokenNumber The PCD token number to set a current value for.\r
1909 @param[in] Value The boolean value to set.\r
1910\r
1911 @return The status of the set operation.\r
1912\r
1913**/\r
1914RETURN_STATUS\r
1915EFIAPI\r
1916LibPcdSetExBoolS (\r
1917 IN CONST GUID *Guid,\r
1918 IN UINTN TokenNumber,\r
1919 IN BOOLEAN Value\r
1920 );\r
1921\r
1922/**\r
1923 This notification function serves two purposes.\r
1924\r
1925 Firstly, it notifies the module that did the registration that the value of this\r
1926 PCD token has been set.\r
1927 Secondly, it provides a mechanism for the module that did the registration to intercept\r
1928 the set operation and override the value been set if necessary. After the invocation of\r
1929 the callback function, TokenData will be used by PCD service PEIM or driver to modify th\r
1930 internal data in PCD database.\r
1931\r
1932 @param[in] CallBackGuid The PCD token GUID being set.\r
1933 @param[in] CallBackToken The PCD token number being set.\r
1934 @param[in, out] TokenData A pointer to the token data being set.\r
1935 @param[in] TokenDataSize The size, in bytes, of the data being set.\r
1936\r
1937**/\r
1938typedef\r
1939VOID\r
1940(EFIAPI *PCD_CALLBACK)(\r
1941 IN CONST GUID *CallBackGuid, OPTIONAL\r
1942 IN UINTN CallBackToken,\r
1943 IN OUT VOID *TokenData,\r
1944 IN UINTN TokenDataSize\r
1945 );\r
1946\r
1947\r
1948/**\r
1949 Set up a notification function that is called when a specified token is set.\r
1950\r
1951 When the token specified by TokenNumber and Guid is set,\r
1952 then notification function specified by NotificationFunction is called.\r
1953 If Guid is NULL, then the default token space is used.\r
1954 If NotificationFunction is NULL, then ASSERT().\r
1955\r
1956 @param[in] Guid Pointer to a 128-bit unique value that designates which\r
1957 namespace to set a value from. If NULL, then the default\r
1958 token space is used.\r
1959 @param[in] TokenNumber The PCD token number to monitor.\r
1960 @param[in] NotificationFunction The function to call when the token\r
1961 specified by Guid and TokenNumber is set.\r
1962\r
1963**/\r
1964VOID\r
1965EFIAPI\r
1966LibPcdCallbackOnSet (\r
1967 IN CONST GUID *Guid, OPTIONAL\r
1968 IN UINTN TokenNumber,\r
1969 IN PCD_CALLBACK NotificationFunction\r
1970 );\r
1971\r
1972\r
1973/**\r
1974 Disable a notification function that was established with LibPcdCallbackonSet().\r
1975\r
1976 Disable a notification function that was previously established with LibPcdCallbackOnSet().\r
1977 If NotificationFunction is NULL, then ASSERT().\r
1978 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,\r
1979 and NotificationFunction, then ASSERT().\r
1980\r
1981 @param[in] Guid Specify the GUID token space.\r
1982 @param[in] TokenNumber Specify the token number.\r
1983 @param[in] NotificationFunction The callback function to be unregistered.\r
1984\r
1985**/\r
1986VOID\r
1987EFIAPI\r
1988LibPcdCancelCallback (\r
1989 IN CONST GUID *Guid, OPTIONAL\r
1990 IN UINTN TokenNumber,\r
1991 IN PCD_CALLBACK NotificationFunction\r
1992 );\r
1993\r
1994\r
1995/**\r
1996 Retrieves the next token in a token space.\r
1997\r
1998 Retrieves the next PCD token number from the token space specified by Guid.\r
1999 If Guid is NULL, then the default token space is used. If TokenNumber is 0,\r
2000 then the first token number is returned. Otherwise, the token number that\r
2001 follows TokenNumber in the token space is returned. If TokenNumber is the last\r
2002 token number in the token space, then 0 is returned.\r
2003\r
2004 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().\r
2005\r
2006 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace\r
2007 to set a value from. If NULL, then the default token space is used.\r
2008 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD\r
2009 token number.\r
2010\r
2011 @return The next valid token number.\r
2012\r
2013**/\r
2014UINTN\r
2015EFIAPI\r
2016LibPcdGetNextToken (\r
2017 IN CONST GUID *Guid, OPTIONAL\r
2018 IN UINTN TokenNumber\r
2019 );\r
2020\r
2021\r
2022\r
2023/**\r
2024 Used to retrieve the list of available PCD token space GUIDs.\r
2025\r
2026 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces\r
2027 in the platform.\r
2028 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.\r
2029 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.\r
2030\r
2031 @param TokenSpaceGuid Pointer to the a PCD token space GUID\r
2032\r
2033 @return The next valid token namespace.\r
2034\r
2035**/\r
2036GUID *\r
2037EFIAPI\r
2038LibPcdGetNextTokenSpace (\r
2039 IN CONST GUID *TokenSpaceGuid\r
2040 );\r
2041\r
2042\r
2043/**\r
2044 Sets a value of a patchable PCD entry that is type pointer.\r
2045\r
2046 Sets the PCD entry specified by PatchVariable to the value specified by Buffer\r
2047 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than\r
2048 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return\r
2049 NULL to indicate that the set operation was not actually performed.\r
2050 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
2051 MaximumDatumSize and NULL must be returned.\r
2052\r
2053 If PatchVariable is NULL, then ASSERT().\r
2054 If SizeOfBuffer is NULL, then ASSERT().\r
2055 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
2056\r
2057 @param[out] PatchVariable A pointer to the global variable in a module that is\r
2058 the target of the set operation.\r
2059 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
2060 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
2061 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
2062\r
2063 @return Return the pointer to the Buffer that was set.\r
2064\r
2065**/\r
2066VOID *\r
2067EFIAPI\r
2068LibPatchPcdSetPtr (\r
2069 OUT VOID *PatchVariable,\r
2070 IN UINTN MaximumDatumSize,\r
2071 IN OUT UINTN *SizeOfBuffer,\r
2072 IN CONST VOID *Buffer\r
2073 );\r
2074\r
2075/**\r
2076 Sets a value of a patchable PCD entry that is type pointer.\r
2077\r
2078 Sets the PCD entry specified by PatchVariable to the value specified\r
2079 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
2080 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
2081 to indicate that the set operation was not actually performed.\r
2082 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
2083 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
2084\r
2085 If PatchVariable is NULL, then ASSERT().\r
2086 If SizeOfBuffer is NULL, then ASSERT().\r
2087 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
2088\r
2089 @param[out] PatchVariable A pointer to the global variable in a module that is\r
2090 the target of the set operation.\r
2091 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
2092 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
2093 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
2094\r
2095 @return The status of the set operation.\r
2096\r
2097**/\r
2098RETURN_STATUS\r
2099EFIAPI\r
2100LibPatchPcdSetPtrS (\r
2101 OUT VOID *PatchVariable,\r
2102 IN UINTN MaximumDatumSize,\r
2103 IN OUT UINTN *SizeOfBuffer,\r
2104 IN CONST VOID *Buffer\r
2105 );\r
2106\r
2107/**\r
2108 Sets a value and size of a patchable PCD entry that is type pointer.\r
2109\r
2110 Sets the PCD entry specified by PatchVariable to the value specified by Buffer\r
2111 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than\r
2112 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return\r
2113 NULL to indicate that the set operation was not actually performed.\r
2114 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
2115 MaximumDatumSize and NULL must be returned.\r
2116\r
2117 If PatchVariable is NULL, then ASSERT().\r
2118 If SizeOfPatchVariable is NULL, then ASSERT().\r
2119 If SizeOfBuffer is NULL, then ASSERT().\r
2120 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
2121\r
2122 @param[out] PatchVariable A pointer to the global variable in a module that is\r
2123 the target of the set operation.\r
2124 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
2125 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
2126 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
2127 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
2128\r
2129 @return Return the pointer to the Buffer that was set.\r
2130\r
2131**/\r
2132VOID *\r
2133EFIAPI\r
2134LibPatchPcdSetPtrAndSize (\r
2135 OUT VOID *PatchVariable,\r
2136 OUT UINTN *SizeOfPatchVariable,\r
2137 IN UINTN MaximumDatumSize,\r
2138 IN OUT UINTN *SizeOfBuffer,\r
2139 IN CONST VOID *Buffer\r
2140 );\r
2141\r
2142/**\r
2143 Sets a value and size of a patchable PCD entry that is type pointer.\r
2144\r
2145 Sets the PCD entry specified by PatchVariable to the value specified\r
2146 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
2147 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
2148 to indicate that the set operation was not actually performed.\r
2149 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
2150 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
2151\r
2152 If PatchVariable is NULL, then ASSERT().\r
2153 If SizeOfPatchVariable is NULL, then ASSERT().\r
2154 If SizeOfBuffer is NULL, then ASSERT().\r
2155 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
2156\r
2157 @param[out] PatchVariable A pointer to the global variable in a module that is\r
2158 the target of the set operation.\r
2159 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
2160 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
2161 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
2162 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
2163\r
2164 @return The status of the set operation.\r
2165\r
2166**/\r
2167RETURN_STATUS\r
2168EFIAPI\r
2169LibPatchPcdSetPtrAndSizeS (\r
2170 OUT VOID *PatchVariable,\r
2171 OUT UINTN *SizeOfPatchVariable,\r
2172 IN UINTN MaximumDatumSize,\r
2173 IN OUT UINTN *SizeOfBuffer,\r
2174 IN CONST VOID *Buffer\r
2175 );\r
2176\r
2177typedef enum {\r
2178 PCD_TYPE_8,\r
2179 PCD_TYPE_16,\r
2180 PCD_TYPE_32,\r
2181 PCD_TYPE_64,\r
2182 PCD_TYPE_BOOL,\r
2183 PCD_TYPE_PTR\r
2184} PCD_TYPE;\r
2185\r
2186typedef struct {\r
2187 ///\r
2188 /// The returned information associated with the requested TokenNumber. If\r
2189 /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.\r
2190 ///\r
2191 PCD_TYPE PcdType;\r
2192 ///\r
2193 /// The size of the data in bytes associated with the TokenNumber specified. If\r
2194 /// TokenNumber is 0, then PcdSize is set 0.\r
2195 ///\r
2196 UINTN PcdSize;\r
2197 ///\r
2198 /// The null-terminated ASCII string associated with a given token. If the\r
2199 /// TokenNumber specified was 0, then this field corresponds to the null-terminated\r
2200 /// ASCII string associated with the token's namespace Guid. If NULL, there is no\r
2201 /// name associated with this request.\r
2202 ///\r
2203 CHAR8 *PcdName;\r
2204} PCD_INFO;\r
2205\r
2206\r
2207/**\r
2208 Retrieve additional information associated with a PCD token.\r
2209\r
2210 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
2211 human readable name that is associated with the token.\r
2212\r
2213 If TokenNumber is not in the default token space specified, then ASSERT().\r
2214\r
2215 @param[in] TokenNumber The PCD token number.\r
2216 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
2217 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
2218**/\r
2219VOID\r
2220EFIAPI\r
2221LibPcdGetInfo (\r
2222 IN UINTN TokenNumber,\r
2223 OUT PCD_INFO *PcdInfo\r
2224 );\r
2225\r
2226/**\r
2227 Retrieve additional information associated with a PCD token.\r
2228\r
2229 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
2230 human readable name that is associated with the token.\r
2231\r
2232 If TokenNumber is not in the token space specified by Guid, then ASSERT().\r
2233\r
2234 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
2235 @param[in] TokenNumber The PCD token number.\r
2236 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
2237 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
2238**/\r
2239VOID\r
2240EFIAPI\r
2241LibPcdGetInfoEx (\r
2242 IN CONST GUID *Guid,\r
2243 IN UINTN TokenNumber,\r
2244 OUT PCD_INFO *PcdInfo\r
2245 );\r
2246\r
2247/**\r
2248 Retrieve the currently set SKU Id.\r
2249\r
2250 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
2251 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
2252 Id is returned.\r
2253**/\r
2254UINTN\r
2255EFIAPI\r
2256LibPcdGetSku (\r
2257 VOID\r
2258 );\r
2259\r
2260#endif\r