]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PcdLib.h
map FeaturePcdGet(TokenName) to _PCD_GET_MODE_BOOL_##TokenName to follow the build...
[mirror_edk2.git] / MdePkg / Include / Library / PcdLib.h
CommitLineData
878ddf1f 1/** @file\r
2PCD Library Class Interface Declarations\r
3\r
4Copyright (c) 2006, Intel Corporation \r
5All rights reserved. This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13\r
14Module Name: PcdLib.h\r
15\r
16**/\r
17\r
18#ifndef __PCD_LIB_H__\r
19#define __PCD_LIB_H__\r
20\r
58f1099f 21#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)\r
878ddf1f 22\r
57a38e69 23#define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r
878ddf1f 24\r
25\r
26//\r
27// Feature Flag is in the form of a global constant\r
28//\r
7cd6b97f 29#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
878ddf1f 30\r
31\r
32//\r
33// Fixed is fixed at build time\r
34//\r
57a38e69 35#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName\r
36#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName\r
37#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName\r
38#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName\r
39#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName\r
878ddf1f 40\r
41\r
57a38e69 42#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r
878ddf1f 43\r
44\r
45//\r
46// (Binary) Patch is in the form of a global variable\r
47//\r
57a38e69 48#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName\r
49#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName\r
50#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName\r
51#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName\r
52#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName\r
53#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)\r
878ddf1f 54\r
57a38e69 55#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
56#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
57#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
58#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
59#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
60#define PatchPcdSetPtr(TokenName, Size, Buffer) \\r
61 CopyMem (_gPcd_BinaryPatch_##TokenName, (Buffer), (Size))\r
878ddf1f 62\r
63//\r
64// Dynamic is via the protocol with only the TokenNumber as argument\r
65// It can also be Patch or Fixed type based on a build option\r
66//\r
57a38e69 67#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName\r
68#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName\r
69#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName\r
70#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName\r
71#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName\r
72#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
878ddf1f 73\r
74//\r
57a38e69 75// Dynamic Set\r
878ddf1f 76//\r
57a38e69 77#define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))\r
78#define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))\r
79#define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))\r
80#define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))\r
81#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \\r
82 _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))\r
83#define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))\r
878ddf1f 84\r
85//\r
57a38e69 86// Dynamic Ex is to support binary distribution\r
878ddf1f 87//\r
57a38e69 88#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), _PCD_TOKEN_##TokenName)\r
89#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), _PCD_TOKEN_##TokenName)\r
90#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), _PCD_TOKEN_##TokenName)\r
91#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), _PCD_TOKEN_##TokenName)\r
92#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), _PCD_TOKEN_##TokenName)\r
93#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), _PCD_TOKEN_##TokenName)\r
878ddf1f 94\r
95//\r
96// Dynamic Set Ex\r
97//\r
57a38e69 98#define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r
99#define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r
100#define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r
101#define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r
102#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \\r
103 LibPcdSetExPtr ((Guid), _PCD_TOKEN_##TokenName, (SizeOfBuffer), (Buffer))\r
104#define PcdSetExBool(Guid, TokenName, Value) \\r
105 LibPcdSetExBool((Guid), _PCD_TOKEN_##TokenName, (Value))\r
878ddf1f 106\r
107\r
108/**\r
109 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
110\r
111 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r
112 set values associated with a PCD token.\r
113\r
b16ef805 114 @retval SKU_ID Return the SKU ID that just be set.\r
878ddf1f 115\r
116**/\r
8a43e8dd 117UINTN\r
878ddf1f 118EFIAPI\r
119LibPcdSetSku (\r
8a43e8dd 120 IN UINTN SkuId\r
878ddf1f 121 );\r
122\r
123\r
124/**\r
125 Returns the 8-bit value for the token specified by TokenNumber. \r
126\r
127 @param[in] The PCD token number to retrieve a current value for.\r
128\r
129 @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber. \r
130\r
131**/\r
132UINT8\r
133EFIAPI\r
134LibPcdGet8 (\r
8a43e8dd 135 IN UINTN TokenNumber\r
878ddf1f 136 );\r
137\r
138\r
139/**\r
140 Returns the 16-bit value for the token specified by TokenNumber. \r
141\r
142 @param[in] The PCD token number to retrieve a current value for.\r
143\r
144 @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber. \r
145\r
146**/\r
147UINT16\r
148EFIAPI\r
149LibPcdGet16 (\r
8a43e8dd 150 IN UINTN TokenNumber\r
878ddf1f 151 );\r
152\r
153\r
154/**\r
155 Returns the 32-bit value for the token specified by TokenNumber. \r
156\r
157 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
158\r
159 @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.\r
160\r
161**/\r
162UINT32\r
163EFIAPI\r
164LibPcdGet32 (\r
8a43e8dd 165 IN UINTN TokenNumber\r
878ddf1f 166 );\r
167\r
168\r
169/**\r
170 Returns the 64-bit value for the token specified by TokenNumber.\r
171\r
172 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
173\r
174 @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.\r
175\r
176**/\r
177UINT64\r
178EFIAPI\r
179LibPcdGet64 (\r
8a43e8dd 180 IN UINTN TokenNumber\r
878ddf1f 181 );\r
182\r
183\r
184/**\r
185 Returns the pointer to the buffer of the token specified by TokenNumber.\r
186\r
187 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
188\r
189 @retval VOID* Returns the pointer to the token specified by TokenNumber.\r
190\r
191**/\r
192VOID *\r
193EFIAPI\r
194LibPcdGetPtr (\r
8a43e8dd 195 IN UINTN TokenNumber\r
878ddf1f 196 );\r
197\r
198\r
199/**\r
200 Returns the Boolean value of the token specified by TokenNumber. \r
201\r
202 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
203\r
204 @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber. \r
205\r
206**/\r
207BOOLEAN \r
208EFIAPI\r
209LibPcdGetBool (\r
8a43e8dd 210 IN UINTN TokenNumber\r
878ddf1f 211 );\r
212\r
213\r
214/**\r
215 Returns the size of the token specified by TokenNumber. \r
216\r
217 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
218\r
219 @retval UINTN Returns the size of the token specified by TokenNumber. \r
220\r
221**/\r
222UINTN\r
223EFIAPI\r
224LibPcdGetSize (\r
8a43e8dd 225 IN UINTN TokenNumber\r
878ddf1f 226 );\r
227\r
228\r
229/**\r
230 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
231 If Guid is NULL, then ASSERT(). \r
232\r
233 @param[in] Guid Pointer to a 128-bit unique value that designates \r
234 which namespace to retrieve a value from.\r
235 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
236\r
237 @retval UINT8 Return the UINT8.\r
238\r
239**/\r
240UINT8\r
241EFIAPI\r
242LibPcdGetEx8 (\r
243 IN CONST GUID *Guid,\r
8a43e8dd 244 IN UINTN TokenNumber\r
878ddf1f 245 );\r
246\r
247\r
248/**\r
249 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
250 If Guid is NULL, then ASSERT(). \r
251\r
252 @param[in] Guid Pointer to a 128-bit unique value that designates \r
253 which namespace to retrieve a value from.\r
254 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
255\r
256 @retval UINT16 Return the UINT16.\r
257\r
258**/\r
259UINT16\r
260EFIAPI\r
261LibPcdGetEx16 (\r
262 IN CONST GUID *Guid,\r
8a43e8dd 263 IN UINTN TokenNumber\r
878ddf1f 264 );\r
265\r
266\r
267/**\r
268 Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
269 If Guid is NULL, then ASSERT(). \r
270\r
271 @param[in] Guid Pointer to a 128-bit unique value that designates \r
272 which namespace to retrieve a value from.\r
273 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
274\r
275 @retval UINT32 Return the UINT32.\r
276\r
277**/\r
278UINT32\r
279EFIAPI\r
280LibPcdGetEx32 (\r
281 IN CONST GUID *Guid,\r
8a43e8dd 282 IN UINTN TokenNumber\r
878ddf1f 283 );\r
284\r
285\r
286/**\r
287 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
288 If Guid is NULL, then ASSERT(). \r
289\r
290 @param[in] Guid Pointer to a 128-bit unique value that designates \r
291 which namespace to retrieve a value from.\r
292 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
293\r
294 @retval UINT64 Return the UINT64.\r
295\r
296**/\r
297UINT64\r
298EFIAPI\r
299LibPcdGetEx64 (\r
300 IN CONST GUID *Guid,\r
8a43e8dd 301 IN UINTN TokenNumber\r
878ddf1f 302 );\r
303\r
304\r
305/**\r
306 Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
307 If Guid is NULL, then ASSERT(). \r
308\r
309 @param[in] Guid Pointer to a 128-bit unique value that designates \r
310 which namespace to retrieve a value from.\r
311 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
312\r
313 @retval VOID* Return the VOID* pointer.\r
314\r
315**/\r
316VOID *\r
317EFIAPI\r
318LibPcdGetExPtr (\r
319 IN CONST GUID *Guid,\r
8a43e8dd 320 IN UINTN TokenNumber\r
878ddf1f 321 );\r
322\r
323\r
324/**\r
325 Returns the Boolean value of the token specified by TokenNumber and Guid. \r
326 If Guid is NULL, then ASSERT(). \r
327\r
328 @param[in] Guid Pointer to a 128-bit unique value that designates \r
329 which namespace to retrieve a value from.\r
330 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
331\r
332 @retval BOOLEAN Return the BOOLEAN.\r
333\r
334**/\r
335BOOLEAN\r
336EFIAPI\r
337LibPcdGetExBool (\r
338 IN CONST GUID *Guid,\r
8a43e8dd 339 IN UINTN TokenNumber\r
878ddf1f 340 );\r
341\r
342\r
343/**\r
344 Returns the size of the token specified by TokenNumber and Guid. \r
345 If Guid is NULL, then ASSERT(). \r
346\r
347 @param[in] Guid Pointer to a 128-bit unique value that designates \r
348 which namespace to retrieve a value from.\r
349 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
350\r
351 @retval UINTN Return the size.\r
352\r
353**/\r
354UINTN\r
355EFIAPI\r
356LibPcdGetExSize (\r
357 IN CONST GUID *Guid,\r
8a43e8dd 358 IN UINTN TokenNumber\r
878ddf1f 359 );\r
360\r
361\r
362/**\r
363 Sets the 8-bit value for the token specified by TokenNumber \r
364 to the value specified by Value. Value is returned.\r
365 \r
366 @param[in] TokenNumber The PCD token number to set a current value for.\r
367 @param[in] Value The 8-bit value to set.\r
368\r
369 @retval UINT8 Return the value been set.\r
370\r
371**/\r
372UINT8\r
373EFIAPI\r
374LibPcdSet8 (\r
8a43e8dd 375 IN UINTN TokenNumber,\r
878ddf1f 376 IN UINT8 Value\r
377 );\r
378\r
379\r
380/**\r
381 Sets the 16-bit value for the token specified by TokenNumber \r
382 to the value specified by Value. Value is returned.\r
383 \r
384 @param[in] TokenNumber The PCD token number to set a current value for.\r
385 @param[in] Value The 16-bit value to set.\r
386\r
387 @retval UINT16 Return the value been set.\r
388\r
389**/\r
390UINT16\r
391EFIAPI\r
392LibPcdSet16 (\r
8a43e8dd 393 IN UINTN TokenNumber,\r
878ddf1f 394 IN UINT16 Value\r
395 );\r
396\r
397\r
398/**\r
399 Sets the 32-bit value for the token specified by TokenNumber \r
400 to the value specified by Value. Value is returned.\r
401 \r
402 @param[in] TokenNumber The PCD token number to set a current value for.\r
403 @param[in] Value The 32-bit value to set.\r
404\r
405 @retval UINT32 Return the value been set.\r
406\r
407**/\r
408UINT32\r
409EFIAPI\r
410LibPcdSet32 (\r
8a43e8dd 411 IN UINTN TokenNumber,\r
878ddf1f 412 IN UINT32 Value\r
413 );\r
414\r
415\r
416/**\r
417 Sets the 64-bit value for the token specified by TokenNumber \r
418 to the value specified by Value. Value is returned.\r
419 \r
420 @param[in] TokenNumber The PCD token number to set a current value for.\r
421 @param[in] Value The 64-bit value to set.\r
422\r
423 @retval UINT64 Return the value been set.\r
424\r
425**/\r
426UINT64\r
427EFIAPI\r
428LibPcdSet64 (\r
8a43e8dd 429 IN UINTN TokenNumber,\r
878ddf1f 430 IN UINT64 Value\r
431 );\r
432\r
433\r
434/**\r
bb5545b6 435 Sets a buffer for the token specified by TokenNumber to the value \r
436 specified by Buffer and SizeOfValue. Buffer is returned. \r
437 If SizeOfValue is greater than the maximum size support by TokenNumber, \r
438 then set SizeOfValue to the maximum size supported by TokenNumber and \r
439 return NULL to indicate that the set operation was not actually performed. \r
440\r
441 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to the \r
442 maximum size supported by TokenName and NULL must be returned.\r
4276d5da 443 \r
bb5545b6 444 If SizeOfValue is NULL, then ASSERT().\r
4276d5da 445 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
878ddf1f 446 \r
447 @param[in] TokenNumber The PCD token number to set a current value for.\r
4276d5da 448 @param[in,out] SizeOfBuffer The size, in bytes, of Buffer.\r
878ddf1f 449 @param[in] Value A pointer to the buffer to set.\r
450\r
451 @retval VOID* Return the pointer for the buffer been set.\r
452\r
453**/\r
454VOID*\r
455EFIAPI\r
456LibPcdSetPtr (\r
4276d5da 457 IN UINTN TokenNumber,\r
458 IN OUT UINTN *SizeOfBuffer,\r
459 IN VOID *Value\r
878ddf1f 460 );\r
461\r
462\r
463/**\r
464 Sets the Boolean value for the token specified by TokenNumber \r
465 to the value specified by Value. Value is returned.\r
466 \r
467 @param[in] TokenNumber The PCD token number to set a current value for.\r
468 @param[in] Value The boolean value to set.\r
469\r
470 @retval BOOLEAN Return the value been set.\r
471\r
472**/\r
473BOOLEAN\r
474EFIAPI\r
475LibPcdSetBool (\r
8a43e8dd 476 IN UINTN TokenNumber,\r
878ddf1f 477 IN BOOLEAN Value\r
478 );\r
479\r
480\r
481/**\r
482 Sets the 8-bit value for the token specified by TokenNumber and \r
483 Guid to the value specified by Value. Value is returned.\r
484 If Guid is NULL, then ASSERT().\r
485 \r
486 @param[in] Guid Pointer to a 128-bit unique value that \r
487 designates which namespace to set a value from.\r
488 @param[in] TokenNumber The PCD token number to set a current value for.\r
489 @param[in] Value The 8-bit value to set.\r
490\r
491 @retval UINT8 Return the value been set.\r
492\r
493**/\r
494UINT8\r
495EFIAPI\r
496LibPcdSetEx8 (\r
497 IN CONST GUID *Guid,\r
8a43e8dd 498 IN UINTN TokenNumber,\r
878ddf1f 499 IN UINT8 Value\r
500 );\r
501\r
502\r
503/**\r
504 Sets the 16-bit value for the token specified by TokenNumber and \r
505 Guid to the value specified by Value. Value is returned.\r
506 If Guid is NULL, then ASSERT().\r
507 \r
508 @param[in] Guid Pointer to a 128-bit unique value that \r
509 designates which namespace to set a value from.\r
510 @param[in] TokenNumber The PCD token number to set a current value for.\r
511 @param[in] Value The 16-bit value to set.\r
512\r
513 @retval UINT8 Return the value been set.\r
514\r
515**/\r
516UINT16\r
517EFIAPI\r
518LibPcdSetEx16 (\r
519 IN CONST GUID *Guid,\r
8a43e8dd 520 IN UINTN TokenNumber,\r
878ddf1f 521 IN UINT16 Value\r
522 );\r
523\r
524\r
525/**\r
526 Sets the 32-bit value for the token specified by TokenNumber and \r
527 Guid to the value specified by Value. Value is returned.\r
528 If Guid is NULL, then ASSERT().\r
529 \r
530 @param[in] Guid Pointer to a 128-bit unique value that \r
531 designates which namespace to set a value from.\r
532 @param[in] TokenNumber The PCD token number to set a current value for.\r
533 @param[in] Value The 32-bit value to set.\r
534\r
535 @retval UINT32 Return the value been set.\r
536\r
537**/\r
538UINT32\r
539EFIAPI\r
540LibPcdSetEx32 (\r
541 IN CONST GUID *Guid,\r
8a43e8dd 542 IN UINTN TokenNumber,\r
878ddf1f 543 IN UINT32 Value\r
544 );\r
545\r
546\r
547/**\r
548 Sets the 64-bit value for the token specified by TokenNumber and \r
549 Guid to the value specified by Value. Value is returned.\r
550 If Guid is NULL, then ASSERT().\r
551 \r
552 @param[in] Guid Pointer to a 128-bit unique value that \r
553 designates which namespace to set a value from.\r
554 @param[in] TokenNumber The PCD token number to set a current value for.\r
555 @param[in] Value The 64-bit value to set.\r
556\r
557 @retval UINT64 Return the value been set.\r
558\r
559**/\r
560UINT64\r
561EFIAPI\r
562LibPcdSetEx64 (\r
563 IN CONST GUID *Guid,\r
8a43e8dd 564 IN UINTN TokenNumber,\r
878ddf1f 565 IN UINT64 Value\r
566 );\r
567\r
568\r
569/**\r
4276d5da 570 Sets a buffer for the token specified by TokenNumber to the value specified by \r
571 Buffer and SizeOfValue. Buffer is returned. If SizeOfValue is greater than \r
572 the maximum size support by TokenNumber, then set SizeOfValue to the maximum size \r
573 supported by TokenNumber and return NULL to indicate that the set operation \r
574 was not actually performed. \r
575 \r
bb5545b6 576 If Guid is NULL, then ASSERT().\r
577 If SizeOfValue is NULL, then ASSERT().\r
4276d5da 578 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
878ddf1f 579 \r
580 @param[in] Guid Pointer to a 128-bit unique value that \r
581 designates which namespace to set a value from.\r
582 @param[in] TokenNumber The PCD token number to set a current value for.\r
4276d5da 583 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
584 @param[in] Buffer A pointer to the buffer to set.\r
878ddf1f 585\r
4276d5da 586 @retval VOID * Return the pinter to the buffer been set.\r
878ddf1f 587\r
588**/\r
589VOID *\r
590EFIAPI\r
591LibPcdSetExPtr (\r
4276d5da 592 IN CONST GUID *Guid,\r
593 IN UINTN TokenNumber,\r
594 IN OUT UINTN *SizeOfBuffer,\r
595 IN VOID *Buffer\r
878ddf1f 596 );\r
597\r
598\r
599/**\r
600 Sets the Boolean value for the token specified by TokenNumber and \r
601 Guid to the value specified by Value. Value is returned.\r
602 If Guid is NULL, then ASSERT().\r
603 \r
604 @param[in] Guid Pointer to a 128-bit unique value that \r
605 designates which namespace to set a value from.\r
606 @param[in] TokenNumber The PCD token number to set a current value for.\r
607 @param[in] Value The Boolean value to set.\r
608\r
609 @retval Boolean Return the value been set.\r
610\r
611**/\r
612BOOLEAN\r
613EFIAPI\r
614LibPcdSetExBool (\r
615 IN CONST GUID *Guid,\r
8a43e8dd 616 IN UINTN TokenNumber,\r
878ddf1f 617 IN BOOLEAN Value\r
618 );\r
619\r
620\r
621/**\r
622 When the token specified by TokenNumber and Guid is set, \r
623 then notification function specified by NotificationFunction is called. \r
624 If Guid is NULL, then the default token space is used. \r
625 If NotificationFunction is NULL, then ASSERT().\r
626\r
627 @param[in] CallBackGuid The PCD token GUID being set.\r
628 @param[in] CallBackToken The PCD token number being set.\r
629 @param[in] TokenData A pointer to the token data being set.\r
630 @param[in] TokenDataSize The size, in bytes, of the data being set.\r
631\r
632 @retval VOID\r
633\r
634**/\r
635typedef\r
636VOID\r
637(EFIAPI *PCD_CALLBACK) (\r
b16ef805 638 IN CONST GUID *CallBackGuid, OPTIONAL\r
8a43e8dd 639 IN UINTN CallBackToken,\r
b16ef805 640 IN OUT VOID *TokenData,\r
641 IN UINTN TokenDataSize\r
878ddf1f 642 );\r
643\r
644\r
645/**\r
646 When the token specified by TokenNumber and Guid is set, \r
647 then notification function specified by NotificationFunction is called. \r
648 If Guid is NULL, then the default token space is used. \r
649 If NotificationFunction is NULL, then ASSERT().\r
650\r
651 @param[in] Guid Pointer to a 128-bit unique value that designates which \r
652 namespace to set a value from. If NULL, then the default \r
653 token space is used.\r
654 @param[in] TokenNumber The PCD token number to monitor.\r
655 @param[in] NotificationFunction The function to call when the token \r
656 specified by Guid and TokenNumber is set.\r
657\r
658 @retval VOID\r
659\r
660**/\r
661VOID\r
662EFIAPI\r
663LibPcdCallbackOnSet (\r
664 IN CONST GUID *Guid, OPTIONAL\r
8a43e8dd 665 IN UINTN TokenNumber,\r
878ddf1f 666 IN PCD_CALLBACK NotificationFunction\r
667 );\r
668\r
669\r
670/**\r
671 Disable a notification function that was established with LibPcdCallbackonSet().\r
672\r
673 @param[in] Guid Specify the GUID token space.\r
674 @param[in] TokenNumber Specify the token number.\r
675 @param[in] NotificationFunction The callback function to be unregistered.\r
676\r
677 @retval VOID\r
678\r
679**/\r
680VOID\r
681EFIAPI\r
682LibPcdCancelCallback (\r
683 IN CONST GUID *Guid, OPTIONAL\r
8a43e8dd 684 IN UINTN TokenNumber,\r
878ddf1f 685 IN PCD_CALLBACK NotificationFunction\r
686 );\r
687\r
688\r
689/**\r
690 Retrieves the next PCD token number from the token space specified by Guid. \r
691 If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r
692 then the first token number is returned. Otherwise, the token number that \r
693 follows TokenNumber in the token space is returned. If TokenNumber is the last \r
694 token number in the token space, then 0 is returned. If TokenNumber is not 0 and \r
695 is not in the token space specified by Guid, then ASSERT().\r
696\r
697 @param[in] Pointer to a 128-bit unique value that designates which namespace \r
698 to set a value from. If NULL, then the default token space is used.\r
699 @param[in] The previous PCD token number. If 0, then retrieves the first PCD \r
700 token number.\r
701\r
8a43e8dd 702 @retval UINTN The next valid token number.\r
878ddf1f 703\r
704**/\r
8a43e8dd 705UINTN \r
878ddf1f 706EFIAPI\r
707LibPcdGetNextToken (\r
708 IN CONST GUID *Guid, OPTIONAL\r
8a43e8dd 709 IN UINTN TokenNumber\r
878ddf1f 710 );\r
711\r
4276d5da 712\r
713\r
714/**\r
715 Retrieves the next PCD token space from a token space specified by Guid.\r
716 Guid of NULL is reserved to mark the default local token namespace on the current\r
717 platform. If Guid is NULL, then the GUID of the first non-local token space of the \r
718 current platform is returned. If Guid is the last non-local token space, \r
719 then NULL is returned. \r
720\r
721 If Guid is not NULL and is not a valid token space in the current platform, then ASSERT().\r
722\r
723\r
724 \r
1eb73ab5 725 @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace \r
4276d5da 726 to start the search.\r
727\r
728 @retval CONST GUID * The next valid token namespace.\r
729\r
730**/\r
bb5545b6 731GUID * \r
4276d5da 732EFIAPI\r
733LibPcdGetNextTokenSpace (\r
734 IN CONST GUID *Guid\r
735 );\r
736\r
1eb73ab5 737\r
738/**\r
739 Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
740 and SizeOfValue. Buffer is returned. If SizeOfValue is greater than \r
741 MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
742 NULL to indicate that the set operation was not actually performed. \r
743 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
744 MaximumDatumSize and NULL must be returned.\r
745 \r
746 If PatchVariable is NULL, then ASSERT().\r
747 If SizeOfValue is NULL, then ASSERT().\r
748 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
749\r
750 @param[in] PatchVariable A pointer to the global variable in a module that is \r
751 the target of the set operation.\r
752 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
753 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
754 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
755\r
756**/\r
757VOID *\r
758EFIAPI\r
759LibPatchPcdSetPtr (\r
760 IN VOID *PatchVariable,\r
761 IN UINTN MaximumDatumSize,\r
762 IN OUT UINTN *SizeOfBuffer,\r
763 IN CONST VOID *Buffer\r
764 );\r
765\r
878ddf1f 766#endif\r