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