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