]>
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 | |
57a38e69 | 29 | #define FeaturePcdGet(TokenName) _PCD_VALUE_##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 | |
42 | //\r | |
43 | // BugBug: This works for strings, but not constants.\r | |
44 | //\r | |
57a38e69 | 45 | #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r |
878ddf1f | 46 | \r |
47 | \r | |
48 | //\r | |
49 | // (Binary) Patch is in the form of a global variable\r | |
50 | //\r | |
57a38e69 | 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 | |
878ddf1f | 57 | \r |
57a38e69 | 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 | |
878ddf1f | 65 | \r |
66 | //\r | |
67 | // Dynamic is via the protocol with only the TokenNumber as argument\r | |
68 | // It can also be Patch or Fixed type based on a build option\r | |
69 | //\r | |
57a38e69 | 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 | |
878ddf1f | 76 | \r |
77 | //\r | |
57a38e69 | 78 | // Dynamic Set\r |
878ddf1f | 79 | //\r |
57a38e69 | 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 | |
878ddf1f | 87 | \r |
88 | //\r | |
57a38e69 | 89 | // Dynamic Ex is to support binary distribution\r |
878ddf1f | 90 | //\r |
57a38e69 | 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 | |
878ddf1f | 97 | \r |
98 | //\r | |
99 | // Dynamic Set Ex\r | |
100 | //\r | |
57a38e69 | 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 | |
878ddf1f | 109 | \r |
110 | \r | |
111 | /**\r | |
112 | Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r | |
113 | \r | |
114 | @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r | |
115 | set values associated with a PCD token.\r | |
116 | \r | |
b16ef805 | 117 | @retval SKU_ID Return the SKU ID that just be set.\r |
878ddf1f | 118 | \r |
119 | **/\r | |
8a43e8dd | 120 | UINTN\r |
878ddf1f | 121 | EFIAPI\r |
122 | LibPcdSetSku (\r | |
8a43e8dd | 123 | IN UINTN SkuId\r |
878ddf1f | 124 | );\r |
125 | \r | |
126 | \r | |
127 | /**\r | |
128 | Returns the 8-bit value for the token specified by TokenNumber. \r | |
129 | \r | |
130 | @param[in] The PCD token number to retrieve a current value for.\r | |
131 | \r | |
132 | @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber. \r | |
133 | \r | |
134 | **/\r | |
135 | UINT8\r | |
136 | EFIAPI\r | |
137 | LibPcdGet8 (\r | |
8a43e8dd | 138 | IN UINTN TokenNumber\r |
878ddf1f | 139 | );\r |
140 | \r | |
141 | \r | |
142 | /**\r | |
143 | Returns the 16-bit value for the token specified by TokenNumber. \r | |
144 | \r | |
145 | @param[in] The PCD token number to retrieve a current value for.\r | |
146 | \r | |
147 | @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber. \r | |
148 | \r | |
149 | **/\r | |
150 | UINT16\r | |
151 | EFIAPI\r | |
152 | LibPcdGet16 (\r | |
8a43e8dd | 153 | IN UINTN TokenNumber\r |
878ddf1f | 154 | );\r |
155 | \r | |
156 | \r | |
157 | /**\r | |
158 | Returns the 32-bit value for the token specified by TokenNumber. \r | |
159 | \r | |
160 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
161 | \r | |
162 | @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.\r | |
163 | \r | |
164 | **/\r | |
165 | UINT32\r | |
166 | EFIAPI\r | |
167 | LibPcdGet32 (\r | |
8a43e8dd | 168 | IN UINTN TokenNumber\r |
878ddf1f | 169 | );\r |
170 | \r | |
171 | \r | |
172 | /**\r | |
173 | Returns the 64-bit value for the token specified by TokenNumber.\r | |
174 | \r | |
175 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
176 | \r | |
177 | @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.\r | |
178 | \r | |
179 | **/\r | |
180 | UINT64\r | |
181 | EFIAPI\r | |
182 | LibPcdGet64 (\r | |
8a43e8dd | 183 | IN UINTN TokenNumber\r |
878ddf1f | 184 | );\r |
185 | \r | |
186 | \r | |
187 | /**\r | |
188 | Returns the pointer to the buffer of the token specified by TokenNumber.\r | |
189 | \r | |
190 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
191 | \r | |
192 | @retval VOID* Returns the pointer to the token specified by TokenNumber.\r | |
193 | \r | |
194 | **/\r | |
195 | VOID *\r | |
196 | EFIAPI\r | |
197 | LibPcdGetPtr (\r | |
8a43e8dd | 198 | IN UINTN TokenNumber\r |
878ddf1f | 199 | );\r |
200 | \r | |
201 | \r | |
202 | /**\r | |
203 | Returns the Boolean value of the token specified by TokenNumber. \r | |
204 | \r | |
205 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
206 | \r | |
207 | @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber. \r | |
208 | \r | |
209 | **/\r | |
210 | BOOLEAN \r | |
211 | EFIAPI\r | |
212 | LibPcdGetBool (\r | |
8a43e8dd | 213 | IN UINTN TokenNumber\r |
878ddf1f | 214 | );\r |
215 | \r | |
216 | \r | |
217 | /**\r | |
218 | Returns the size of the token specified by TokenNumber. \r | |
219 | \r | |
220 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
221 | \r | |
222 | @retval UINTN Returns the size of the token specified by TokenNumber. \r | |
223 | \r | |
224 | **/\r | |
225 | UINTN\r | |
226 | EFIAPI\r | |
227 | LibPcdGetSize (\r | |
8a43e8dd | 228 | IN UINTN TokenNumber\r |
878ddf1f | 229 | );\r |
230 | \r | |
231 | \r | |
232 | /**\r | |
233 | Returns the 8-bit value for the token specified by TokenNumber and Guid.\r | |
234 | If Guid is NULL, then ASSERT(). \r | |
235 | \r | |
236 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
237 | which namespace to retrieve a value from.\r | |
238 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
239 | \r | |
240 | @retval UINT8 Return the UINT8.\r | |
241 | \r | |
242 | **/\r | |
243 | UINT8\r | |
244 | EFIAPI\r | |
245 | LibPcdGetEx8 (\r | |
246 | IN CONST GUID *Guid,\r | |
8a43e8dd | 247 | IN UINTN TokenNumber\r |
878ddf1f | 248 | );\r |
249 | \r | |
250 | \r | |
251 | /**\r | |
252 | Returns the 16-bit value for the token specified by TokenNumber and Guid.\r | |
253 | If Guid is NULL, then ASSERT(). \r | |
254 | \r | |
255 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
256 | which namespace to retrieve a value from.\r | |
257 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
258 | \r | |
259 | @retval UINT16 Return the UINT16.\r | |
260 | \r | |
261 | **/\r | |
262 | UINT16\r | |
263 | EFIAPI\r | |
264 | LibPcdGetEx16 (\r | |
265 | IN CONST GUID *Guid,\r | |
8a43e8dd | 266 | IN UINTN TokenNumber\r |
878ddf1f | 267 | );\r |
268 | \r | |
269 | \r | |
270 | /**\r | |
271 | Returns the 32-bit value for the token specified by TokenNumber and Guid.\r | |
272 | If Guid is NULL, then ASSERT(). \r | |
273 | \r | |
274 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
275 | which namespace to retrieve a value from.\r | |
276 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
277 | \r | |
278 | @retval UINT32 Return the UINT32.\r | |
279 | \r | |
280 | **/\r | |
281 | UINT32\r | |
282 | EFIAPI\r | |
283 | LibPcdGetEx32 (\r | |
284 | IN CONST GUID *Guid,\r | |
8a43e8dd | 285 | IN UINTN TokenNumber\r |
878ddf1f | 286 | );\r |
287 | \r | |
288 | \r | |
289 | /**\r | |
290 | Returns the 64-bit value for the token specified by TokenNumber and Guid.\r | |
291 | If Guid is NULL, then ASSERT(). \r | |
292 | \r | |
293 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
294 | which namespace to retrieve a value from.\r | |
295 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
296 | \r | |
297 | @retval UINT64 Return the UINT64.\r | |
298 | \r | |
299 | **/\r | |
300 | UINT64\r | |
301 | EFIAPI\r | |
302 | LibPcdGetEx64 (\r | |
303 | IN CONST GUID *Guid,\r | |
8a43e8dd | 304 | IN UINTN TokenNumber\r |
878ddf1f | 305 | );\r |
306 | \r | |
307 | \r | |
308 | /**\r | |
309 | Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r | |
310 | If Guid is NULL, then ASSERT(). \r | |
311 | \r | |
312 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
313 | which namespace to retrieve a value from.\r | |
314 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
315 | \r | |
316 | @retval VOID* Return the VOID* pointer.\r | |
317 | \r | |
318 | **/\r | |
319 | VOID *\r | |
320 | EFIAPI\r | |
321 | LibPcdGetExPtr (\r | |
322 | IN CONST GUID *Guid,\r | |
8a43e8dd | 323 | IN UINTN TokenNumber\r |
878ddf1f | 324 | );\r |
325 | \r | |
326 | \r | |
327 | /**\r | |
328 | Returns the Boolean value of the token specified by TokenNumber and Guid. \r | |
329 | If Guid is NULL, then ASSERT(). \r | |
330 | \r | |
331 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
332 | which namespace to retrieve a value from.\r | |
333 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
334 | \r | |
335 | @retval BOOLEAN Return the BOOLEAN.\r | |
336 | \r | |
337 | **/\r | |
338 | BOOLEAN\r | |
339 | EFIAPI\r | |
340 | LibPcdGetExBool (\r | |
341 | IN CONST GUID *Guid,\r | |
8a43e8dd | 342 | IN UINTN TokenNumber\r |
878ddf1f | 343 | );\r |
344 | \r | |
345 | \r | |
346 | /**\r | |
347 | Returns the size of the token specified by TokenNumber and Guid. \r | |
348 | If Guid is NULL, then ASSERT(). \r | |
349 | \r | |
350 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
351 | which namespace to retrieve a value from.\r | |
352 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
353 | \r | |
354 | @retval UINTN Return the size.\r | |
355 | \r | |
356 | **/\r | |
357 | UINTN\r | |
358 | EFIAPI\r | |
359 | LibPcdGetExSize (\r | |
360 | IN CONST GUID *Guid,\r | |
8a43e8dd | 361 | IN UINTN TokenNumber\r |
878ddf1f | 362 | );\r |
363 | \r | |
364 | \r | |
365 | /**\r | |
366 | Sets the 8-bit value for the token specified by TokenNumber \r | |
367 | to the value specified by Value. Value is returned.\r | |
368 | \r | |
369 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
370 | @param[in] Value The 8-bit value to set.\r | |
371 | \r | |
372 | @retval UINT8 Return the value been set.\r | |
373 | \r | |
374 | **/\r | |
375 | UINT8\r | |
376 | EFIAPI\r | |
377 | LibPcdSet8 (\r | |
8a43e8dd | 378 | IN UINTN TokenNumber,\r |
878ddf1f | 379 | IN UINT8 Value\r |
380 | );\r | |
381 | \r | |
382 | \r | |
383 | /**\r | |
384 | Sets the 16-bit value for the token specified by TokenNumber \r | |
385 | to the value specified by Value. Value is returned.\r | |
386 | \r | |
387 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
388 | @param[in] Value The 16-bit value to set.\r | |
389 | \r | |
390 | @retval UINT16 Return the value been set.\r | |
391 | \r | |
392 | **/\r | |
393 | UINT16\r | |
394 | EFIAPI\r | |
395 | LibPcdSet16 (\r | |
8a43e8dd | 396 | IN UINTN TokenNumber,\r |
878ddf1f | 397 | IN UINT16 Value\r |
398 | );\r | |
399 | \r | |
400 | \r | |
401 | /**\r | |
402 | Sets the 32-bit value for the token specified by TokenNumber \r | |
403 | to the value specified by Value. Value is returned.\r | |
404 | \r | |
405 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
406 | @param[in] Value The 32-bit value to set.\r | |
407 | \r | |
408 | @retval UINT32 Return the value been set.\r | |
409 | \r | |
410 | **/\r | |
411 | UINT32\r | |
412 | EFIAPI\r | |
413 | LibPcdSet32 (\r | |
8a43e8dd | 414 | IN UINTN TokenNumber,\r |
878ddf1f | 415 | IN UINT32 Value\r |
416 | );\r | |
417 | \r | |
418 | \r | |
419 | /**\r | |
420 | Sets the 64-bit value for the token specified by TokenNumber \r | |
421 | to the value specified by Value. Value is returned.\r | |
422 | \r | |
423 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
424 | @param[in] Value The 64-bit value to set.\r | |
425 | \r | |
426 | @retval UINT64 Return the value been set.\r | |
427 | \r | |
428 | **/\r | |
429 | UINT64\r | |
430 | EFIAPI\r | |
431 | LibPcdSet64 (\r | |
8a43e8dd | 432 | IN UINTN TokenNumber,\r |
878ddf1f | 433 | IN UINT64 Value\r |
434 | );\r | |
435 | \r | |
436 | \r | |
437 | /**\r | |
bb5545b6 | 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 | |
4276d5da | 446 | \r |
bb5545b6 | 447 | If SizeOfValue is NULL, then ASSERT().\r |
4276d5da | 448 | If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r |
878ddf1f | 449 | \r |
450 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
4276d5da | 451 | @param[in,out] SizeOfBuffer The size, in bytes, of Buffer.\r |
878ddf1f | 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 | |
457 | VOID*\r | |
458 | EFIAPI\r | |
459 | LibPcdSetPtr (\r | |
4276d5da | 460 | IN UINTN TokenNumber,\r |
461 | IN OUT UINTN *SizeOfBuffer,\r | |
462 | IN VOID *Value\r | |
878ddf1f | 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 | |
476 | BOOLEAN\r | |
477 | EFIAPI\r | |
478 | LibPcdSetBool (\r | |
8a43e8dd | 479 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
497 | UINT8\r | |
498 | EFIAPI\r | |
499 | LibPcdSetEx8 (\r | |
500 | IN CONST GUID *Guid,\r | |
8a43e8dd | 501 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
519 | UINT16\r | |
520 | EFIAPI\r | |
521 | LibPcdSetEx16 (\r | |
522 | IN CONST GUID *Guid,\r | |
8a43e8dd | 523 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
541 | UINT32\r | |
542 | EFIAPI\r | |
543 | LibPcdSetEx32 (\r | |
544 | IN CONST GUID *Guid,\r | |
8a43e8dd | 545 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
563 | UINT64\r | |
564 | EFIAPI\r | |
565 | LibPcdSetEx64 (\r | |
566 | IN CONST GUID *Guid,\r | |
8a43e8dd | 567 | IN UINTN TokenNumber,\r |
878ddf1f | 568 | IN UINT64 Value\r |
569 | );\r | |
570 | \r | |
571 | \r | |
572 | /**\r | |
4276d5da | 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 | |
bb5545b6 | 579 | If Guid is NULL, then ASSERT().\r |
580 | If SizeOfValue is NULL, then ASSERT().\r | |
4276d5da | 581 | If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r |
878ddf1f | 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 | |
4276d5da | 586 | @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r |
587 | @param[in] Buffer A pointer to the buffer to set.\r | |
878ddf1f | 588 | \r |
4276d5da | 589 | @retval VOID * Return the pinter to the buffer been set.\r |
878ddf1f | 590 | \r |
591 | **/\r | |
592 | VOID *\r | |
593 | EFIAPI\r | |
594 | LibPcdSetExPtr (\r | |
4276d5da | 595 | IN CONST GUID *Guid,\r |
596 | IN UINTN TokenNumber,\r | |
597 | IN OUT UINTN *SizeOfBuffer,\r | |
598 | IN VOID *Buffer\r | |
878ddf1f | 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 | |
615 | BOOLEAN\r | |
616 | EFIAPI\r | |
617 | LibPcdSetExBool (\r | |
618 | IN CONST GUID *Guid,\r | |
8a43e8dd | 619 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
638 | typedef\r | |
639 | VOID\r | |
640 | (EFIAPI *PCD_CALLBACK) (\r | |
b16ef805 | 641 | IN CONST GUID *CallBackGuid, OPTIONAL\r |
8a43e8dd | 642 | IN UINTN CallBackToken,\r |
b16ef805 | 643 | IN OUT VOID *TokenData,\r |
644 | IN UINTN TokenDataSize\r | |
878ddf1f | 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 | |
664 | VOID\r | |
665 | EFIAPI\r | |
666 | LibPcdCallbackOnSet (\r | |
667 | IN CONST GUID *Guid, OPTIONAL\r | |
8a43e8dd | 668 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
683 | VOID\r | |
684 | EFIAPI\r | |
685 | LibPcdCancelCallback (\r | |
686 | IN CONST GUID *Guid, OPTIONAL\r | |
8a43e8dd | 687 | IN UINTN TokenNumber,\r |
878ddf1f | 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 | |
8a43e8dd | 705 | @retval UINTN The next valid token number.\r |
878ddf1f | 706 | \r |
707 | **/\r | |
8a43e8dd | 708 | UINTN \r |
878ddf1f | 709 | EFIAPI\r |
710 | LibPcdGetNextToken (\r | |
711 | IN CONST GUID *Guid, OPTIONAL\r | |
8a43e8dd | 712 | IN UINTN TokenNumber\r |
878ddf1f | 713 | );\r |
714 | \r | |
4276d5da | 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 | |
1eb73ab5 | 728 | @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace \r |
4276d5da | 729 | to start the search.\r |
730 | \r | |
731 | @retval CONST GUID * The next valid token namespace.\r | |
732 | \r | |
733 | **/\r | |
bb5545b6 | 734 | GUID * \r |
4276d5da | 735 | EFIAPI\r |
736 | LibPcdGetNextTokenSpace (\r | |
737 | IN CONST GUID *Guid\r | |
738 | );\r | |
739 | \r | |
1eb73ab5 | 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 | |
760 | VOID *\r | |
761 | EFIAPI\r | |
762 | LibPatchPcdSetPtr (\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 | |
878ddf1f | 769 | #endif\r |