]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PcdLib.h
Sync up Pcd Library Instances and PCD Driver/PEIM with Pcd spec 0.51 and Mde 0.51
[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
b16ef805 21#include <Common/Pcd.h>\r
22\r
878ddf1f 23\r
24#define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r
25\r
26\r
27//\r
28// Feature Flag is in the form of a global constant\r
29//\r
30#define FeaturePcdGet(TokenName) _gPcd_FixedAtBuild_##TokenName\r
31\r
32\r
33//\r
34// Fixed is fixed at build time\r
35//\r
36#define FixedPcdGet8(TokenName) _gPcd_FixedAtBuild_##TokenName\r
37#define FixedPcdGet16(TokenName) _gPcd_FixedAtBuild_##TokenName\r
38#define FixedPcdGet32(TokenName) _gPcd_FixedAtBuild_##TokenName\r
39#define FixedPcdGet64(TokenName) _gPcd_FixedAtBuild_##TokenName\r
40#define FixedPcdGetBool(TokenName) _gPcd_FixedAtBuild_##TokenName\r
41\r
42\r
43//\r
44// BugBug: This works for strings, but not constants.\r
45//\r
46#define FixedPcdGetPtr(TokenName) ((VOID *)_gPcd_FixedAtBuild_##TokenName)\r
47\r
48\r
49//\r
50// (Binary) Patch is in the form of a global variable\r
51//\r
52#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName\r
53#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName\r
54#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName\r
55#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName\r
56#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName\r
57#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)\r
58\r
b16ef805 59#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = Value)\r
60#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = Value)\r
61#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = Value)\r
62#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = Value)\r
63#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = Value)\r
64#define PatchPcdSetPtr(TokenName, Value, Size) CopyMem (_gPcd_BinaryPatch_##TokenName, Value, 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
70#define PcdGet8(TokenName) _PCD_MODE_8_##TokenName\r
71#define PcdGet16(TokenName) _PCD_MODE_16_##TokenName\r
72#define PcdGet32(TokenName) _PCD_MODE_32_##TokenName\r
73#define PcdGet64(TokenName) _PCD_MODE_64_##TokenName\r
74#define PcdGetPtr(TokenName) _PCD_MODE_PTR_##TokenName\r
75#define PcdGetBool(TokenName) _PCD_MODE_BOOL_##TokenName\r
76\r
77\r
78//\r
79// Dynamic Ex is to support binary distribution\r
80//\r
81#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 (Guid, _PCD_TOKEN_##TokenName)\r
82#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 (Guid, _PCD_TOKEN_##TokenName)\r
83#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 (Guid, _PCD_TOKEN_##TokenName)\r
84#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 (Guid, _PCD_TOKEN_##TokenName)\r
85#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr (Guid, _PCD_TOKEN_##TokenName)\r
86#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool (Guid, _PCD_TOKEN_##TokenName)\r
87\r
88\r
89//\r
90// Dynamic Set\r
91//\r
92#define PcdSet8(TokenName, Value) LibPcdSet8 (_PCD_TOKEN_##TokenName, Value)\r
93#define PcdSet16(TokenName, Value) LibPcdSet16 (_PCD_TOKEN_##TokenName, Value)\r
94#define PcdSet32(TokenName, Value) LibPcdSet32 (_PCD_TOKEN_##TokenName, Value)\r
95#define PcdSet64(TokenName, Value) LibPcdSet64 (_PCD_TOKEN_##TokenName, Value)\r
96#define PcdSetPtr(TokenName, Value) LibPcdSetPtr (_PCD_TOKEN_##TokenName, Value)\r
97#define PcdSetBool(TokenName, Value) LibPcdSetBool(_PCD_TOKEN_##TokenName, Value)\r
98\r
99\r
100//\r
101// Dynamic Set Ex\r
102//\r
dbdaaec4 103#define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 (Guid, _PCD_TOKEN_##TokenName, Value)\r
104#define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 (Guid, _PCD_TOKEN_##TokenName, Value)\r
105#define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 (Guid, _PCD_TOKEN_##TokenName, Value)\r
106#define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 (Guid, _PCD_TOKEN_##TokenName, Value)\r
107#define PcdSetExPtr(Guid, TokenName, Value) LibPcdSetExPtr (Guid, _PCD_TOKEN_##TokenName, Value)\r
108#define PcdSetExBool(Guid, TokenName, Value) 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
b16ef805 120SKU_ID\r
878ddf1f 121EFIAPI\r
122LibPcdSetSku (\r
b16ef805 123 IN SKU_ID 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
b16ef805 138 IN PCD_TOKEN_NUMBER 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
b16ef805 153 IN PCD_TOKEN_NUMBER 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
b16ef805 168 IN PCD_TOKEN_NUMBER 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
b16ef805 183 IN PCD_TOKEN_NUMBER 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
b16ef805 198 IN PCD_TOKEN_NUMBER 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
b16ef805 213 IN PCD_TOKEN_NUMBER 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
b16ef805 228 IN PCD_TOKEN_NUMBER 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
b16ef805 247 IN PCD_TOKEN_NUMBER 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
b16ef805 266 IN PCD_TOKEN_NUMBER 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
b16ef805 285 IN PCD_TOKEN_NUMBER 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
b16ef805 304 IN PCD_TOKEN_NUMBER 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
b16ef805 323 IN PCD_TOKEN_NUMBER 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
b16ef805 342 IN PCD_TOKEN_NUMBER 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
b16ef805 361 IN PCD_TOKEN_NUMBER 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
b16ef805 378 IN PCD_TOKEN_NUMBER 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
b16ef805 396 IN PCD_TOKEN_NUMBER 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
b16ef805 414 IN PCD_TOKEN_NUMBER 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
b16ef805 432 IN PCD_TOKEN_NUMBER 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
b16ef805 451 IN PCD_TOKEN_NUMBER TokenNumber,\r
452 IN UINTN SizeOfBuffer,\r
878ddf1f 453 IN CONST VOID *Value\r
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
b16ef805 470 IN PCD_TOKEN_NUMBER 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
b16ef805 492 IN PCD_TOKEN_NUMBER 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
b16ef805 514 IN PCD_TOKEN_NUMBER 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
b16ef805 536 IN PCD_TOKEN_NUMBER 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
b16ef805 558 IN PCD_TOKEN_NUMBER 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
b16ef805 581 IN PCD_TOKEN_NUMBER TokenNumber,\r
582 IN UINTN SizeOfBuffer,\r
878ddf1f 583 IN CONST VOID *Value\r
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
b16ef805 604 IN PCD_TOKEN_NUMBER 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
627 IN PCD_TOKEN_NUMBER CallBackToken,\r
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
b16ef805 653 IN PCD_TOKEN_NUMBER 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
b16ef805 672 IN PCD_TOKEN_NUMBER 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
b16ef805 690 @retval PCD_TOKEN_NUMBER The next valid token number.\r
878ddf1f 691\r
692**/\r
b16ef805 693PCD_TOKEN_NUMBER\r
878ddf1f 694EFIAPI\r
695LibPcdGetNextToken (\r
696 IN CONST GUID *Guid, OPTIONAL\r
b16ef805 697 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 698 );\r
699\r
700#endif\r