]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/PcdLib.h
MdePkg and MdeModulePkg Pcd: Add the new EFI_GET_PCD_INFO_PROTOCOL and EFI_GET_PCD_IN...
[mirror_edk2.git] / MdePkg / Include / Library / PcdLib.h
... / ...
CommitLineData
1/** @file\r
2 Provides library services to get and set Platform Configuration Database entries.\r
3\r
4 PCD Library Class provides a PCD usage macro interface for all PCD types.\r
5 It should be included in any module that uses PCD. If a module uses dynamic/dynamicex\r
6 PCD, module should be linked to a PEIM/DXE library instance to access that PCD.\r
7 If a module uses PatchableInModule type PCD, it also needs the library instance to produce\r
8 LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is\r
9 translated to a variable or macro that is auto-generated by build tool in\r
10 module's autogen.h/autogen.c.\r
11 The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are \r
12 only available prior to ExitBootServices(). If access to PCD values are required \r
13 at runtime, then their values must be collected prior to ExitBootServices().\r
14 There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),\r
15 PatchPcdGetXX(), and PatchPcdSetXX().\r
16\r
17Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
18This program and the accompanying materials\r
19are licensed and made available under the terms and conditions of the BSD License\r
20which accompanies this distribution. The full text of the license may be found at\r
21http://opensource.org/licenses/bsd-license.php\r
22\r
23THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
24WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
25\r
26**/\r
27\r
28#ifndef __PCD_LIB_H__\r
29#define __PCD_LIB_H__\r
30\r
31#define PCD_MAX_SKU_ID 0x100\r
32\r
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
46#define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r
47\r
48\r
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
61#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
62\r
63\r
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
76#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName\r
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
91#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName\r
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
106#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName\r
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
121#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName\r
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
136#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName\r
137\r
138\r
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
151#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r
152\r
153\r
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
166#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName\r
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
180#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName\r
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
195#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName\r
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
210#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName\r
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
225#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName\r
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
240#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)\r
241\r
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
253 @return Return the Value that was set.\r
254\r
255**/\r
256#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
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
269 @return Return the Value that was set.\r
270\r
271**/\r
272#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
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
285 @return Return the Value that was set.\r
286\r
287**/\r
288#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
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
301 @return Return the Value that was set.\r
302\r
303**/\r
304#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
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
317 @return Return the Value that was set.\r
318\r
319**/\r
320#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
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
341 @return Return the pointer to the Buffer that was set.\r
342\r
343**/\r
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
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
363#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName\r
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
377#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName\r
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
391#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName\r
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
405#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName\r
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
419#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName\r
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
433#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
434\r
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
445 @return Return the Value that was set.\r
446\r
447**/\r
448#define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))\r
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
460 @return Return the Value that was set.\r
461\r
462**/\r
463#define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))\r
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
475 @return Return the Value that was set.\r
476\r
477**/\r
478#define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))\r
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
490 @return Return the Value that was set.\r
491\r
492**/\r
493#define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))\r
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
514 @return Return the pointer to the Buffer that was set.\r
515\r
516**/\r
517#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \\r
518 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))\r
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
529 @return Return the Value that was set.\r
530\r
531**/\r
532#define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))\r
533\r
534\r
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
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
565#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))\r
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
583#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))\r
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
602#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))\r
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
621#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))\r
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
640#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))\r
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
659#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))\r
660\r
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
676 @return Return the Value that was set.\r
677\r
678**/\r
679#define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
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
696 @return Return the Value that was set.\r
697\r
698**/\r
699#define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
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
716 @return Return the Value that was set.\r
717\r
718**/\r
719#define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
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
736 @return Return the Value that was set.\r
737\r
738**/\r
739#define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
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
762 @param Buffer Pointer to the buffer to set.\r
763 \r
764 @return Return the pointer to the Buffer that was set.\r
765\r
766**/\r
767#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \\r
768 LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))\r
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
785 @return Return the Value that was set.\r
786\r
787**/ \r
788#define PcdSetExBool(Guid, TokenName, Value) \\r
789 LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
790\r
791\r
792/**\r
793 This function provides a means by which SKU support can be established in the PCD infrastructure.\r
794\r
795 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
796 If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). \r
797\r
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
800\r
801 @return Return the SKU ID that was set.\r
802\r
803**/\r
804UINTN\r
805EFIAPI\r
806LibPcdSetSku (\r
807 IN UINTN SkuId\r
808 );\r
809\r
810\r
811/**\r
812 This function provides a means by which to retrieve a value for a given PCD token.\r
813 \r
814 Returns the 8-bit value for the token specified by TokenNumber. \r
815\r
816 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
817\r
818 @return Returns the 8-bit value for the token specified by TokenNumber. \r
819\r
820**/\r
821UINT8\r
822EFIAPI\r
823LibPcdGet8 (\r
824 IN UINTN TokenNumber\r
825 );\r
826\r
827\r
828/**\r
829 This function provides a means by which to retrieve a value for a given PCD token.\r
830 \r
831 Returns the 16-bit value for the token specified by TokenNumber. \r
832\r
833 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
834\r
835 @return Returns the 16-bit value for the token specified by TokenNumber. \r
836\r
837**/\r
838UINT16\r
839EFIAPI\r
840LibPcdGet16 (\r
841 IN UINTN TokenNumber\r
842 );\r
843\r
844\r
845/**\r
846 This function provides a means by which to retrieve a value for a given PCD token.\r
847 \r
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
852 @return Returns the 32-bit value for the token specified by TokenNumber.\r
853\r
854**/\r
855UINT32\r
856EFIAPI\r
857LibPcdGet32 (\r
858 IN UINTN TokenNumber\r
859 );\r
860\r
861\r
862/**\r
863 This function provides a means by which to retrieve a value for a given PCD token.\r
864 \r
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
869 @return Returns the 64-bit value for the token specified by TokenNumber.\r
870\r
871**/\r
872UINT64\r
873EFIAPI\r
874LibPcdGet64 (\r
875 IN UINTN TokenNumber\r
876 );\r
877\r
878\r
879/**\r
880 This function provides a means by which to retrieve a value for a given PCD token.\r
881 \r
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
886 @return Returns the pointer to the token specified by TokenNumber.\r
887\r
888**/\r
889VOID *\r
890EFIAPI\r
891LibPcdGetPtr (\r
892 IN UINTN TokenNumber\r
893 );\r
894\r
895\r
896/**\r
897 This function provides a means by which to retrieve a value for a given PCD token.\r
898 \r
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
903 @return Returns the Boolean value of the token specified by TokenNumber. \r
904\r
905**/\r
906BOOLEAN \r
907EFIAPI\r
908LibPcdGetBool (\r
909 IN UINTN TokenNumber\r
910 );\r
911\r
912\r
913/**\r
914 This function provides a means by which to retrieve the size of a given PCD token.\r
915\r
916 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
917\r
918 @return Returns the size of the token specified by TokenNumber. \r
919\r
920**/\r
921UINTN\r
922EFIAPI\r
923LibPcdGetSize (\r
924 IN UINTN TokenNumber\r
925 );\r
926\r
927\r
928/**\r
929 This function provides a means by which to retrieve a value for a given PCD token.\r
930 \r
931 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
932 \r
933 If Guid is NULL, then ASSERT(). \r
934\r
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
938\r
939 @return Return the UINT8.\r
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
951 This function provides a means by which to retrieve a value for a given PCD token.\r
952\r
953 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
954 \r
955 If Guid is NULL, then ASSERT(). \r
956\r
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
960\r
961 @return Return the UINT16.\r
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
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
979\r
980 @return Return the UINT32.\r
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
992 This function provides a means by which to retrieve a value for a given PCD token.\r
993 \r
994 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
995 \r
996 If Guid is NULL, then ASSERT(). \r
997\r
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
1001\r
1002 @return Return the UINT64.\r
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
1014 This function provides a means by which to retrieve a value for a given PCD token.\r
1015 \r
1016 Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
1017 \r
1018 If Guid is NULL, then ASSERT(). \r
1019\r
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
1023\r
1024 @return Return the VOID* pointer.\r
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
1036 This function provides a means by which to retrieve a value for a given PCD token.\r
1037 \r
1038 Returns the Boolean value of the token specified by TokenNumber and Guid. \r
1039 \r
1040 If Guid is NULL, then ASSERT(). \r
1041\r
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
1045\r
1046 @return Return the BOOLEAN.\r
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
1058 This function provides a means by which to retrieve the size of a given PCD token.\r
1059 \r
1060 Returns the size of the token specified by TokenNumber and Guid. \r
1061 \r
1062 If Guid is NULL, then ASSERT(). \r
1063\r
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
1067\r
1068 @return Return the size.\r
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
1080 This function provides a means by which to set a value for a given PCD token.\r
1081 \r
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
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
1087\r
1088 @return Return the Value that was set.\r
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
1100 This function provides a means by which to set a value for a given PCD token.\r
1101 \r
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
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
1107\r
1108 @return Return the Value that was set.\r
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
1120 This function provides a means by which to set a value for a given PCD token.\r
1121 \r
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
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
1127\r
1128 @return Return the Value that was set.\r
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
1140 This function provides a means by which to set a value for a given PCD token.\r
1141 \r
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
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
1147\r
1148 @return Return the Value that was set.\r
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
1160 This function provides a means by which to set a value for a given PCD token.\r
1161 \r
1162 Sets a buffer for the token specified by TokenNumber to the value \r
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
1166 return NULL to indicate that the set operation was not actually performed. \r
1167\r
1168 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the \r
1169 maximum size supported by TokenName and NULL must be returned.\r
1170 \r
1171 If SizeOfBuffer is NULL, then ASSERT().\r
1172 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1173 \r
1174 @param[in] TokenNumber The PCD token number to set a current value for.\r
1175 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
1176 @param[in] Buffer A pointer to the buffer to set.\r
1177\r
1178 @return Return the pointer for the Buffer that was set.\r
1179\r
1180**/\r
1181VOID *\r
1182EFIAPI\r
1183LibPcdSetPtr (\r
1184 IN UINTN TokenNumber,\r
1185 IN OUT UINTN *SizeOfBuffer,\r
1186 IN CONST VOID *Buffer\r
1187 );\r
1188\r
1189\r
1190/**\r
1191 This function provides a means by which to set a value for a given PCD token.\r
1192 \r
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
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
1198\r
1199 @return Return the Value that was set.\r
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
1211 This function provides a means by which to set a value for a given PCD token.\r
1212 \r
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
1215 \r
1216 If Guid is NULL, then ASSERT().\r
1217 \r
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
1222\r
1223 @return Return the Value that was set.\r
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
1236 This function provides a means by which to set a value for a given PCD token.\r
1237 \r
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
1240 \r
1241 If Guid is NULL, then ASSERT().\r
1242 \r
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
1247\r
1248 @return Return the Value that was set.\r
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
1261 This function provides a means by which to set a value for a given PCD token.\r
1262 \r
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
1265 \r
1266 If Guid is NULL, then ASSERT().\r
1267 \r
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
1272\r
1273 @return Return the Value that was set.\r
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
1286 This function provides a means by which to set a value for a given PCD token.\r
1287 \r
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
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
1296\r
1297 @return Return the Value that was set.\r
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
1310 This function provides a means by which to set a value for a given PCD token.\r
1311 \r
1312 Sets a buffer for the token specified by TokenNumber to the value specified by \r
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
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
1319 If SizeOfBuffer is NULL, then ASSERT().\r
1320 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1321 \r
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
1327\r
1328 @return Return the pointer to the Buffer that was set.\r
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
1342 This function provides a means by which to set a value for a given PCD token.\r
1343 \r
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
1346 \r
1347 If Guid is NULL, then ASSERT().\r
1348 \r
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
1353\r
1354 @return Return the Value that was set.\r
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
1367 This notification function serves two purposes.\r
1368\r
1369 Firstly, it notifies the module that did the registration that the value of this\r
1370 PCD token has been set.\r
1371 Secondly, it provides a mechanism for the module that did the registration to intercept\r
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
1375\r
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
1380\r
1381**/\r
1382typedef\r
1383VOID\r
1384(EFIAPI *PCD_CALLBACK)(\r
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
1393 Set up a notification function that is called when a specified token is set.\r
1394 \r
1395 When the token specified by TokenNumber and Guid is set, \r
1396 then notification function specified by NotificationFunction is called. \r
1397 If Guid is NULL, then the default token space is used.\r
1398 If NotificationFunction is NULL, then ASSERT().\r
1399\r
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
1404 @param[in] NotificationFunction The function to call when the token \r
1405 specified by Guid and TokenNumber is set.\r
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
1419 \r
1420 Disable a notification function that was previously established with LibPcdCallbackOnSet().\r
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
1425 @param[in] Guid Specify the GUID token space.\r
1426 @param[in] TokenNumber Specify the token number.\r
1427 @param[in] NotificationFunction The callback function to be unregistered.\r
1428\r
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
1440 Retrieves the next token in a token space.\r
1441 \r
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
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
1449\r
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
1454\r
1455 @return The next valid token number.\r
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
1468 Used to retrieve the list of available PCD token space GUIDs.\r
1469 \r
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
1474 \r
1475 @param TokenSpaceGuid Pointer to the a PCD token space GUID\r
1476\r
1477 @return The next valid token namespace.\r
1478\r
1479**/\r
1480GUID *\r
1481EFIAPI\r
1482LibPcdGetNextTokenSpace (\r
1483 IN CONST GUID *TokenSpaceGuid\r
1484 );\r
1485\r
1486\r
1487/**\r
1488 Sets a value of a patchable PCD entry that is type pointer.\r
1489 \r
1490 Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
1491 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r
1492 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r
1493 NULL to indicate that the set operation was not actually performed. \r
1494 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r
1495 MaximumDatumSize and NULL must be returned.\r
1496 \r
1497 If PatchVariable is NULL, then ASSERT().\r
1498 If SizeOfBuffer is NULL, then ASSERT().\r
1499 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
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
1506 \r
1507 @return Return the pointer to the Buffer that was set.\r
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
1519typedef enum {\r
1520 PCD_TYPE_8,\r
1521 PCD_TYPE_16,\r
1522 PCD_TYPE_32,\r
1523 PCD_TYPE_64,\r
1524 PCD_TYPE_BOOL,\r
1525 PCD_TYPE_PTR\r
1526} PCD_TYPE;\r
1527\r
1528typedef struct {\r
1529 ///\r
1530 /// The returned information associated with the requested TokenNumber. If\r
1531 /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.\r
1532 ///\r
1533 PCD_TYPE PcdType;\r
1534 ///\r
1535 /// The size of the data in bytes associated with the TokenNumber specified. If\r
1536 /// TokenNumber is 0, then PcdSize is set 0.\r
1537 ///\r
1538 UINTN PcdSize;\r
1539 ///\r
1540 /// The null-terminated ASCII string associated with a given token. If the\r
1541 /// TokenNumber specified was 0, then this field corresponds to the null-terminated\r
1542 /// ASCII string associated with the token's namespace Guid. If NULL, there is no\r
1543 /// name associated with this request.\r
1544 ///\r
1545 CHAR8 *PcdName;\r
1546} PCD_INFO;\r
1547\r
1548\r
1549/**\r
1550 Retrieve additional information associated with a PCD token.\r
1551\r
1552 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
1553 human readable name that is associated with the token.\r
1554\r
1555 If TokenNumber is not in the default token space specified, then ASSERT().\r
1556\r
1557 @param[in] TokenNumber The PCD token number.\r
1558 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
1559 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
1560**/\r
1561VOID\r
1562EFIAPI\r
1563LibPcdGetInfo (\r
1564 IN UINTN TokenNumber,\r
1565 OUT PCD_INFO *PcdInfo\r
1566 );\r
1567\r
1568/**\r
1569 Retrieve additional information associated with a PCD token.\r
1570\r
1571 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
1572 human readable name that is associated with the token.\r
1573\r
1574 If TokenNumber is not in the token space specified by Guid, then ASSERT().\r
1575\r
1576 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
1577 @param[in] TokenNumber The PCD token number.\r
1578 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
1579 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
1580**/\r
1581VOID\r
1582EFIAPI\r
1583LibPcdGetInfoEx (\r
1584 IN CONST GUID *Guid,\r
1585 IN UINTN TokenNumber,\r
1586 OUT PCD_INFO *PcdInfo\r
1587 );\r
1588\r
1589/**\r
1590 Retrieve the currently set SKU Id.\r
1591\r
1592 If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().\r
1593\r
1594 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
1595 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
1596 Id is returned.\r
1597**/\r
1598UINTN\r
1599EFIAPI\r
1600LibPcdGetSku (\r
1601 VOID\r
1602 );\r
1603\r
1604#endif\r