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