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