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