]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PcdLib.h
BaseTools: Add NULL pointer check in AutoGen code
[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
345 LibPatchPcdSetPtr ( \\r
346 _gPcd_BinaryPatch_##TokenName, \\r
347 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \\r
348 (Size), \\r
349 (Buffer) \\r
350 )\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
9a355841 436#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
64735d24 437/**\r
438 Sets an 8-bit PCD token value based on a token name.\r
439\r
440 Sets the 8-bit value for the token specified by TokenName. Value is returned.\r
441 If TokenName is not a valid token in the token space, then the module will not build.\r
442\r
443 @param TokenName The name of the PCD token to retrieve a current value for.\r
444 @param Value The 8-bit value to set.\r
445 \r
7b5b3124 446 @return Return the Value that was set.\r
64735d24 447\r
448**/\r
fb3df220 449#define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))\r
64735d24 450\r
451\r
452/**\r
453 Sets a 16-bit PCD token value based on a token name.\r
454\r
455 Sets the 16-bit value for the token specified by TokenName. Value is returned.\r
456 If TokenName is not a valid token in the token space, then the module will not build.\r
457\r
458 @param TokenName The name of the PCD token to retrieve a current value for.\r
459 @param Value The 16-bit value to set.\r
460\r
7b5b3124 461 @return Return the Value that was set.\r
64735d24 462\r
463**/\r
fb3df220 464#define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))\r
64735d24 465\r
466\r
467/**\r
468 Sets a 32-bit PCD token value based on a token name.\r
469\r
470 Sets the 32-bit value for the token specified by TokenName. Value is returned.\r
471 If TokenName is not a valid token in the token space, then the module will not build.\r
472\r
473 @param TokenName The name of the PCD token to retrieve a current value for.\r
474 @param Value The 32-bit value to set.\r
475\r
7b5b3124 476 @return Return the Value that was set.\r
64735d24 477\r
478**/\r
fb3df220 479#define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))\r
64735d24 480\r
481\r
482/**\r
483 Sets a 64-bit PCD token value based on a token name.\r
484\r
485 Sets the 64-bit value for the token specified by TokenName. Value is returned.\r
486 If TokenName is not a valid token in the token space, then the module will not build.\r
487\r
488 @param TokenName The name of the PCD token to retrieve a current value for.\r
489 @param Value The 64-bit value to set.\r
490\r
7b5b3124 491 @return Return the Value that was set.\r
64735d24 492\r
493**/\r
fb3df220 494#define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))\r
64735d24 495\r
496\r
497/**\r
498 Sets a pointer to a PCD token buffer based on a token name.\r
499\r
500 Sets the buffer for the token specified by TokenName. Buffer is returned. \r
501 If SizeOfBuffer is greater than the maximum size supported by TokenName, \r
502 then set SizeOfBuffer to the maximum size supported by TokenName and return NULL \r
503 to indicate that the set operation was not actually performed. If SizeOfBuffer \r
504 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported \r
9a355841 505 by TokenName and NULL must be returned.\r
64735d24 506 If TokenName is not a valid token in the token space, then the module will not build.\r
507 \r
508 If SizeOfBuffer is NULL, then ASSERT().\r
509 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
510 \r
511 @param TokenName The name of the PCD token to set the current value for.\r
512 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
513 @param Buffer A pointer to the buffer to set.\r
514\r
7b5b3124 515 @return Return the pointer to the Buffer that was set.\r
64735d24 516\r
517**/\r
fb3df220 518#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \\r
519 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))\r
64735d24 520 \r
521/**\r
522 Sets a Boolean PCD token value based on a token name.\r
523\r
524 Sets the Boolean 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 set the current value for.\r
528 @param Buffer The Boolean value to set.\r
529\r
7b5b3124 530 @return Return the Value that was set.\r
64735d24 531\r
532**/\r
fb3df220 533#define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))\r
9a355841
SZ
534#endif\r
535\r
536/**\r
537 Sets a 8-bit PCD token value based on a token name.\r
538\r
539 Sets the 8-bit value for the token specified by TokenName.\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 8-bit value to set.\r
544\r
545 @return The status of the set operation.\r
546\r
547**/\r
548#define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value))\r
549\r
550/**\r
551 Sets a 16-bit PCD token value based on a token name.\r
552\r
553 Sets the 16-bit value for the token specified by TokenName.\r
554 If TokenName is not a valid token in the token space, then the module will not build.\r
555\r
556 @param TokenName The name of the PCD token to retrieve a current value for.\r
557 @param Value The 16-bit value to set.\r
558\r
559 @return The status of the set operation.\r
fb3df220 560\r
9a355841
SZ
561**/\r
562#define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value))\r
563\r
564/**\r
565 Sets a 32-bit PCD token value based on a token name.\r
566\r
567 Sets the 32-bit value for the token specified by TokenName.\r
568 If TokenName is not a valid token in the token space, then the module will not build.\r
569\r
570 @param TokenName The name of the PCD token to retrieve a current value for.\r
571 @param Value The 32-bit value to set.\r
572\r
573 @return The status of the set operation.\r
574\r
575**/\r
576#define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value))\r
577\r
578/**\r
579 Sets a 64-bit PCD token value based on a token name.\r
580\r
581 Sets the 64-bit value for the token specified by TokenName.\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 retrieve a current value for.\r
585 @param Value The 64-bit value to set.\r
586\r
587 @return The status of the set operation.\r
588\r
589**/\r
590#define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value))\r
591\r
592/**\r
593 Sets a pointer to a PCD token buffer based on a token name.\r
594\r
595 Sets the buffer for the token specified by TokenName.\r
596 If SizeOfBuffer is greater than the maximum size supported by TokenName,\r
597 then set SizeOfBuffer to the maximum size supported by TokenName and return\r
598 RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.\r
599 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size\r
600 supported by TokenName and RETURN_INVALID_PARAMETER must be returned.\r
601 If TokenName is not a valid token in the token space, then the module will not build.\r
602\r
603 If SizeOfBuffer is NULL, then ASSERT().\r
604 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
605\r
606 @param TokenName The name of the PCD token to set the current value for.\r
607 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
608 @param Buffer A pointer to the buffer to set.\r
609\r
610 @return The status of the set operation.\r
611\r
612**/\r
613#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \\r
614 _PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer))\r
615\r
616\r
617\r
618/**\r
619 Sets a boolean PCD token value based on a token name.\r
620\r
621 Sets the boolean 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 boolean value to set.\r
626\r
627 @return The status of the set operation.\r
628\r
629**/\r
630#define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value))\r
64735d24 631\r
419db80b
BF
632/**\r
633 Retrieves a token number based on a GUID and a token name.\r
634\r
635 Returns the token number for the token specified by Guid and TokenName.\r
636\r
637 @param Guid Pointer to a 128-bit unique value that designates \r
638 which namespace to retrieve a value from.\r
639 @param TokenName The name of the PCD token to retrieve a current value for. \r
640\r
641 @return Return the token number.\r
642\r
643**/\r
644#define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid)\r
645\r
64735d24 646/**\r
647 Retrieves an 8-bit PCD token value based on a GUID and a token name.\r
648\r
649 Returns the 8-bit value for the token specified by Guid and TokenName.\r
650 If TokenName is not a valid token in the token space specified by Guid, \r
651 then the module will not build.\r
652 \r
653 If Guid is NULL, then ASSERT().\r
654\r
655 @param Guid Pointer to a 128-bit unique value that designates \r
656 which namespace to retrieve a value from.\r
657 @param TokenName The name of the PCD token to retrieve a current value for. \r
658\r
659 @return An 8-bit PCD token value.\r
660\r
661**/\r
419db80b 662#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 663\r
664/**\r
665 Retrieves a 16-bit PCD token value based on a GUID and a token name.\r
666\r
667 Returns the 16-bit value for the token specified by Guid and TokenName.\r
668 If TokenName is not a valid token in the token space specified by Guid, \r
669 then the module will not build.\r
670\r
671 If Guid is NULL, then ASSERT().\r
672\r
673 @param Guid Pointer to a 128-bit unique value that designates \r
674 which namespace to retrieve a value from.\r
675 @param TokenName The name of the PCD token to retrieve a current value for. \r
676\r
677 @return A 16-bit PCD token value.\r
678\r
679**/\r
419db80b 680#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 681\r
682\r
683/**\r
684 Retrieves a 32-bit PCD token value based on a GUID and a token name.\r
685\r
686 Returns the 32-bit value for the token specified by Guid and TokenName.\r
687 If TokenName is not a valid token in the token space specified by Guid, \r
688 then the module will not build.\r
689\r
690 If Guid is NULL, then ASSERT().\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 A 32-bit PCD token value.\r
697\r
698**/\r
419db80b 699#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 700\r
701\r
702/**\r
703 Retrieves a 64-bit PCD token value based on a GUID and a token name.\r
704\r
705 Returns the 64-bit value for the token specified by Guid and TokenName.\r
706 If TokenName is not a valid token in the token space specified by Guid, \r
707 then the module will not build.\r
708\r
709 If Guid is NULL, then ASSERT().\r
710\r
711 @param Guid Pointer to a 128-bit unique value that designates \r
712 which namespace to retrieve a value from.\r
713 @param TokenName The name of the PCD token to retrieve a current value for. \r
714\r
715 @return A 64-bit PCD token value.\r
716\r
717**/\r
419db80b 718#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 719\r
720\r
721/**\r
722 Retrieves a pointer to a PCD token buffer based on a GUID and a token name.\r
723\r
724 Returns a pointer to the buffer 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 pointer to a PCD token buffer.\r
735\r
736**/\r
419db80b 737#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 738\r
739\r
740/**\r
741 Retrieves a Boolean PCD token value based on a GUID and a token name.\r
742\r
743 Returns the Boolean 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 Boolean PCD token value.\r
754\r
755**/\r
419db80b 756#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))\r
fb3df220 757\r
64735d24 758\r
9a355841
SZ
759\r
760#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
64735d24 761/**\r
762 Sets an 8-bit PCD token value based on a GUID and a token name.\r
763\r
764 Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.\r
765 If TokenName is not a valid token in the token space specified by Guid, \r
766 then the module will not build.\r
767\r
768 If Guid is NULL, then ASSERT().\r
769\r
770 @param Guid Pointer to a 128-bit unique value that designates \r
771 which namespace to retrieve a value from.\r
772 @param TokenName The name of the PCD token to set the current value for.\r
773 @param Value The 8-bit value to set. \r
774\r
7b5b3124 775 @return Return the Value that was set.\r
64735d24 776\r
777**/\r
419db80b 778#define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
64735d24 779\r
780\r
781/**\r
782 Sets a 16-bit PCD token value based on a GUID and a token name.\r
783\r
784 Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.\r
785 If TokenName is not a valid token in the token space specified by Guid, \r
786 then the module will not build.\r
787\r
788 If Guid is NULL, then ASSERT().\r
789\r
790 @param Guid Pointer to a 128-bit unique value that designates \r
791 which namespace to retrieve a value from.\r
792 @param TokenName The name of the PCD token to set the current value for.\r
793 @param Value The 16-bit value to set. \r
794\r
7b5b3124 795 @return Return the Value that was set.\r
64735d24 796\r
797**/\r
419db80b 798#define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
64735d24 799\r
800\r
801/**\r
802 Sets a 32-bit PCD token value based on a GUID and a token name.\r
803\r
804 Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.\r
805 If TokenName is not a valid token in the token space specified by Guid, \r
806 then the module will not build.\r
807\r
808 If Guid is NULL, then ASSERT().\r
809\r
810 @param Guid Pointer to a 128-bit unique value that designates \r
811 which namespace to retrieve a value from.\r
812 @param TokenName The name of the PCD token to set the current value for.\r
813 @param Value The 32-bit value to set. \r
814\r
7b5b3124 815 @return Return the Value that was set.\r
64735d24 816\r
817**/\r
419db80b 818#define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
64735d24 819\r
820\r
821/**\r
822 Sets a 64-bit PCD token value based on a GUID and a token name.\r
823\r
824 Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.\r
825 If TokenName is not a valid token in the token space specified by Guid, \r
826 then the module will not build.\r
827\r
828 If Guid is NULL, then ASSERT().\r
829\r
830 @param Guid Pointer to a 128-bit unique value that designates \r
831 which namespace to retrieve a value from.\r
832 @param TokenName The name of the PCD token to set the current value for.\r
833 @param Value The 64-bit value to set. \r
834\r
7b5b3124 835 @return Return the Value that was set.\r
64735d24 836\r
837**/\r
419db80b 838#define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
64735d24 839\r
840\r
841/**\r
842 Sets a pointer to a PCD token buffer based on a GUID and a token name.\r
843\r
844 Sets the buffer for the token specified by Guid and TokenName. Buffer is returned. \r
845 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName, \r
846 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return \r
847 NULL to indicate that the set operation was not actually performed. If SizeOfBuffer \r
848 is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by\r
9a355841 849 Guid and TokenName and NULL must be returned.\r
64735d24 850 If TokenName is not a valid token in the token space specified by Guid, \r
851 then the module will not build.\r
852 \r
853 If Guid is NULL, then ASSERT().\r
854 If SizeOfBuffer is NULL, then ASSERT().\r
855 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
856\r
857 @param Guid Pointer to a 128-bit unique value that designates \r
858 which namespace to retrieve a value from.\r
859 @param TokenName The name of the PCD token to set the current value for.\r
860 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. \r
7b5b3124 861 @param Buffer Pointer to the buffer to set.\r
64735d24 862 \r
7b5b3124 863 @return Return the pointer to the Buffer that was set.\r
64735d24 864\r
865**/\r
fb3df220 866#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \\r
419db80b 867 LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))\r
64735d24 868\r
869\r
870/**\r
871 Sets a Boolean PCD token value based on a GUID and a token name.\r
872\r
873 Sets the Boolean value for the token specified by Guid and TokenName. Value is returned. \r
874 If TokenName is not a valid token in the token space specified by Guid, \r
875 then the module will not build.\r
876\r
877 If Guid is NULL, then ASSERT().\r
878\r
879 @param Guid Pointer to a 128-bit unique value that designates \r
880 which namespace to retrieve a value from.\r
881 @param TokenName The name of the PCD token to set the current value for. \r
882 @param Value The Boolean value to set.\r
883\r
7b5b3124 884 @return Return the Value that was set.\r
64735d24 885\r
886**/ \r
fb3df220 887#define PcdSetExBool(Guid, TokenName, Value) \\r
419db80b 888 LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
9a355841
SZ
889#endif\r
890\r
891/**\r
892 Sets an 8-bit PCD token value based on a GUID and a token name.\r
893\r
894 Sets the 8-bit value for the token specified by Guid and TokenName.\r
895 If TokenName is not a valid token in the token space specified by Guid,\r
896 then the module will not build.\r
fb3df220 897\r
9a355841
SZ
898 If Guid is NULL, then ASSERT().\r
899\r
900 @param Guid Pointer to a 128-bit unique value that designates\r
901 which namespace to retrieve a value from.\r
902 @param TokenName The name of the PCD token to set the current value for.\r
903 @param Value The 8-bit value to set.\r
904\r
905 @return The status of the set operation.\r
906\r
907**/\r
908#define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
909\r
910/**\r
911 Sets an 16-bit PCD token value based on a GUID and a token name.\r
912\r
913 Sets the 16-bit value for the token specified by Guid and TokenName.\r
914 If TokenName is not a valid token in the token space specified by Guid,\r
915 then the module will not build.\r
916\r
917 If Guid is NULL, then ASSERT().\r
918\r
919 @param Guid Pointer to a 128-bit unique value that designates\r
920 which namespace to retrieve a value from.\r
921 @param TokenName The name of the PCD token to set the current value for.\r
922 @param Value The 16-bit value to set.\r
923\r
924 @return The status of the set operation.\r
925\r
926**/\r
927#define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
928\r
929/**\r
930 Sets an 32-bit PCD token value based on a GUID and a token name.\r
931\r
932 Sets the 32-bit value for the token specified by Guid and TokenName.\r
933 If TokenName is not a valid token in the token space specified by Guid,\r
934 then the module will not build.\r
935\r
936 If Guid is NULL, then ASSERT().\r
937\r
938 @param Guid Pointer to a 128-bit unique value that designates\r
939 which namespace to retrieve a value from.\r
940 @param TokenName The name of the PCD token to set the current value for.\r
941 @param Value The 32-bit value to set.\r
942\r
943 @return The status of the set operation.\r
944\r
945**/\r
946#define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
947\r
948/**\r
949 Sets an 64-bit PCD token value based on a GUID and a token name.\r
950\r
951 Sets the 64-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
954\r
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 64-bit value to set.\r
961\r
962 @return The status of the set operation.\r
963\r
964**/\r
965#define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
966\r
967/**\r
968 Sets a pointer to a PCD token buffer based on a GUID and a token name.\r
969\r
970 Sets the buffer for the token specified by Guid and TokenName.\r
971 If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,\r
972 then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return\r
973 RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.\r
974 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size\r
975 supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned.\r
976 If TokenName is not a valid token in the token space specified by Guid,\r
977 then the module will not build.\r
978\r
979 If Guid is NULL, then ASSERT().\r
980 If SizeOfBuffer is NULL, then ASSERT().\r
981 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
982\r
983 @param Guid Pointer to a 128-bit unique value that designates\r
984 which namespace to retrieve a value from.\r
985 @param TokenName The name of the PCD token to set the current value for.\r
986 @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
987 @param Buffer Pointer to the buffer to set.\r
988\r
989 @return The status of the set operation.\r
990\r
991**/\r
992#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \\r
993 LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))\r
994\r
995\r
996/**\r
997 Sets an boolean PCD token value based on a GUID and a token name.\r
998\r
999 Sets the boolean value for the token specified by Guid and TokenName.\r
1000 If TokenName is not a valid token in the token space specified by Guid,\r
1001 then the module will not build.\r
1002\r
1003 If Guid is NULL, then ASSERT().\r
1004\r
1005 @param Guid Pointer to a 128-bit unique value that designates\r
1006 which namespace to retrieve a value from.\r
1007 @param TokenName The name of the PCD token to set the current value for.\r
1008 @param Value The boolean value to set.\r
1009\r
1010 @return The status of the set operation.\r
1011\r
1012**/\r
1013#define PcdSetExBoolS(Guid, TokenName, Value) \\r
1014 LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
fb3df220 1015\r
1016/**\r
64735d24 1017 This function provides a means by which SKU support can be established in the PCD infrastructure.\r
1018\r
fb3df220 1019 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
b677694d 1020 If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). \r
fb3df220 1021\r
b677694d 1022 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values\r
1023 associated with a PCD token.\r
fb3df220 1024\r
1a2f870c 1025 @return Return the SKU ID that was set.\r
fb3df220 1026\r
1027**/\r
1028UINTN\r
1029EFIAPI\r
1030LibPcdSetSku (\r
1031 IN UINTN SkuId\r
1032 );\r
1033\r
1034\r
1035/**\r
64735d24 1036 This function provides a means by which to retrieve a value for a given PCD token.\r
1037 \r
fb3df220 1038 Returns the 8-bit value for the token specified by TokenNumber. \r
1039\r
2a254b90 1040 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1041\r
f73e0ad2 1042 @return Returns the 8-bit value for the token specified by TokenNumber. \r
fb3df220 1043\r
1044**/\r
1045UINT8\r
1046EFIAPI\r
1047LibPcdGet8 (\r
1048 IN UINTN TokenNumber\r
1049 );\r
1050\r
1051\r
1052/**\r
64735d24 1053 This function provides a means by which to retrieve a value for a given PCD token.\r
1054 \r
fb3df220 1055 Returns the 16-bit value for the token specified by TokenNumber. \r
1056\r
2a254b90 1057 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1058\r
f73e0ad2 1059 @return Returns the 16-bit value for the token specified by TokenNumber. \r
fb3df220 1060\r
1061**/\r
1062UINT16\r
1063EFIAPI\r
1064LibPcdGet16 (\r
1065 IN UINTN TokenNumber\r
1066 );\r
1067\r
1068\r
1069/**\r
64735d24 1070 This function provides a means by which to retrieve a value for a given PCD token.\r
1071 \r
fb3df220 1072 Returns the 32-bit value for the token specified by TokenNumber. \r
1073\r
1074 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1075\r
f73e0ad2 1076 @return Returns the 32-bit value for the token specified by TokenNumber.\r
fb3df220 1077\r
1078**/\r
1079UINT32\r
1080EFIAPI\r
1081LibPcdGet32 (\r
1082 IN UINTN TokenNumber\r
1083 );\r
1084\r
1085\r
1086/**\r
64735d24 1087 This function provides a means by which to retrieve a value for a given PCD token.\r
1088 \r
fb3df220 1089 Returns the 64-bit value for the token specified by TokenNumber.\r
1090\r
1091 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1092\r
f73e0ad2 1093 @return Returns the 64-bit value for the token specified by TokenNumber.\r
fb3df220 1094\r
1095**/\r
1096UINT64\r
1097EFIAPI\r
1098LibPcdGet64 (\r
1099 IN UINTN TokenNumber\r
1100 );\r
1101\r
1102\r
1103/**\r
64735d24 1104 This function provides a means by which to retrieve a value for a given PCD token.\r
1105 \r
fb3df220 1106 Returns the pointer to the buffer of the token specified by TokenNumber.\r
1107\r
1108 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1109\r
f73e0ad2 1110 @return Returns the pointer to the token specified by TokenNumber.\r
fb3df220 1111\r
1112**/\r
1113VOID *\r
1114EFIAPI\r
1115LibPcdGetPtr (\r
1116 IN UINTN TokenNumber\r
1117 );\r
1118\r
1119\r
1120/**\r
64735d24 1121 This function provides a means by which to retrieve a value for a given PCD token.\r
1122 \r
fb3df220 1123 Returns the Boolean value of the token specified by TokenNumber. \r
1124\r
1125 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1126\r
f73e0ad2 1127 @return Returns the Boolean value of the token specified by TokenNumber. \r
fb3df220 1128\r
1129**/\r
1130BOOLEAN \r
1131EFIAPI\r
1132LibPcdGetBool (\r
1133 IN UINTN TokenNumber\r
1134 );\r
1135\r
1136\r
1137/**\r
64735d24 1138 This function provides a means by which to retrieve the size of a given PCD token.\r
fb3df220 1139\r
1140 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
1141\r
f73e0ad2 1142 @return Returns the size of the token specified by TokenNumber. \r
fb3df220 1143\r
1144**/\r
1145UINTN\r
1146EFIAPI\r
1147LibPcdGetSize (\r
1148 IN UINTN TokenNumber\r
1149 );\r
1150\r
1151\r
1152/**\r
64735d24 1153 This function provides a means by which to retrieve a value for a given PCD token.\r
1154 \r
fb3df220 1155 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
64735d24 1156 \r
fb3df220 1157 If Guid is NULL, then ASSERT(). \r
1158\r
b677694d 1159 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1160 which namespace to retrieve a value from.\r
1161 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1162\r
f73e0ad2 1163 @return Return the UINT8.\r
fb3df220 1164\r
1165**/\r
1166UINT8\r
1167EFIAPI\r
1168LibPcdGetEx8 (\r
1169 IN CONST GUID *Guid,\r
1170 IN UINTN TokenNumber\r
1171 );\r
1172\r
1173\r
1174/**\r
64735d24 1175 This function provides a means by which to retrieve a value for a given PCD token.\r
1176\r
fb3df220 1177 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
64735d24 1178 \r
fb3df220 1179 If Guid is NULL, then ASSERT(). \r
1180\r
b677694d 1181 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1182 which namespace to retrieve a value from.\r
1183 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1184\r
f73e0ad2 1185 @return Return the UINT16.\r
fb3df220 1186\r
1187**/\r
1188UINT16\r
1189EFIAPI\r
1190LibPcdGetEx16 (\r
1191 IN CONST GUID *Guid,\r
1192 IN UINTN TokenNumber\r
1193 );\r
1194\r
1195\r
1196/**\r
1197 Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
1198 If Guid is NULL, then ASSERT(). \r
1199\r
b677694d 1200 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1201 which namespace to retrieve a value from.\r
1202 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1203\r
f73e0ad2 1204 @return Return the UINT32.\r
fb3df220 1205\r
1206**/\r
1207UINT32\r
1208EFIAPI\r
1209LibPcdGetEx32 (\r
1210 IN CONST GUID *Guid,\r
1211 IN UINTN TokenNumber\r
1212 );\r
1213\r
1214\r
1215/**\r
64735d24 1216 This function provides a means by which to retrieve a value for a given PCD token.\r
1217 \r
fb3df220 1218 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
64735d24 1219 \r
fb3df220 1220 If Guid is NULL, then ASSERT(). \r
1221\r
fb287b56 1222 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1223 which namespace to retrieve a value from.\r
1224 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1225\r
f73e0ad2 1226 @return Return the UINT64.\r
fb3df220 1227\r
1228**/\r
1229UINT64\r
1230EFIAPI\r
1231LibPcdGetEx64 (\r
1232 IN CONST GUID *Guid,\r
1233 IN UINTN TokenNumber\r
1234 );\r
1235\r
1236\r
1237/**\r
64735d24 1238 This function provides a means by which to retrieve a value for a given PCD token.\r
1239 \r
fb3df220 1240 Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
64735d24 1241 \r
fb3df220 1242 If Guid is NULL, then ASSERT(). \r
1243\r
fb287b56 1244 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1245 which namespace to retrieve a value from.\r
1246 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1247\r
f73e0ad2 1248 @return Return the VOID* pointer.\r
fb3df220 1249\r
1250**/\r
1251VOID *\r
1252EFIAPI\r
1253LibPcdGetExPtr (\r
1254 IN CONST GUID *Guid,\r
1255 IN UINTN TokenNumber\r
1256 );\r
1257\r
1258\r
1259/**\r
64735d24 1260 This function provides a means by which to retrieve a value for a given PCD token.\r
1261 \r
fb3df220 1262 Returns the Boolean value of the token specified by TokenNumber and Guid. \r
64735d24 1263 \r
fb3df220 1264 If Guid is NULL, then ASSERT(). \r
1265\r
fb287b56 1266 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1267 which namespace to retrieve a value from.\r
1268 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1269\r
f73e0ad2 1270 @return Return the BOOLEAN.\r
fb3df220 1271\r
1272**/\r
1273BOOLEAN\r
1274EFIAPI\r
1275LibPcdGetExBool (\r
1276 IN CONST GUID *Guid,\r
1277 IN UINTN TokenNumber\r
1278 );\r
1279\r
1280\r
1281/**\r
64735d24 1282 This function provides a means by which to retrieve the size of a given PCD token.\r
1283 \r
fb3df220 1284 Returns the size of the token specified by TokenNumber and Guid. \r
64735d24 1285 \r
fb3df220 1286 If Guid is NULL, then ASSERT(). \r
1287\r
fb287b56 1288 @param[in] Guid Pointer to a 128-bit unique value that designates \r
1289 which namespace to retrieve a value from.\r
1290 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1291\r
f73e0ad2 1292 @return Return the size.\r
fb3df220 1293\r
1294**/\r
1295UINTN\r
1296EFIAPI\r
1297LibPcdGetExSize (\r
1298 IN CONST GUID *Guid,\r
1299 IN UINTN TokenNumber\r
1300 );\r
1301\r
1302\r
9a355841 1303#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
fb3df220 1304/**\r
64735d24 1305 This function provides a means by which to set a value for a given PCD token.\r
1306 \r
fb3df220 1307 Sets the 8-bit value for the token specified by TokenNumber \r
1308 to the value specified by Value. Value is returned.\r
0befb08d 1309\r
fb287b56 1310 @param[in] TokenNumber The PCD token number to set a current value for.\r
1311 @param[in] Value The 8-bit value to set.\r
fb3df220 1312\r
502bfcef 1313 @return Return the Value that was set.\r
fb3df220 1314\r
1315**/\r
1316UINT8\r
1317EFIAPI\r
1318LibPcdSet8 (\r
1319 IN UINTN TokenNumber,\r
1320 IN UINT8 Value\r
1321 );\r
1322\r
1323\r
1324/**\r
64735d24 1325 This function provides a means by which to set a value for a given PCD token.\r
1326 \r
fb3df220 1327 Sets the 16-bit value for the token specified by TokenNumber \r
1328 to the value specified by Value. Value is returned.\r
0befb08d 1329\r
fb287b56 1330 @param[in] TokenNumber The PCD token number to set a current value for.\r
1331 @param[in] Value The 16-bit value to set.\r
fb3df220 1332\r
502bfcef 1333 @return Return the Value that was set.\r
fb3df220 1334\r
1335**/\r
1336UINT16\r
1337EFIAPI\r
1338LibPcdSet16 (\r
1339 IN UINTN TokenNumber,\r
1340 IN UINT16 Value\r
1341 );\r
1342\r
1343\r
1344/**\r
64735d24 1345 This function provides a means by which to set a value for a given PCD token.\r
1346 \r
fb3df220 1347 Sets the 32-bit value for the token specified by TokenNumber \r
1348 to the value specified by Value. Value is returned.\r
0befb08d 1349\r
fb287b56 1350 @param[in] TokenNumber The PCD token number to set a current value for.\r
1351 @param[in] Value The 32-bit value to set.\r
fb3df220 1352\r
502bfcef 1353 @return Return the Value that was set.\r
fb3df220 1354\r
1355**/\r
1356UINT32\r
1357EFIAPI\r
1358LibPcdSet32 (\r
1359 IN UINTN TokenNumber,\r
1360 IN UINT32 Value\r
1361 );\r
1362\r
1363\r
1364/**\r
64735d24 1365 This function provides a means by which to set a value for a given PCD token.\r
1366 \r
fb3df220 1367 Sets the 64-bit value for the token specified by TokenNumber \r
1368 to the value specified by Value. Value is returned.\r
0befb08d 1369\r
fb287b56 1370 @param[in] TokenNumber The PCD token number to set a current value for.\r
1371 @param[in] Value The 64-bit value to set.\r
fb3df220 1372\r
502bfcef 1373 @return Return the Value that was set.\r
fb3df220 1374\r
1375**/\r
1376UINT64\r
1377EFIAPI\r
1378LibPcdSet64 (\r
1379 IN UINTN TokenNumber,\r
1380 IN UINT64 Value\r
1381 );\r
1382\r
1383\r
1384/**\r
64735d24 1385 This function provides a means by which to set a value for a given PCD token.\r
1386 \r
fb3df220 1387 Sets a buffer for the token specified by TokenNumber to the value \r
d3057543 1388 specified by Buffer and SizeOfBuffer. Buffer is returned. \r
1389 If SizeOfBuffer is greater than the maximum size support by TokenNumber, \r
1390 then set SizeOfBuffer to the maximum size supported by TokenNumber and \r
9a355841 1391 return NULL to indicate that the set operation was not actually performed.\r
fb3df220 1392\r
d3057543 1393 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the \r
fb3df220 1394 maximum size supported by TokenName and NULL must be returned.\r
1395 \r
d3057543 1396 If SizeOfBuffer is NULL, then ASSERT().\r
1397 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
fb3df220 1398 \r
2a254b90 1399 @param[in] TokenNumber The PCD token number to set a current value for.\r
2616448e 1400 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
64735d24 1401 @param[in] Buffer A pointer to the buffer to set.\r
fb3df220 1402\r
502bfcef 1403 @return Return the pointer for the Buffer that was set.\r
fb3df220 1404\r
1405**/\r
64735d24 1406VOID *\r
fb3df220 1407EFIAPI\r
1408LibPcdSetPtr (\r
64735d24 1409 IN UINTN TokenNumber,\r
1410 IN OUT UINTN *SizeOfBuffer,\r
b52f6a1a 1411 IN CONST VOID *Buffer\r
fb3df220 1412 );\r
1413\r
1414\r
1415/**\r
64735d24 1416 This function provides a means by which to set a value for a given PCD token.\r
1417 \r
fb3df220 1418 Sets the Boolean value for the token specified by TokenNumber \r
1419 to the value specified by Value. Value is returned.\r
0befb08d 1420\r
fb287b56 1421 @param[in] TokenNumber The PCD token number to set a current value for.\r
1422 @param[in] Value The boolean value to set.\r
fb3df220 1423\r
502bfcef 1424 @return Return the Value that was set.\r
fb3df220 1425\r
1426**/\r
1427BOOLEAN\r
1428EFIAPI\r
1429LibPcdSetBool (\r
1430 IN UINTN TokenNumber,\r
1431 IN BOOLEAN Value\r
1432 );\r
1433\r
1434\r
1435/**\r
64735d24 1436 This function provides a means by which to set a value for a given PCD token.\r
1437 \r
fb3df220 1438 Sets the 8-bit value for the token specified by TokenNumber and \r
1439 Guid to the value specified by Value. Value is returned.\r
0befb08d 1440\r
fb3df220 1441 If Guid is NULL, then ASSERT().\r
0befb08d 1442\r
fb287b56 1443 @param[in] Guid Pointer to a 128-bit unique value that \r
1444 designates which namespace to set a value from.\r
1445 @param[in] TokenNumber The PCD token number to set a current value for.\r
1446 @param[in] Value The 8-bit value to set.\r
fb3df220 1447\r
502bfcef 1448 @return Return the Value that was set.\r
fb3df220 1449\r
1450**/\r
1451UINT8\r
1452EFIAPI\r
1453LibPcdSetEx8 (\r
1454 IN CONST GUID *Guid,\r
1455 IN UINTN TokenNumber,\r
1456 IN UINT8 Value\r
1457 );\r
1458\r
1459\r
1460/**\r
64735d24 1461 This function provides a means by which to set a value for a given PCD token.\r
1462 \r
fb3df220 1463 Sets the 16-bit value for the token specified by TokenNumber and \r
1464 Guid to the value specified by Value. Value is returned.\r
0befb08d 1465\r
fb3df220 1466 If Guid is NULL, then ASSERT().\r
0befb08d 1467\r
fb287b56 1468 @param[in] Guid Pointer to a 128-bit unique value that \r
1469 designates which namespace to set a value from.\r
1470 @param[in] TokenNumber The PCD token number to set a current value for.\r
1471 @param[in] Value The 16-bit value to set.\r
fb3df220 1472\r
502bfcef 1473 @return Return the Value that was set.\r
fb3df220 1474\r
1475**/\r
1476UINT16\r
1477EFIAPI\r
1478LibPcdSetEx16 (\r
1479 IN CONST GUID *Guid,\r
1480 IN UINTN TokenNumber,\r
1481 IN UINT16 Value\r
1482 );\r
1483\r
1484\r
1485/**\r
64735d24 1486 This function provides a means by which to set a value for a given PCD token.\r
1487 \r
fb3df220 1488 Sets the 32-bit value for the token specified by TokenNumber and \r
1489 Guid to the value specified by Value. Value is returned.\r
0befb08d 1490\r
fb3df220 1491 If Guid is NULL, then ASSERT().\r
0befb08d 1492\r
fb287b56 1493 @param[in] Guid Pointer to a 128-bit unique value that \r
1494 designates which namespace to set a value from.\r
1495 @param[in] TokenNumber The PCD token number to set a current value for.\r
1496 @param[in] Value The 32-bit value to set.\r
fb3df220 1497\r
502bfcef 1498 @return Return the Value that was set.\r
fb3df220 1499\r
1500**/\r
1501UINT32\r
1502EFIAPI\r
1503LibPcdSetEx32 (\r
1504 IN CONST GUID *Guid,\r
1505 IN UINTN TokenNumber,\r
1506 IN UINT32 Value\r
1507 );\r
1508\r
1509\r
1510/**\r
64735d24 1511 This function provides a means by which to set a value for a given PCD token.\r
1512 \r
fb3df220 1513 Sets the 64-bit value for the token specified by TokenNumber and \r
1514 Guid to the value specified by Value. Value is returned.\r
0befb08d 1515\r
fb3df220 1516 If Guid is NULL, then ASSERT().\r
0befb08d 1517\r
fb287b56 1518 @param[in] Guid Pointer to a 128-bit unique value that \r
1519 designates which namespace to set a value from.\r
1520 @param[in] TokenNumber The PCD token number to set a current value for.\r
1521 @param[in] Value The 64-bit value to set.\r
fb3df220 1522\r
502bfcef 1523 @return Return the Value that was set.\r
fb3df220 1524\r
1525**/\r
1526UINT64\r
1527EFIAPI\r
1528LibPcdSetEx64 (\r
1529 IN CONST GUID *Guid,\r
1530 IN UINTN TokenNumber,\r
1531 IN UINT64 Value\r
1532 );\r
1533\r
1534\r
1535/**\r
64735d24 1536 This function provides a means by which to set a value for a given PCD token.\r
1537 \r
fb3df220 1538 Sets a buffer for the token specified by TokenNumber to the value specified by \r
d3057543 1539 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
1540 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size \r
fb3df220 1541 supported by TokenNumber and return NULL to indicate that the set operation \r
9a355841 1542 was not actually performed.\r
fb3df220 1543 \r
1544 If Guid is NULL, then ASSERT().\r
d3057543 1545 If SizeOfBuffer is NULL, then ASSERT().\r
1546 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
fb3df220 1547 \r
fb287b56 1548 @param[in] Guid Pointer to a 128-bit unique value that \r
1549 designates which namespace to set a value from.\r
1550 @param[in] TokenNumber The PCD token number to set a current value for.\r
1551 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1552 @param[in] Buffer A pointer to the buffer to set.\r
fb3df220 1553\r
502bfcef 1554 @return Return the pointer to the Buffer that was set.\r
fb3df220 1555\r
1556**/\r
1557VOID *\r
1558EFIAPI\r
1559LibPcdSetExPtr (\r
1560 IN CONST GUID *Guid,\r
1561 IN UINTN TokenNumber,\r
1562 IN OUT UINTN *SizeOfBuffer,\r
1563 IN VOID *Buffer\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 Boolean 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 Boolean value to set.\r
fb3df220 1579\r
502bfcef 1580 @return Return the Value that was set.\r
fb3df220 1581\r
1582**/\r
1583BOOLEAN\r
1584EFIAPI\r
1585LibPcdSetExBool (\r
1586 IN CONST GUID *Guid,\r
1587 IN UINTN TokenNumber,\r
1588 IN BOOLEAN Value\r
1589 );\r
9a355841 1590#endif\r
fb3df220 1591\r
9a355841
SZ
1592/**\r
1593 This function provides a means by which to set a value for a given PCD token.\r
1594\r
1595 Sets the 8-bit value for the token specified by TokenNumber\r
1596 to the value specified by Value.\r
1597\r
1598 @param[in] TokenNumber The PCD token number to set a current value for.\r
1599 @param[in] Value The 8-bit value to set.\r
1600\r
1601 @return The status of the set operation.\r
1602\r
1603**/\r
1604RETURN_STATUS\r
1605EFIAPI\r
1606LibPcdSet8S (\r
1607 IN UINTN TokenNumber,\r
1608 IN UINT8 Value\r
1609 );\r
1610\r
1611/**\r
1612 This function provides a means by which to set a value for a given PCD token.\r
1613\r
1614 Sets the 16-bit value for the token specified by TokenNumber\r
1615 to the value specified by Value.\r
1616\r
1617 @param[in] TokenNumber The PCD token number to set a current value for.\r
1618 @param[in] Value The 16-bit value to set.\r
1619\r
1620 @return The status of the set operation.\r
1621\r
1622**/\r
1623RETURN_STATUS\r
1624EFIAPI\r
1625LibPcdSet16S (\r
1626 IN UINTN TokenNumber,\r
1627 IN UINT16 Value\r
1628 );\r
1629\r
1630/**\r
1631 This function provides a means by which to set a value for a given PCD token.\r
1632\r
1633 Sets the 32-bit value for the token specified by TokenNumber\r
1634 to the value specified by Value.\r
1635\r
1636 @param[in] TokenNumber The PCD token number to set a current value for.\r
1637 @param[in] Value The 32-bit value to set.\r
1638\r
1639 @return The status of the set operation.\r
1640\r
1641**/\r
1642RETURN_STATUS\r
1643EFIAPI\r
1644LibPcdSet32S (\r
1645 IN UINTN TokenNumber,\r
1646 IN UINT32 Value\r
1647 );\r
1648\r
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 64-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 64-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
1663LibPcdSet64S (\r
1664 IN UINTN TokenNumber,\r
1665 IN UINT64 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 a buffer for the token specified by TokenNumber to the value specified\r
1672 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size\r
1673 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by\r
1674 TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation\r
1675 was not actually performed.\r
1676\r
1677 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the\r
1678 maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned.\r
1679\r
1680 If SizeOfBuffer is NULL, then ASSERT().\r
1681 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1682\r
1683 @param[in] TokenNumber The PCD token number to set a current value for.\r
1684 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1685 @param[in] Buffer A pointer to the buffer to set.\r
1686\r
1687 @return The status of the set operation.\r
1688\r
1689**/\r
1690RETURN_STATUS\r
1691EFIAPI\r
1692LibPcdSetPtrS (\r
1693 IN UINTN TokenNumber,\r
1694 IN OUT UINTN *SizeOfBuffer,\r
1695 IN CONST VOID *Buffer\r
1696 );\r
1697\r
1698/**\r
1699 This function provides a means by which to set a value for a given PCD token.\r
1700\r
1701 Sets the boolean value for the token specified by TokenNumber\r
1702 to the value specified by Value.\r
1703\r
1704 @param[in] TokenNumber The PCD token number to set a current value for.\r
1705 @param[in] Value The boolean value to set.\r
1706\r
1707 @return The status of the set operation.\r
1708\r
1709**/\r
1710RETURN_STATUS\r
1711EFIAPI\r
1712LibPcdSetBoolS (\r
1713 IN UINTN TokenNumber,\r
1714 IN BOOLEAN Value\r
1715 );\r
1716\r
1717/**\r
1718 This function provides a means by which to set a value for a given PCD token.\r
1719\r
1720 Sets the 8-bit value for the token specified by TokenNumber\r
1721 to the value specified by Value.\r
1722\r
1723 If Guid is NULL, then ASSERT().\r
1724\r
1725 @param[in] Guid The pointer to a 128-bit unique value that\r
1726 designates which namespace to set a value from.\r
1727 @param[in] TokenNumber The PCD token number to set a current value for.\r
1728 @param[in] Value The 8-bit value to set.\r
1729\r
1730 @return The status of the set operation.\r
1731\r
1732**/\r
1733RETURN_STATUS\r
1734EFIAPI\r
1735LibPcdSetEx8S (\r
1736 IN CONST GUID *Guid,\r
1737 IN UINTN TokenNumber,\r
1738 IN UINT8 Value\r
1739 );\r
1740\r
1741/**\r
1742 This function provides a means by which to set a value for a given PCD token.\r
1743\r
1744 Sets the 16-bit value for the token specified by TokenNumber\r
1745 to the value specified by Value.\r
1746\r
1747 If Guid is NULL, then ASSERT().\r
1748\r
1749 @param[in] Guid The pointer to a 128-bit unique value that\r
1750 designates which namespace to set a value from.\r
1751 @param[in] TokenNumber The PCD token number to set a current value for.\r
1752 @param[in] Value The 16-bit value to set.\r
1753\r
1754 @return The status of the set operation.\r
1755\r
1756**/\r
1757RETURN_STATUS\r
1758EFIAPI\r
1759LibPcdSetEx16S (\r
1760 IN CONST GUID *Guid,\r
1761 IN UINTN TokenNumber,\r
1762 IN UINT16 Value\r
1763 );\r
1764\r
1765/**\r
1766 This function provides a means by which to set a value for a given PCD token.\r
1767\r
1768 Sets the 32-bit value for the token specified by TokenNumber\r
1769 to the value specified by Value.\r
1770\r
1771 If Guid is NULL, then ASSERT().\r
1772\r
1773 @param[in] Guid The pointer to a 128-bit unique value that\r
1774 designates which namespace to set a value from.\r
1775 @param[in] TokenNumber The PCD token number to set a current value for.\r
1776 @param[in] Value The 32-bit value to set.\r
1777\r
1778 @return The status of the set operation.\r
1779\r
1780**/\r
1781RETURN_STATUS\r
1782EFIAPI\r
1783LibPcdSetEx32S (\r
1784 IN CONST GUID *Guid,\r
1785 IN UINTN TokenNumber,\r
1786 IN UINT32 Value\r
1787 );\r
1788\r
1789/**\r
1790 This function provides a means by which to set a value for a given PCD token.\r
1791\r
1792 Sets the 64-bit value for the token specified by TokenNumber\r
1793 to the value specified by Value.\r
1794\r
1795 If Guid is NULL, then ASSERT().\r
1796\r
1797 @param[in] Guid The pointer to a 128-bit unique value that\r
1798 designates which namespace to set a value from.\r
1799 @param[in] TokenNumber The PCD token number to set a current value for.\r
1800 @param[in] Value The 64-bit value to set.\r
1801\r
1802 @return The status of the set operation.\r
1803\r
1804**/\r
1805RETURN_STATUS\r
1806EFIAPI\r
1807LibPcdSetEx64S (\r
1808 IN CONST GUID *Guid,\r
1809 IN UINTN TokenNumber,\r
1810 IN UINT64 Value\r
1811 );\r
1812\r
1813/**\r
1814 This function provides a means by which to set a value for a given PCD token.\r
1815\r
1816 Sets a buffer for the token specified by TokenNumber to the value specified by\r
1817 Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size\r
1818 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by\r
1819 TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation\r
1820 was not actually performed.\r
1821\r
1822 If Guid is NULL, then ASSERT().\r
1823 If SizeOfBuffer is NULL, then ASSERT().\r
1824 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1825\r
1826 @param[in] Guid Pointer to a 128-bit unique value that\r
1827 designates which namespace to set a value from.\r
1828 @param[in] TokenNumber The PCD token number to set a current value for.\r
1829 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1830 @param[in] Buffer A pointer to the buffer to set.\r
1831\r
1832 @return The status of the set operation.\r
1833\r
1834**/\r
1835RETURN_STATUS\r
1836EFIAPI\r
1837LibPcdSetExPtrS (\r
1838 IN CONST GUID *Guid,\r
1839 IN UINTN TokenNumber,\r
1840 IN OUT UINTN *SizeOfBuffer,\r
1841 IN VOID *Buffer\r
1842 );\r
1843\r
1844/**\r
1845 This function provides a means by which to set a value for a given PCD token.\r
1846\r
1847 Sets the boolean value for the token specified by TokenNumber\r
1848 to the value specified by Value.\r
1849\r
1850 If Guid is NULL, then ASSERT().\r
1851\r
1852 @param[in] Guid The pointer to a 128-bit unique value that\r
1853 designates which namespace to set a value from.\r
1854 @param[in] TokenNumber The PCD token number to set a current value for.\r
1855 @param[in] Value The boolean value to set.\r
1856\r
1857 @return The status of the set operation.\r
1858\r
1859**/\r
1860RETURN_STATUS\r
1861EFIAPI\r
1862LibPcdSetExBoolS (\r
1863 IN CONST GUID *Guid,\r
1864 IN UINTN TokenNumber,\r
1865 IN BOOLEAN Value\r
1866 );\r
fb3df220 1867\r
1868/**\r
b677694d 1869 This notification function serves two purposes.\r
fb3df220 1870\r
1a2f870c 1871 Firstly, it notifies the module that did the registration that the value of this\r
b677694d 1872 PCD token has been set.\r
1a2f870c 1873 Secondly, it provides a mechanism for the module that did the registration to intercept\r
b677694d 1874 the set operation and override the value been set if necessary. After the invocation of\r
1875 the callback function, TokenData will be used by PCD service PEIM or driver to modify th\r
1876 internal data in PCD database. \r
fb3df220 1877\r
2a254b90 1878 @param[in] CallBackGuid The PCD token GUID being set.\r
1879 @param[in] CallBackToken The PCD token number being set.\r
1880 @param[in, out] TokenData A pointer to the token data being set.\r
1881 @param[in] TokenDataSize The size, in bytes, of the data being set.\r
fb3df220 1882\r
fb3df220 1883**/\r
1884typedef\r
1885VOID\r
78bf8f2d 1886(EFIAPI *PCD_CALLBACK)(\r
fb3df220 1887 IN CONST GUID *CallBackGuid, OPTIONAL\r
1888 IN UINTN CallBackToken,\r
1889 IN OUT VOID *TokenData,\r
1890 IN UINTN TokenDataSize\r
1891 );\r
1892\r
1893\r
1894/**\r
64735d24 1895 Set up a notification function that is called when a specified token is set.\r
1896 \r
fb3df220 1897 When the token specified by TokenNumber and Guid is set, \r
1898 then notification function specified by NotificationFunction is called. \r
b677694d 1899 If Guid is NULL, then the default token space is used.\r
fb3df220 1900 If NotificationFunction is NULL, then ASSERT().\r
1901\r
b677694d 1902 @param[in] Guid Pointer to a 128-bit unique value that designates which \r
1903 namespace to set a value from. If NULL, then the default \r
1904 token space is used.\r
1905 @param[in] TokenNumber The PCD token number to monitor.\r
fb287b56 1906 @param[in] NotificationFunction The function to call when the token \r
1907 specified by Guid and TokenNumber is set.\r
fb3df220 1908\r
1909**/\r
1910VOID\r
1911EFIAPI\r
1912LibPcdCallbackOnSet (\r
1913 IN CONST GUID *Guid, OPTIONAL\r
1914 IN UINTN TokenNumber,\r
1915 IN PCD_CALLBACK NotificationFunction\r
1916 );\r
1917\r
1918\r
1919/**\r
1920 Disable a notification function that was established with LibPcdCallbackonSet().\r
64735d24 1921 \r
b677694d 1922 Disable a notification function that was previously established with LibPcdCallbackOnSet().\r
64735d24 1923 If NotificationFunction is NULL, then ASSERT().\r
1924 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, \r
1925 and NotificationFunction, then ASSERT().\r
1926 \r
b677694d 1927 @param[in] Guid Specify the GUID token space.\r
1928 @param[in] TokenNumber Specify the token number.\r
fb3df220 1929 @param[in] NotificationFunction The callback function to be unregistered.\r
1930\r
fb3df220 1931**/\r
1932VOID\r
1933EFIAPI\r
1934LibPcdCancelCallback (\r
1935 IN CONST GUID *Guid, OPTIONAL\r
1936 IN UINTN TokenNumber,\r
1937 IN PCD_CALLBACK NotificationFunction\r
1938 );\r
1939\r
1940\r
1941/**\r
64735d24 1942 Retrieves the next token in a token space.\r
1943 \r
fb3df220 1944 Retrieves the next PCD token number from the token space specified by Guid. \r
1945 If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r
1946 then the first token number is returned. Otherwise, the token number that \r
1947 follows TokenNumber in the token space is returned. If TokenNumber is the last \r
64735d24 1948 token number in the token space, then 0 is returned. \r
1949 \r
1950 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().\r
fb3df220 1951\r
2a254b90 1952 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace \r
1953 to set a value from. If NULL, then the default token space is used.\r
1954 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD \r
1955 token number.\r
fb3df220 1956\r
f73e0ad2 1957 @return The next valid token number.\r
fb3df220 1958\r
1959**/\r
1960UINTN \r
1961EFIAPI\r
1962LibPcdGetNextToken (\r
1963 IN CONST GUID *Guid, OPTIONAL\r
1964 IN UINTN TokenNumber\r
1965 );\r
1966\r
1967\r
1968\r
1969/**\r
64735d24 1970 Used to retrieve the list of available PCD token space GUIDs.\r
1971 \r
b677694d 1972 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces\r
1973 in the platform.\r
1974 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.\r
1975 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.\r
fb3df220 1976 \r
b677694d 1977 @param TokenSpaceGuid Pointer to the a PCD token space GUID\r
fb3df220 1978\r
f73e0ad2 1979 @return The next valid token namespace.\r
fb3df220 1980\r
1981**/\r
b677694d 1982GUID *\r
fb3df220 1983EFIAPI\r
1984LibPcdGetNextTokenSpace (\r
64735d24 1985 IN CONST GUID *TokenSpaceGuid\r
fb3df220 1986 );\r
1987\r
1988\r
1989/**\r
64735d24 1990 Sets a value of a patchable PCD entry that is type pointer.\r
1991 \r
fb3df220 1992 Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
d3057543 1993 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
1994 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r
fb3df220 1995 NULL to indicate that the set operation was not actually performed. \r
d3057543 1996 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r
fb3df220 1997 MaximumDatumSize and NULL must be returned.\r
1998 \r
1999 If PatchVariable is NULL, then ASSERT().\r
d3057543 2000 If SizeOfBuffer is NULL, then ASSERT().\r
2001 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
fb3df220 2002\r
2003 @param[in] PatchVariable A pointer to the global variable in a module that is \r
2004 the target of the set operation.\r
2005 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
2006 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
2007 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
f73e0ad2 2008 \r
502bfcef 2009 @return Return the pointer to the Buffer that was set.\r
fb3df220 2010\r
2011**/\r
2012VOID *\r
2013EFIAPI\r
2014LibPatchPcdSetPtr (\r
2015 IN VOID *PatchVariable,\r
2016 IN UINTN MaximumDatumSize,\r
2017 IN OUT UINTN *SizeOfBuffer,\r
2018 IN CONST VOID *Buffer\r
2019 );\r
2020\r
9a355841
SZ
2021/**\r
2022 Sets a value of a patchable PCD entry that is type pointer.\r
2023\r
2024 Sets the PCD entry specified by PatchVariable to the value specified\r
2025 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
2026 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
2027 to indicate that the set operation was not actually performed.\r
2028 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
2029 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
2030\r
2031 If PatchVariable is NULL, then ASSERT().\r
2032 If SizeOfBuffer is NULL, then ASSERT().\r
2033 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
2034\r
2035 @param[in] PatchVariable A pointer to the global variable in a module that is\r
2036 the target of the set operation.\r
2037 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
2038 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
2039 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
2040 \r
2041 @return The status of the set operation.\r
2042\r
2043**/\r
2044RETURN_STATUS\r
2045EFIAPI\r
2046LibPatchPcdSetPtrS (\r
2047 IN VOID *PatchVariable,\r
2048 IN UINTN MaximumDatumSize,\r
2049 IN OUT UINTN *SizeOfBuffer,\r
2050 IN CONST VOID *Buffer\r
2051 );\r
2052\r
96d6d004
SZ
2053typedef enum {\r
2054 PCD_TYPE_8,\r
2055 PCD_TYPE_16,\r
2056 PCD_TYPE_32,\r
2057 PCD_TYPE_64,\r
2058 PCD_TYPE_BOOL,\r
2059 PCD_TYPE_PTR\r
2060} PCD_TYPE;\r
2061\r
2062typedef struct {\r
2063 ///\r
2064 /// The returned information associated with the requested TokenNumber. If\r
2065 /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.\r
2066 ///\r
2067 PCD_TYPE PcdType;\r
2068 ///\r
2069 /// The size of the data in bytes associated with the TokenNumber specified. If\r
2070 /// TokenNumber is 0, then PcdSize is set 0.\r
2071 ///\r
2072 UINTN PcdSize;\r
2073 ///\r
2074 /// The null-terminated ASCII string associated with a given token. If the\r
2075 /// TokenNumber specified was 0, then this field corresponds to the null-terminated\r
2076 /// ASCII string associated with the token's namespace Guid. If NULL, there is no\r
2077 /// name associated with this request.\r
2078 ///\r
2079 CHAR8 *PcdName;\r
2080} PCD_INFO;\r
2081\r
2082\r
2083/**\r
2084 Retrieve additional information associated with a PCD token.\r
2085\r
2086 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
2087 human readable name that is associated with the token.\r
2088\r
2089 If TokenNumber is not in the default token space specified, then ASSERT().\r
2090\r
2091 @param[in] TokenNumber The PCD token number.\r
2092 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
2093 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
2094**/\r
2095VOID\r
2096EFIAPI\r
2097LibPcdGetInfo (\r
2098 IN UINTN TokenNumber,\r
2099 OUT PCD_INFO *PcdInfo\r
2100 );\r
2101\r
2102/**\r
2103 Retrieve additional information associated with a PCD token.\r
2104\r
2105 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
2106 human readable name that is associated with the token.\r
2107\r
2108 If TokenNumber is not in the token space specified by Guid, then ASSERT().\r
2109\r
2110 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
2111 @param[in] TokenNumber The PCD token number.\r
2112 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
2113 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
2114**/\r
2115VOID\r
2116EFIAPI\r
2117LibPcdGetInfoEx (\r
2118 IN CONST GUID *Guid,\r
2119 IN UINTN TokenNumber,\r
2120 OUT PCD_INFO *PcdInfo\r
2121 );\r
2122\r
2123/**\r
2124 Retrieve the currently set SKU Id.\r
2125\r
2126 If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().\r
2127\r
2128 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
2129 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
2130 Id is returned.\r
2131**/\r
2132UINTN\r
2133EFIAPI\r
2134LibPcdGetSku (\r
2135 VOID\r
2136 );\r
2137\r
fb3df220 2138#endif\r