]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/PcdLib.h
Port thunk16 code from MSFT to GCC assembly.
[mirror_edk2.git] / MdePkg / Include / Library / PcdLib.h
... / ...
CommitLineData
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
21#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)\r
22\r
23#define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r
24\r
25\r
26//\r
27// Feature Flag is in the form of a global constant\r
28//\r
29#define FeaturePcdGet(TokenName) _PCD_VALUE_##TokenName\r
30\r
31\r
32//\r
33// Fixed is fixed at build time\r
34//\r
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
40\r
41\r
42//\r
43// BugBug: This works for strings, but not constants.\r
44//\r
45#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r
46\r
47\r
48//\r
49// (Binary) Patch is in the form of a global variable\r
50//\r
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
57\r
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
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_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
76\r
77//\r
78// Dynamic Set\r
79//\r
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
87\r
88//\r
89// Dynamic Ex is to support binary distribution\r
90//\r
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
97\r
98//\r
99// Dynamic Set Ex\r
100//\r
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
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
117 @retval SKU_ID Return the SKU ID that just be set.\r
118\r
119**/\r
120UINTN\r
121EFIAPI\r
122LibPcdSetSku (\r
123 IN UINTN SkuId\r
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
138 IN UINTN TokenNumber\r
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
153 IN UINTN TokenNumber\r
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
168 IN UINTN TokenNumber\r
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
183 IN UINTN TokenNumber\r
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
198 IN UINTN TokenNumber\r
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
213 IN UINTN TokenNumber\r
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
228 IN UINTN TokenNumber\r
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
247 IN UINTN TokenNumber\r
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
266 IN UINTN TokenNumber\r
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
285 IN UINTN TokenNumber\r
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
304 IN UINTN TokenNumber\r
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
323 IN UINTN TokenNumber\r
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
342 IN UINTN TokenNumber\r
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
361 IN UINTN TokenNumber\r
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
378 IN UINTN TokenNumber,\r
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
396 IN UINTN TokenNumber,\r
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
414 IN UINTN TokenNumber,\r
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
432 IN UINTN TokenNumber,\r
433 IN UINT64 Value\r
434 );\r
435\r
436\r
437/**\r
438 Sets a buffer for the token specified by TokenNumber to the value \r
439 specified by Buffer and SizeOfValue. Buffer is returned. \r
440 If SizeOfValue is greater than the maximum size support by TokenNumber, \r
441 then set SizeOfValue to the maximum size supported by TokenNumber and \r
442 return NULL to indicate that the set operation was not actually performed. \r
443\r
444 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to the \r
445 maximum size supported by TokenName and NULL must be returned.\r
446 \r
447 If SizeOfValue is NULL, then ASSERT().\r
448 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
449 \r
450 @param[in] TokenNumber The PCD token number to set a current value for.\r
451 @param[in,out] SizeOfBuffer The size, in bytes, of Buffer.\r
452 @param[in] Value A pointer to the buffer to set.\r
453\r
454 @retval VOID* Return the pointer for the buffer been set.\r
455\r
456**/\r
457VOID*\r
458EFIAPI\r
459LibPcdSetPtr (\r
460 IN UINTN TokenNumber,\r
461 IN OUT UINTN *SizeOfBuffer,\r
462 IN VOID *Value\r
463 );\r
464\r
465\r
466/**\r
467 Sets the Boolean value for the token specified by TokenNumber \r
468 to the value specified by Value. Value is returned.\r
469 \r
470 @param[in] TokenNumber The PCD token number to set a current value for.\r
471 @param[in] Value The boolean value to set.\r
472\r
473 @retval BOOLEAN Return the value been set.\r
474\r
475**/\r
476BOOLEAN\r
477EFIAPI\r
478LibPcdSetBool (\r
479 IN UINTN TokenNumber,\r
480 IN BOOLEAN Value\r
481 );\r
482\r
483\r
484/**\r
485 Sets the 8-bit value for the token specified by TokenNumber and \r
486 Guid to the value specified by Value. Value is returned.\r
487 If Guid is NULL, then ASSERT().\r
488 \r
489 @param[in] Guid Pointer to a 128-bit unique value that \r
490 designates which namespace to set a value from.\r
491 @param[in] TokenNumber The PCD token number to set a current value for.\r
492 @param[in] Value The 8-bit value to set.\r
493\r
494 @retval UINT8 Return the value been set.\r
495\r
496**/\r
497UINT8\r
498EFIAPI\r
499LibPcdSetEx8 (\r
500 IN CONST GUID *Guid,\r
501 IN UINTN TokenNumber,\r
502 IN UINT8 Value\r
503 );\r
504\r
505\r
506/**\r
507 Sets the 16-bit value for the token specified by TokenNumber and \r
508 Guid to the value specified by Value. Value is returned.\r
509 If Guid is NULL, then ASSERT().\r
510 \r
511 @param[in] Guid Pointer to a 128-bit unique value that \r
512 designates which namespace to set a value from.\r
513 @param[in] TokenNumber The PCD token number to set a current value for.\r
514 @param[in] Value The 16-bit value to set.\r
515\r
516 @retval UINT8 Return the value been set.\r
517\r
518**/\r
519UINT16\r
520EFIAPI\r
521LibPcdSetEx16 (\r
522 IN CONST GUID *Guid,\r
523 IN UINTN TokenNumber,\r
524 IN UINT16 Value\r
525 );\r
526\r
527\r
528/**\r
529 Sets the 32-bit value for the token specified by TokenNumber and \r
530 Guid to the value specified by Value. Value is returned.\r
531 If Guid is NULL, then ASSERT().\r
532 \r
533 @param[in] Guid Pointer to a 128-bit unique value that \r
534 designates which namespace to set a value from.\r
535 @param[in] TokenNumber The PCD token number to set a current value for.\r
536 @param[in] Value The 32-bit value to set.\r
537\r
538 @retval UINT32 Return the value been set.\r
539\r
540**/\r
541UINT32\r
542EFIAPI\r
543LibPcdSetEx32 (\r
544 IN CONST GUID *Guid,\r
545 IN UINTN TokenNumber,\r
546 IN UINT32 Value\r
547 );\r
548\r
549\r
550/**\r
551 Sets the 64-bit value for the token specified by TokenNumber and \r
552 Guid to the value specified by Value. Value is returned.\r
553 If Guid is NULL, then ASSERT().\r
554 \r
555 @param[in] Guid Pointer to a 128-bit unique value that \r
556 designates which namespace to set a value from.\r
557 @param[in] TokenNumber The PCD token number to set a current value for.\r
558 @param[in] Value The 64-bit value to set.\r
559\r
560 @retval UINT64 Return the value been set.\r
561\r
562**/\r
563UINT64\r
564EFIAPI\r
565LibPcdSetEx64 (\r
566 IN CONST GUID *Guid,\r
567 IN UINTN TokenNumber,\r
568 IN UINT64 Value\r
569 );\r
570\r
571\r
572/**\r
573 Sets a buffer for the token specified by TokenNumber to the value specified by \r
574 Buffer and SizeOfValue. Buffer is returned. If SizeOfValue is greater than \r
575 the maximum size support by TokenNumber, then set SizeOfValue to the maximum size \r
576 supported by TokenNumber and return NULL to indicate that the set operation \r
577 was not actually performed. \r
578 \r
579 If Guid is NULL, then ASSERT().\r
580 If SizeOfValue is NULL, then ASSERT().\r
581 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
582 \r
583 @param[in] Guid Pointer to a 128-bit unique value that \r
584 designates which namespace to set a value from.\r
585 @param[in] TokenNumber The PCD token number to set a current value for.\r
586 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
587 @param[in] Buffer A pointer to the buffer to set.\r
588\r
589 @retval VOID * Return the pinter to the buffer been set.\r
590\r
591**/\r
592VOID *\r
593EFIAPI\r
594LibPcdSetExPtr (\r
595 IN CONST GUID *Guid,\r
596 IN UINTN TokenNumber,\r
597 IN OUT UINTN *SizeOfBuffer,\r
598 IN VOID *Buffer\r
599 );\r
600\r
601\r
602/**\r
603 Sets the Boolean value for the token specified by TokenNumber and \r
604 Guid to the value specified by Value. Value is returned.\r
605 If Guid is NULL, then ASSERT().\r
606 \r
607 @param[in] Guid Pointer to a 128-bit unique value that \r
608 designates which namespace to set a value from.\r
609 @param[in] TokenNumber The PCD token number to set a current value for.\r
610 @param[in] Value The Boolean value to set.\r
611\r
612 @retval Boolean Return the value been set.\r
613\r
614**/\r
615BOOLEAN\r
616EFIAPI\r
617LibPcdSetExBool (\r
618 IN CONST GUID *Guid,\r
619 IN UINTN TokenNumber,\r
620 IN BOOLEAN Value\r
621 );\r
622\r
623\r
624/**\r
625 When the token specified by TokenNumber and Guid is set, \r
626 then notification function specified by NotificationFunction is called. \r
627 If Guid is NULL, then the default token space is used. \r
628 If NotificationFunction is NULL, then ASSERT().\r
629\r
630 @param[in] CallBackGuid The PCD token GUID being set.\r
631 @param[in] CallBackToken The PCD token number being set.\r
632 @param[in] TokenData A pointer to the token data being set.\r
633 @param[in] TokenDataSize The size, in bytes, of the data being set.\r
634\r
635 @retval VOID\r
636\r
637**/\r
638typedef\r
639VOID\r
640(EFIAPI *PCD_CALLBACK) (\r
641 IN CONST GUID *CallBackGuid, OPTIONAL\r
642 IN UINTN CallBackToken,\r
643 IN OUT VOID *TokenData,\r
644 IN UINTN TokenDataSize\r
645 );\r
646\r
647\r
648/**\r
649 When the token specified by TokenNumber and Guid is set, \r
650 then notification function specified by NotificationFunction is called. \r
651 If Guid is NULL, then the default token space is used. \r
652 If NotificationFunction is NULL, then ASSERT().\r
653\r
654 @param[in] Guid Pointer to a 128-bit unique value that designates which \r
655 namespace to set a value from. If NULL, then the default \r
656 token space is used.\r
657 @param[in] TokenNumber The PCD token number to monitor.\r
658 @param[in] NotificationFunction The function to call when the token \r
659 specified by Guid and TokenNumber is set.\r
660\r
661 @retval VOID\r
662\r
663**/\r
664VOID\r
665EFIAPI\r
666LibPcdCallbackOnSet (\r
667 IN CONST GUID *Guid, OPTIONAL\r
668 IN UINTN TokenNumber,\r
669 IN PCD_CALLBACK NotificationFunction\r
670 );\r
671\r
672\r
673/**\r
674 Disable a notification function that was established with LibPcdCallbackonSet().\r
675\r
676 @param[in] Guid Specify the GUID token space.\r
677 @param[in] TokenNumber Specify the token number.\r
678 @param[in] NotificationFunction The callback function to be unregistered.\r
679\r
680 @retval VOID\r
681\r
682**/\r
683VOID\r
684EFIAPI\r
685LibPcdCancelCallback (\r
686 IN CONST GUID *Guid, OPTIONAL\r
687 IN UINTN TokenNumber,\r
688 IN PCD_CALLBACK NotificationFunction\r
689 );\r
690\r
691\r
692/**\r
693 Retrieves the next PCD token number from the token space specified by Guid. \r
694 If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r
695 then the first token number is returned. Otherwise, the token number that \r
696 follows TokenNumber in the token space is returned. If TokenNumber is the last \r
697 token number in the token space, then 0 is returned. If TokenNumber is not 0 and \r
698 is not in the token space specified by Guid, then ASSERT().\r
699\r
700 @param[in] Pointer to a 128-bit unique value that designates which namespace \r
701 to set a value from. If NULL, then the default token space is used.\r
702 @param[in] The previous PCD token number. If 0, then retrieves the first PCD \r
703 token number.\r
704\r
705 @retval UINTN The next valid token number.\r
706\r
707**/\r
708UINTN \r
709EFIAPI\r
710LibPcdGetNextToken (\r
711 IN CONST GUID *Guid, OPTIONAL\r
712 IN UINTN TokenNumber\r
713 );\r
714\r
715\r
716\r
717/**\r
718 Retrieves the next PCD token space from a token space specified by Guid.\r
719 Guid of NULL is reserved to mark the default local token namespace on the current\r
720 platform. If Guid is NULL, then the GUID of the first non-local token space of the \r
721 current platform is returned. If Guid is the last non-local token space, \r
722 then NULL is returned. \r
723\r
724 If Guid is not NULL and is not a valid token space in the current platform, then ASSERT().\r
725\r
726\r
727 \r
728 @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace \r
729 to start the search.\r
730\r
731 @retval CONST GUID * The next valid token namespace.\r
732\r
733**/\r
734GUID * \r
735EFIAPI\r
736LibPcdGetNextTokenSpace (\r
737 IN CONST GUID *Guid\r
738 );\r
739\r
740\r
741/**\r
742 Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
743 and SizeOfValue. Buffer is returned. If SizeOfValue is greater than \r
744 MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
745 NULL to indicate that the set operation was not actually performed. \r
746 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
747 MaximumDatumSize and NULL must be returned.\r
748 \r
749 If PatchVariable is NULL, then ASSERT().\r
750 If SizeOfValue is NULL, then ASSERT().\r
751 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
752\r
753 @param[in] PatchVariable A pointer to the global variable in a module that is \r
754 the target of the set operation.\r
755 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
756 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
757 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
758\r
759**/\r
760VOID *\r
761EFIAPI\r
762LibPatchPcdSetPtr (\r
763 IN VOID *PatchVariable,\r
764 IN UINTN MaximumDatumSize,\r
765 IN OUT UINTN *SizeOfBuffer,\r
766 IN CONST VOID *Buffer\r
767 );\r
768\r
769#endif\r