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