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