]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PcdLib.h
Enabling use PcdSetXX macro to set value for PATCHABLE_IN_MODULE, DYNAMIC, DYNAMIC_EX...
[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
439 the value specified by Value. Value is returned.\r
440 If Value is NULL, then ASSERT().\r
441 \r
442 @param[in] TokenNumber The PCD token number to set a current value for.\r
443 @param[in] Value A pointer to the buffer to set.\r
444\r
445 @retval VOID* Return the pointer for the buffer been set.\r
446\r
447**/\r
448VOID*\r
449EFIAPI\r
450LibPcdSetPtr (\r
8a43e8dd 451 IN UINTN TokenNumber,\r
b16ef805 452 IN UINTN SizeOfBuffer,\r
342fcc1e 453 IN VOID *Value\r
878ddf1f 454 );\r
455\r
456\r
457/**\r
458 Sets the Boolean value for the token specified by TokenNumber \r
459 to the value specified by Value. Value is returned.\r
460 \r
461 @param[in] TokenNumber The PCD token number to set a current value for.\r
462 @param[in] Value The boolean value to set.\r
463\r
464 @retval BOOLEAN Return the value been set.\r
465\r
466**/\r
467BOOLEAN\r
468EFIAPI\r
469LibPcdSetBool (\r
8a43e8dd 470 IN UINTN TokenNumber,\r
878ddf1f 471 IN BOOLEAN Value\r
472 );\r
473\r
474\r
475/**\r
476 Sets the 8-bit value for the token specified by TokenNumber and \r
477 Guid to the value specified by Value. Value is returned.\r
478 If Guid is NULL, then ASSERT().\r
479 \r
480 @param[in] Guid Pointer to a 128-bit unique value that \r
481 designates which namespace to set a value from.\r
482 @param[in] TokenNumber The PCD token number to set a current value for.\r
483 @param[in] Value The 8-bit value to set.\r
484\r
485 @retval UINT8 Return the value been set.\r
486\r
487**/\r
488UINT8\r
489EFIAPI\r
490LibPcdSetEx8 (\r
491 IN CONST GUID *Guid,\r
8a43e8dd 492 IN UINTN TokenNumber,\r
878ddf1f 493 IN UINT8 Value\r
494 );\r
495\r
496\r
497/**\r
498 Sets the 16-bit value for the token specified by TokenNumber and \r
499 Guid to the value specified by Value. Value is returned.\r
500 If Guid is NULL, then ASSERT().\r
501 \r
502 @param[in] Guid Pointer to a 128-bit unique value that \r
503 designates which namespace to set a value from.\r
504 @param[in] TokenNumber The PCD token number to set a current value for.\r
505 @param[in] Value The 16-bit value to set.\r
506\r
507 @retval UINT8 Return the value been set.\r
508\r
509**/\r
510UINT16\r
511EFIAPI\r
512LibPcdSetEx16 (\r
513 IN CONST GUID *Guid,\r
8a43e8dd 514 IN UINTN TokenNumber,\r
878ddf1f 515 IN UINT16 Value\r
516 );\r
517\r
518\r
519/**\r
520 Sets the 32-bit value for the token specified by TokenNumber and \r
521 Guid to the value specified by Value. Value is returned.\r
522 If Guid is NULL, then ASSERT().\r
523 \r
524 @param[in] Guid Pointer to a 128-bit unique value that \r
525 designates which namespace to set a value from.\r
526 @param[in] TokenNumber The PCD token number to set a current value for.\r
527 @param[in] Value The 32-bit value to set.\r
528\r
529 @retval UINT32 Return the value been set.\r
530\r
531**/\r
532UINT32\r
533EFIAPI\r
534LibPcdSetEx32 (\r
535 IN CONST GUID *Guid,\r
8a43e8dd 536 IN UINTN TokenNumber,\r
878ddf1f 537 IN UINT32 Value\r
538 );\r
539\r
540\r
541/**\r
542 Sets the 64-bit value for the token specified by TokenNumber and \r
543 Guid to the value specified by Value. Value is returned.\r
544 If Guid is NULL, then ASSERT().\r
545 \r
546 @param[in] Guid Pointer to a 128-bit unique value that \r
547 designates which namespace to set a value from.\r
548 @param[in] TokenNumber The PCD token number to set a current value for.\r
549 @param[in] Value The 64-bit value to set.\r
550\r
551 @retval UINT64 Return the value been set.\r
552\r
553**/\r
554UINT64\r
555EFIAPI\r
556LibPcdSetEx64 (\r
557 IN CONST GUID *Guid,\r
8a43e8dd 558 IN UINTN TokenNumber,\r
878ddf1f 559 IN UINT64 Value\r
560 );\r
561\r
562\r
563/**\r
564 Sets a buffer for the token specified by TokenNumber and \r
565 Guid to the value specified by Value. Value is returned.\r
566 If Guid is NULL, then ASSERT().\r
567 If Value is NULL, then ASSERT().\r
568 \r
569 @param[in] Guid Pointer to a 128-bit unique value that \r
570 designates which namespace to set a value from.\r
571 @param[in] TokenNumber The PCD token number to set a current value for.\r
572 @param[in] Value The 8-bit value to set.\r
573\r
574 @retval VOID * Return the value been set.\r
575\r
576**/\r
577VOID *\r
578EFIAPI\r
579LibPcdSetExPtr (\r
580 IN CONST GUID *Guid,\r
8a43e8dd 581 IN UINTN TokenNumber,\r
b16ef805 582 IN UINTN SizeOfBuffer,\r
342fcc1e 583 IN VOID *Value\r
878ddf1f 584 );\r
585\r
586\r
587/**\r
588 Sets the Boolean value for the token specified by TokenNumber and \r
589 Guid to the value specified by Value. Value is returned.\r
590 If Guid is NULL, then ASSERT().\r
591 \r
592 @param[in] Guid Pointer to a 128-bit unique value that \r
593 designates which namespace to set a value from.\r
594 @param[in] TokenNumber The PCD token number to set a current value for.\r
595 @param[in] Value The Boolean value to set.\r
596\r
597 @retval Boolean Return the value been set.\r
598\r
599**/\r
600BOOLEAN\r
601EFIAPI\r
602LibPcdSetExBool (\r
603 IN CONST GUID *Guid,\r
8a43e8dd 604 IN UINTN TokenNumber,\r
878ddf1f 605 IN BOOLEAN Value\r
606 );\r
607\r
608\r
609/**\r
610 When the token specified by TokenNumber and Guid is set, \r
611 then notification function specified by NotificationFunction is called. \r
612 If Guid is NULL, then the default token space is used. \r
613 If NotificationFunction is NULL, then ASSERT().\r
614\r
615 @param[in] CallBackGuid The PCD token GUID being set.\r
616 @param[in] CallBackToken The PCD token number being set.\r
617 @param[in] TokenData A pointer to the token data being set.\r
618 @param[in] TokenDataSize The size, in bytes, of the data being set.\r
619\r
620 @retval VOID\r
621\r
622**/\r
623typedef\r
624VOID\r
625(EFIAPI *PCD_CALLBACK) (\r
b16ef805 626 IN CONST GUID *CallBackGuid, OPTIONAL\r
8a43e8dd 627 IN UINTN CallBackToken,\r
b16ef805 628 IN OUT VOID *TokenData,\r
629 IN UINTN TokenDataSize\r
878ddf1f 630 );\r
631\r
632\r
633/**\r
634 When the token specified by TokenNumber and Guid is set, \r
635 then notification function specified by NotificationFunction is called. \r
636 If Guid is NULL, then the default token space is used. \r
637 If NotificationFunction is NULL, then ASSERT().\r
638\r
639 @param[in] Guid Pointer to a 128-bit unique value that designates which \r
640 namespace to set a value from. If NULL, then the default \r
641 token space is used.\r
642 @param[in] TokenNumber The PCD token number to monitor.\r
643 @param[in] NotificationFunction The function to call when the token \r
644 specified by Guid and TokenNumber is set.\r
645\r
646 @retval VOID\r
647\r
648**/\r
649VOID\r
650EFIAPI\r
651LibPcdCallbackOnSet (\r
652 IN CONST GUID *Guid, OPTIONAL\r
8a43e8dd 653 IN UINTN TokenNumber,\r
878ddf1f 654 IN PCD_CALLBACK NotificationFunction\r
655 );\r
656\r
657\r
658/**\r
659 Disable a notification function that was established with LibPcdCallbackonSet().\r
660\r
661 @param[in] Guid Specify the GUID token space.\r
662 @param[in] TokenNumber Specify the token number.\r
663 @param[in] NotificationFunction The callback function to be unregistered.\r
664\r
665 @retval VOID\r
666\r
667**/\r
668VOID\r
669EFIAPI\r
670LibPcdCancelCallback (\r
671 IN CONST GUID *Guid, OPTIONAL\r
8a43e8dd 672 IN UINTN TokenNumber,\r
878ddf1f 673 IN PCD_CALLBACK NotificationFunction\r
674 );\r
675\r
676\r
677/**\r
678 Retrieves the next PCD token number from the token space specified by Guid. \r
679 If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r
680 then the first token number is returned. Otherwise, the token number that \r
681 follows TokenNumber in the token space is returned. If TokenNumber is the last \r
682 token number in the token space, then 0 is returned. If TokenNumber is not 0 and \r
683 is not in the token space specified by Guid, then ASSERT().\r
684\r
685 @param[in] Pointer to a 128-bit unique value that designates which namespace \r
686 to set a value from. If NULL, then the default token space is used.\r
687 @param[in] The previous PCD token number. If 0, then retrieves the first PCD \r
688 token number.\r
689\r
8a43e8dd 690 @retval UINTN The next valid token number.\r
878ddf1f 691\r
692**/\r
8a43e8dd 693UINTN \r
878ddf1f 694EFIAPI\r
695LibPcdGetNextToken (\r
696 IN CONST GUID *Guid, OPTIONAL\r
8a43e8dd 697 IN UINTN TokenNumber\r
878ddf1f 698 );\r
699\r
700#endif\r