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