]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Provides library services to get and set Platform Configuration Database entries.\r | |
3 | \r | |
4 | PCD Library Class provides PCD usage macro interface for all PCD types.\r | |
5 | It should be included at any module who use PCD. If module use dynamic/dynamicex\r | |
6 | PCD, module should be linked to PEIM/DXE library instance to access that PCD.\r | |
7 | If module uses PatchableInModule type PCD, also need library instance produce\r | |
8 | LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, macro interface is\r | |
9 | translated to an variable or macro which is auto-generated by build tool in\r | |
10 | module's autogen.h/autogen.c.\r | |
11 | The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are \r | |
12 | only available prior to ExitBootServices(). If access to PCD values are required \r | |
13 | at runtime, then their values must be collected prior to ExitBootServices().\r | |
14 | There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),\r | |
15 | PatchPcdGetXX(), and PatchPcdSetXX().\r | |
16 | \r | |
17 | Copyright (c) 2006 - 2008, Intel Corporation\r | |
18 | All rights reserved. This program and the accompanying materials\r | |
19 | are licensed and made available under the terms and conditions of the BSD License\r | |
20 | which accompanies this distribution. The full text of the license may be found at\r | |
21 | http://opensource.org/licenses/bsd-license.php\r | |
22 | \r | |
23 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
24 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
25 | \r | |
26 | **/\r | |
27 | \r | |
28 | #ifndef __PCD_LIB_H__\r | |
29 | #define __PCD_LIB_H__\r | |
30 | \r | |
31 | #define PCD_MAX_SKU_ID 0x100\r | |
32 | \r | |
33 | \r | |
34 | /**\r | |
35 | Retrieves a token number based on a token name.\r | |
36 | \r | |
37 | Returns the token number associated with the PCD token specified by TokenName.\r | |
38 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
39 | If TokenName is not a feature flag, then the module will not build.\r | |
40 | \r | |
41 | @param TokenName The name of the PCD token to retrieve the token number for.\r | |
42 | \r | |
43 | @return The token number associated with the PCD.\r | |
44 | \r | |
45 | **/\r | |
46 | #define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r | |
47 | \r | |
48 | \r | |
49 | /**\r | |
50 | Retrieves a Boolean PCD feature flag based on a token name.\r | |
51 | \r | |
52 | Returns the Boolean value for the PCD feature flag specified by TokenName.\r | |
53 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
54 | If TokenName is not a feature flag, then the module will not build.\r | |
55 | \r | |
56 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
57 | \r | |
58 | @return Boolean value for the PCD feature flag.\r | |
59 | \r | |
60 | **/\r | |
61 | #define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r | |
62 | \r | |
63 | \r | |
64 | /**\r | |
65 | Retrieves an 8-bit fixed PCD token value based on a token name.\r | |
66 | \r | |
67 | Returns the 8-bit value for the token specified by TokenName.\r | |
68 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
69 | If TokenName is not a feature flag, then the module will not build.\r | |
70 | \r | |
71 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
72 | \r | |
73 | @return 8-bit value for the token specified by TokenName.\r | |
74 | \r | |
75 | **/\r | |
76 | #define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName\r | |
77 | \r | |
78 | \r | |
79 | /**\r | |
80 | Retrieves a 16-bit fixed PCD token value based on a token name.\r | |
81 | \r | |
82 | Returns the 16-bit value for the token specified by TokenName.\r | |
83 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
84 | If TokenName is not a feature flag, then the module will not build.\r | |
85 | \r | |
86 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
87 | \r | |
88 | @return 16-bit value for the token specified by TokenName.\r | |
89 | \r | |
90 | **/\r | |
91 | #define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName\r | |
92 | \r | |
93 | \r | |
94 | /**\r | |
95 | Retrieves a 32-bit fixed PCD token value based on a token name.\r | |
96 | \r | |
97 | Returns the 32-bit value for the token specified by TokenName.\r | |
98 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
99 | If TokenName is not a feature flag, then the module will not build.\r | |
100 | \r | |
101 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
102 | \r | |
103 | @return 32-bit value for the token specified by TokenName.\r | |
104 | \r | |
105 | **/\r | |
106 | #define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName\r | |
107 | \r | |
108 | \r | |
109 | /**\r | |
110 | Retrieves a 64-bit fixed PCD token value based on a token name.\r | |
111 | \r | |
112 | Returns the 64-bit value for the token specified by TokenName.\r | |
113 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
114 | If TokenName is not a feature flag, then the module will not build.\r | |
115 | \r | |
116 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
117 | \r | |
118 | @return 64-bit value for the token specified by TokenName.\r | |
119 | \r | |
120 | **/\r | |
121 | #define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName\r | |
122 | \r | |
123 | \r | |
124 | /**\r | |
125 | Retrieves a Boolean fixed PCD token value based on a token name.\r | |
126 | \r | |
127 | Returns the Boolean value for the token specified by TokenName.\r | |
128 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
129 | If TokenName is not a feature flag, then the module will not build.\r | |
130 | \r | |
131 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
132 | \r | |
133 | @return The Boolean value for the token. \r | |
134 | \r | |
135 | **/\r | |
136 | #define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName\r | |
137 | \r | |
138 | \r | |
139 | /**\r | |
140 | Retrieves a pointer to a fixed PCD token buffer based on a token name.\r | |
141 | \r | |
142 | Returns a pointer to the buffer for the token specified by TokenName.\r | |
143 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
144 | If TokenName is not a feature flag, then the module will not build.\r | |
145 | \r | |
146 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
147 | \r | |
148 | @return A pointer to the buffer. \r | |
149 | \r | |
150 | **/\r | |
151 | #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r | |
152 | \r | |
153 | \r | |
154 | /**\r | |
155 | Retrieves an 8-bit binary patchable PCD token value based on a token name.\r | |
156 | \r | |
157 | Returns the 8-bit value for the token specified by TokenName.\r | |
158 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
159 | If TokenName is not a feature flag, then the module will not build.\r | |
160 | \r | |
161 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
162 | \r | |
163 | @return An 8-bit binary patchable PCD token value.\r | |
164 | \r | |
165 | **/\r | |
166 | #define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName\r | |
167 | \r | |
168 | /**\r | |
169 | Retrieves a 16-bit binary patchable PCD token value based on a token name.\r | |
170 | \r | |
171 | Returns the 16-bit value for the token specified by TokenName.\r | |
172 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
173 | If TokenName is not a feature flag, then the module will not build.\r | |
174 | \r | |
175 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
176 | \r | |
177 | @return A 16-bit binary patchable PCD token value.\r | |
178 | \r | |
179 | **/\r | |
180 | #define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName\r | |
181 | \r | |
182 | \r | |
183 | /**\r | |
184 | Retrieves a 32-bit binary patchable PCD token value based on a token name.\r | |
185 | \r | |
186 | Returns the 32-bit value for the token specified by TokenName.\r | |
187 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
188 | If TokenName is not a feature flag, then the module will not build.\r | |
189 | \r | |
190 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
191 | \r | |
192 | @return A 32-bit binary patchable PCD token value.\r | |
193 | \r | |
194 | **/\r | |
195 | #define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName\r | |
196 | \r | |
197 | \r | |
198 | /**\r | |
199 | Retrieves a 64-bit binary patchable PCD token value based on a token name.\r | |
200 | \r | |
201 | Returns the 64-bit value for the token specified by TokenName.\r | |
202 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
203 | If TokenName is not a feature flag, then the module will not build.\r | |
204 | \r | |
205 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
206 | \r | |
207 | @return A 64-bit binary patchable PCD token value.\r | |
208 | \r | |
209 | **/\r | |
210 | #define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName\r | |
211 | \r | |
212 | \r | |
213 | /**\r | |
214 | Retrieves a Boolean binary patchable PCD token value based on a token name.\r | |
215 | \r | |
216 | Returns the Boolean value for the token specified by TokenName.\r | |
217 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
218 | If TokenName is not a feature flag, then the module will not build.\r | |
219 | \r | |
220 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
221 | \r | |
222 | @return The Boolean value for the token.\r | |
223 | \r | |
224 | **/\r | |
225 | #define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName\r | |
226 | \r | |
227 | \r | |
228 | /**\r | |
229 | Retrieves a pointer to a binary patchable PCD token buffer based on a token name.\r | |
230 | \r | |
231 | Returns a pointer to the buffer for the token specified by TokenName.\r | |
232 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
233 | If TokenName is not a feature flag, then the module will not build.\r | |
234 | \r | |
235 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
236 | \r | |
237 | @return A pointer to the buffer for the token.\r | |
238 | \r | |
239 | **/\r | |
240 | #define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)\r | |
241 | \r | |
242 | \r | |
243 | /**\r | |
244 | Sets an 8-bit binary patchable PCD token value based on a token name.\r | |
245 | \r | |
246 | Sets the 8-bit value for the token specified by TokenName. Value is returned.\r | |
247 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
248 | If TokenName is not a feature flag, then the module will not build.\r | |
249 | \r | |
250 | @param TokenName The name of the binary patchable PCD token to set the current value for.\r | |
251 | @param Value The 8-bit value to set.\r | |
252 | \r | |
253 | @return Value.\r | |
254 | \r | |
255 | **/\r | |
256 | #define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r | |
257 | \r | |
258 | \r | |
259 | /**\r | |
260 | Sets a 16-bit binary patchable PCD token value based on a token name.\r | |
261 | \r | |
262 | Sets the 16-bit value for the token specified by TokenName. Value is returned.\r | |
263 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
264 | If TokenName is not a feature flag, then the module will not build.\r | |
265 | \r | |
266 | @param TokenName The name of the binary patchable PCD token to set the current value for.\r | |
267 | @param Value The 16-bit value to set.\r | |
268 | \r | |
269 | @return Value.\r | |
270 | \r | |
271 | **/\r | |
272 | #define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r | |
273 | \r | |
274 | \r | |
275 | /**\r | |
276 | Sets a 32-bit binary patchable PCD token value based on a token name.\r | |
277 | \r | |
278 | Sets the 32-bit value for the token specified by TokenName. Value is returned.\r | |
279 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
280 | If TokenName is not a feature flag, then the module will not build.\r | |
281 | \r | |
282 | @param TokenName The name of the binary patchable PCD token to set the current value for.\r | |
283 | @param Value The 32-bit value to set.\r | |
284 | \r | |
285 | @return Value.\r | |
286 | \r | |
287 | **/\r | |
288 | #define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r | |
289 | \r | |
290 | \r | |
291 | /**\r | |
292 | Sets a 64-bit binary patchable PCD token value based on a token name.\r | |
293 | \r | |
294 | Sets the 64-bit value for the token specified by TokenName. Value is returned.\r | |
295 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
296 | If TokenName is not a feature flag, then the module will not build.\r | |
297 | \r | |
298 | @param TokenName The name of the binary patchable PCD token to set the current value for.\r | |
299 | @param Value The 64-bit value to set.\r | |
300 | \r | |
301 | @return Value.\r | |
302 | \r | |
303 | **/\r | |
304 | #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r | |
305 | \r | |
306 | \r | |
307 | /**\r | |
308 | Sets a Boolean binary patchable PCD token value based on a token name.\r | |
309 | \r | |
310 | Sets the Boolean value for the token specified by TokenName. Value is returned.\r | |
311 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
312 | If TokenName is not a feature flag, then the module will not build.\r | |
313 | \r | |
314 | @param TokenName The name of the binary patchable PCD token to set the current value for.\r | |
315 | @param Value The boolean value to set.\r | |
316 | \r | |
317 | @return Value.\r | |
318 | \r | |
319 | **/\r | |
320 | #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r | |
321 | \r | |
322 | \r | |
323 | /**\r | |
324 | Sets a pointer to a binary patchable PCD token buffer based on a token name.\r | |
325 | \r | |
326 | Sets the buffer for the token specified by TokenName. Buffer is returned. \r | |
327 | If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer\r | |
328 | to the maximum size supported by TokenName and return NULL to indicate that the set operation \r | |
329 | was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be \r | |
330 | set to the maximum size supported by TokenName and NULL must be returned.\r | |
331 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
332 | If TokenName is not a feature flag, then the module will not build.\r | |
333 | \r | |
334 | If SizeOfBuffer is NULL, then ASSERT().\r | |
335 | If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r | |
336 | \r | |
337 | @param TokenName The name of the binary patchable PCD token to set the current value for.\r | |
338 | @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r | |
339 | @param Buffer Pointer to the value to set.\r | |
340 | \r | |
341 | @return Value.\r | |
342 | \r | |
343 | **/\r | |
344 | #define PatchPcdSetPtr(TokenName, Size, Buffer) \\r | |
345 | LibPatchPcdSetPtr ( \\r | |
346 | _gPcd_BinaryPatch_##TokenName, \\r | |
347 | (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \\r | |
348 | (Size), \\r | |
349 | (Buffer) \\r | |
350 | )\r | |
351 | \r | |
352 | /**\r | |
353 | Retrieves an 8-bit PCD token value based on a token name.\r | |
354 | \r | |
355 | Returns the 8-bit value for the token specified by TokenName.\r | |
356 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
357 | \r | |
358 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
359 | \r | |
360 | @return 8-bit value for the token specified by TokenName.\r | |
361 | \r | |
362 | **/\r | |
363 | #define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName\r | |
364 | \r | |
365 | \r | |
366 | /**\r | |
367 | Retrieves a 16-bit PCD token value based on a token name.\r | |
368 | \r | |
369 | Returns the 16-bit value for the token specified by TokenName.\r | |
370 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
371 | \r | |
372 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
373 | \r | |
374 | @return 16-bit value for the token specified by TokenName.\r | |
375 | \r | |
376 | **/\r | |
377 | #define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName\r | |
378 | \r | |
379 | \r | |
380 | /**\r | |
381 | Retrieves a 32-bit PCD token value based on a token name.\r | |
382 | \r | |
383 | Returns the 32-bit value for the token specified by TokenName.\r | |
384 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
385 | \r | |
386 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
387 | \r | |
388 | @return 32-bit value for the token specified by TokenName.\r | |
389 | \r | |
390 | **/\r | |
391 | #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName\r | |
392 | \r | |
393 | \r | |
394 | /**\r | |
395 | Retrieves a 64-bit PCD token value based on a token name.\r | |
396 | \r | |
397 | Returns the 64-bit value for the token specified by TokenName.\r | |
398 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
399 | \r | |
400 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
401 | \r | |
402 | @return 64-bit value for the token specified by TokenName.\r | |
403 | \r | |
404 | **/\r | |
405 | #define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName\r | |
406 | \r | |
407 | \r | |
408 | /**\r | |
409 | Retrieves a pointer to a PCD token buffer based on a token name.\r | |
410 | \r | |
411 | Returns a pointer to the buffer for the token specified by TokenName.\r | |
412 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
413 | \r | |
414 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
415 | \r | |
416 | @return A pointer to the buffer.\r | |
417 | \r | |
418 | **/\r | |
419 | #define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName\r | |
420 | \r | |
421 | \r | |
422 | /**\r | |
423 | Retrieves a Boolean PCD token value based on a token name.\r | |
424 | \r | |
425 | Returns the Boolean value for the token specified by TokenName.\r | |
426 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
427 | \r | |
428 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
429 | \r | |
430 | @return A Boolean PCD token value.\r | |
431 | \r | |
432 | **/\r | |
433 | #define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r | |
434 | \r | |
435 | \r | |
436 | /**\r | |
437 | Sets an 8-bit PCD token value based on a token name.\r | |
438 | \r | |
439 | Sets the 8-bit value for the token specified by TokenName. Value is returned.\r | |
440 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
441 | \r | |
442 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
443 | @param Value The 8-bit value to set.\r | |
444 | \r | |
445 | @return Value.\r | |
446 | \r | |
447 | **/\r | |
448 | #define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))\r | |
449 | \r | |
450 | \r | |
451 | /**\r | |
452 | Sets a 16-bit PCD token value based on a token name.\r | |
453 | \r | |
454 | Sets the 16-bit value for the token specified by TokenName. Value is returned.\r | |
455 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
456 | \r | |
457 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
458 | @param Value The 16-bit value to set.\r | |
459 | \r | |
460 | @return Value.\r | |
461 | \r | |
462 | **/\r | |
463 | #define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))\r | |
464 | \r | |
465 | \r | |
466 | /**\r | |
467 | Sets a 32-bit PCD token value based on a token name.\r | |
468 | \r | |
469 | Sets the 32-bit value for the token specified by TokenName. Value is returned.\r | |
470 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
471 | \r | |
472 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
473 | @param Value The 32-bit value to set.\r | |
474 | \r | |
475 | @return Value.\r | |
476 | \r | |
477 | **/\r | |
478 | #define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))\r | |
479 | \r | |
480 | \r | |
481 | /**\r | |
482 | Sets a 64-bit PCD token value based on a token name.\r | |
483 | \r | |
484 | Sets the 64-bit value for the token specified by TokenName. Value is returned.\r | |
485 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
486 | \r | |
487 | @param TokenName The name of the PCD token to retrieve a current value for.\r | |
488 | @param Value The 64-bit value to set.\r | |
489 | \r | |
490 | @return Value.\r | |
491 | \r | |
492 | **/\r | |
493 | #define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))\r | |
494 | \r | |
495 | \r | |
496 | /**\r | |
497 | Sets a pointer to a PCD token buffer based on a token name.\r | |
498 | \r | |
499 | Sets the buffer for the token specified by TokenName. Buffer is returned. \r | |
500 | If SizeOfBuffer is greater than the maximum size supported by TokenName, \r | |
501 | then set SizeOfBuffer to the maximum size supported by TokenName and return NULL \r | |
502 | to indicate that the set operation was not actually performed. If SizeOfBuffer \r | |
503 | is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported \r | |
504 | by TokenName and NULL must be returned.\r | |
505 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
506 | \r | |
507 | If SizeOfBuffer is NULL, then ASSERT().\r | |
508 | If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r | |
509 | \r | |
510 | @param TokenName The name of the PCD token to set the current value for.\r | |
511 | @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r | |
512 | @param Buffer A pointer to the buffer to set.\r | |
513 | \r | |
514 | @return Buffer.\r | |
515 | \r | |
516 | **/\r | |
517 | #define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \\r | |
518 | _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))\r | |
519 | \r | |
520 | /**\r | |
521 | Sets a Boolean PCD token value based on a token name.\r | |
522 | \r | |
523 | Sets the Boolean value for the token specified by TokenName. Value is returned. \r | |
524 | If TokenName is not a valid token in the token space, then the module will not build.\r | |
525 | \r | |
526 | @param TokenName The name of the PCD token to set the current value for.\r | |
527 | @param Buffer The Boolean value to set.\r | |
528 | \r | |
529 | @return Value. \r | |
530 | \r | |
531 | **/\r | |
532 | #define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))\r | |
533 | \r | |
534 | \r | |
535 | /**\r | |
536 | Retrieves an 8-bit PCD token value based on a GUID and a token name.\r | |
537 | \r | |
538 | Returns the 8-bit value for the token specified by Guid and TokenName.\r | |
539 | If TokenName is not a valid token in the token space specified by Guid, \r | |
540 | then the module will not build.\r | |
541 | \r | |
542 | If Guid is NULL, then ASSERT().\r | |
543 | \r | |
544 | @param Guid Pointer to a 128-bit unique value that designates \r | |
545 | which namespace to retrieve a value from.\r | |
546 | @param TokenName The name of the PCD token to retrieve a current value for. \r | |
547 | \r | |
548 | @return An 8-bit PCD token value.\r | |
549 | \r | |
550 | **/\r | |
551 | #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), _PCD_TOKEN_##TokenName)\r | |
552 | \r | |
553 | \r | |
554 | /**\r | |
555 | Retrieves a 16-bit PCD token value based on a GUID and a token name.\r | |
556 | \r | |
557 | Returns the 16-bit value for the token specified by Guid and TokenName.\r | |
558 | If TokenName is not a valid token in the token space specified by Guid, \r | |
559 | then the module will not build.\r | |
560 | \r | |
561 | If Guid is NULL, then ASSERT().\r | |
562 | \r | |
563 | @param Guid Pointer to a 128-bit unique value that designates \r | |
564 | which namespace to retrieve a value from.\r | |
565 | @param TokenName The name of the PCD token to retrieve a current value for. \r | |
566 | \r | |
567 | @return A 16-bit PCD token value.\r | |
568 | \r | |
569 | **/\r | |
570 | #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), _PCD_TOKEN_##TokenName)\r | |
571 | \r | |
572 | \r | |
573 | /**\r | |
574 | Retrieves a 32-bit PCD token value based on a GUID and a token name.\r | |
575 | \r | |
576 | Returns the 32-bit value for the token specified by Guid and TokenName.\r | |
577 | If TokenName is not a valid token in the token space specified by Guid, \r | |
578 | then the module will not build.\r | |
579 | \r | |
580 | If Guid is NULL, then ASSERT().\r | |
581 | \r | |
582 | @param Guid Pointer to a 128-bit unique value that designates \r | |
583 | which namespace to retrieve a value from.\r | |
584 | @param TokenName The name of the PCD token to retrieve a current value for. \r | |
585 | \r | |
586 | @return A 32-bit PCD token value.\r | |
587 | \r | |
588 | **/\r | |
589 | #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), _PCD_TOKEN_##TokenName)\r | |
590 | \r | |
591 | \r | |
592 | /**\r | |
593 | Retrieves a 64-bit PCD token value based on a GUID and a token name.\r | |
594 | \r | |
595 | Returns the 64-bit value for the token specified by Guid and TokenName.\r | |
596 | If TokenName is not a valid token in the token space specified by Guid, \r | |
597 | then the module will not build.\r | |
598 | \r | |
599 | If Guid is NULL, then ASSERT().\r | |
600 | \r | |
601 | @param Guid Pointer to a 128-bit unique value that designates \r | |
602 | which namespace to retrieve a value from.\r | |
603 | @param TokenName The name of the PCD token to retrieve a current value for. \r | |
604 | \r | |
605 | @return A 64-bit PCD token value.\r | |
606 | \r | |
607 | **/\r | |
608 | #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), _PCD_TOKEN_##TokenName)\r | |
609 | \r | |
610 | \r | |
611 | /**\r | |
612 | Retrieves a pointer to a PCD token buffer based on a GUID and a token name.\r | |
613 | \r | |
614 | Returns a pointer to the buffer for the token specified by Guid and TokenName.\r | |
615 | If TokenName is not a valid token in the token space specified by Guid, \r | |
616 | then the module will not build.\r | |
617 | \r | |
618 | If Guid is NULL, then ASSERT().\r | |
619 | \r | |
620 | @param Guid Pointer to a 128-bit unique value that designates \r | |
621 | which namespace to retrieve a value from.\r | |
622 | @param TokenName The name of the PCD token to retrieve a current value for. \r | |
623 | \r | |
624 | @return A pointer to a PCD token buffer.\r | |
625 | \r | |
626 | **/\r | |
627 | #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), _PCD_TOKEN_##TokenName)\r | |
628 | \r | |
629 | \r | |
630 | /**\r | |
631 | Retrieves a Boolean PCD token value based on a GUID and a token name.\r | |
632 | \r | |
633 | Returns the Boolean value for the token specified by Guid and TokenName.\r | |
634 | If TokenName is not a valid token in the token space specified by Guid, \r | |
635 | then the module will not build.\r | |
636 | \r | |
637 | If Guid is NULL, then ASSERT().\r | |
638 | \r | |
639 | @param Guid Pointer to a 128-bit unique value that designates \r | |
640 | which namespace to retrieve a value from.\r | |
641 | @param TokenName The name of the PCD token to retrieve a current value for. \r | |
642 | \r | |
643 | @return A Boolean PCD token value.\r | |
644 | \r | |
645 | **/\r | |
646 | #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), _PCD_TOKEN_##TokenName)\r | |
647 | \r | |
648 | \r | |
649 | /**\r | |
650 | Sets an 8-bit PCD token value based on a GUID and a token name.\r | |
651 | \r | |
652 | Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.\r | |
653 | If TokenName is not a valid token in the token space specified by Guid, \r | |
654 | then the module will not build.\r | |
655 | \r | |
656 | If Guid is NULL, then ASSERT().\r | |
657 | \r | |
658 | @param Guid Pointer to a 128-bit unique value that designates \r | |
659 | which namespace to retrieve a value from.\r | |
660 | @param TokenName The name of the PCD token to set the current value for.\r | |
661 | @param Value The 8-bit value to set. \r | |
662 | \r | |
663 | @return Value. \r | |
664 | \r | |
665 | **/\r | |
666 | #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r | |
667 | \r | |
668 | \r | |
669 | /**\r | |
670 | Sets a 16-bit PCD token value based on a GUID and a token name.\r | |
671 | \r | |
672 | Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.\r | |
673 | If TokenName is not a valid token in the token space specified by Guid, \r | |
674 | then the module will not build.\r | |
675 | \r | |
676 | If Guid is NULL, then ASSERT().\r | |
677 | \r | |
678 | @param Guid Pointer to a 128-bit unique value that designates \r | |
679 | which namespace to retrieve a value from.\r | |
680 | @param TokenName The name of the PCD token to set the current value for.\r | |
681 | @param Value The 16-bit value to set. \r | |
682 | \r | |
683 | @return Value. \r | |
684 | \r | |
685 | **/\r | |
686 | #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r | |
687 | \r | |
688 | \r | |
689 | /**\r | |
690 | Sets a 32-bit PCD token value based on a GUID and a token name.\r | |
691 | \r | |
692 | Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.\r | |
693 | If TokenName is not a valid token in the token space specified by Guid, \r | |
694 | then the module will not build.\r | |
695 | \r | |
696 | If Guid is NULL, then ASSERT().\r | |
697 | \r | |
698 | @param Guid Pointer to a 128-bit unique value that designates \r | |
699 | which namespace to retrieve a value from.\r | |
700 | @param TokenName The name of the PCD token to set the current value for.\r | |
701 | @param Value The 32-bit value to set. \r | |
702 | \r | |
703 | @return Value. \r | |
704 | \r | |
705 | **/\r | |
706 | #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r | |
707 | \r | |
708 | \r | |
709 | /**\r | |
710 | Sets a 64-bit PCD token value based on a GUID and a token name.\r | |
711 | \r | |
712 | Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.\r | |
713 | If TokenName is not a valid token in the token space specified by Guid, \r | |
714 | then the module will not build.\r | |
715 | \r | |
716 | If Guid is NULL, then ASSERT().\r | |
717 | \r | |
718 | @param Guid Pointer to a 128-bit unique value that designates \r | |
719 | which namespace to retrieve a value from.\r | |
720 | @param TokenName The name of the PCD token to set the current value for.\r | |
721 | @param Value The 64-bit value to set. \r | |
722 | \r | |
723 | @return Value. \r | |
724 | \r | |
725 | **/\r | |
726 | #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), _PCD_TOKEN_##TokenName, (Value))\r | |
727 | \r | |
728 | \r | |
729 | /**\r | |
730 | Sets a pointer to a PCD token buffer based on a GUID and a token name.\r | |
731 | \r | |
732 | Sets the buffer for the token specified by Guid and TokenName. Buffer is returned. \r | |
733 | If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName, \r | |
734 | then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return \r | |
735 | NULL to indicate that the set operation was not actually performed. If SizeOfBuffer \r | |
736 | is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by\r | |
737 | Guid and TokenName and NULL must be returned.\r | |
738 | If TokenName is not a valid token in the token space specified by Guid, \r | |
739 | then the module will not build.\r | |
740 | \r | |
741 | If Guid is NULL, then ASSERT().\r | |
742 | If SizeOfBuffer is NULL, then ASSERT().\r | |
743 | If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r | |
744 | \r | |
745 | @param Guid Pointer to a 128-bit unique value that designates \r | |
746 | which namespace to retrieve a value from.\r | |
747 | @param TokenName The name of the PCD token to set the current value for.\r | |
748 | @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. \r | |
749 | @param Value Pointer to the buffer to set.\r | |
750 | \r | |
751 | @return Buffer. \r | |
752 | \r | |
753 | **/\r | |
754 | #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \\r | |
755 | LibPcdSetExPtr ((Guid), _PCD_TOKEN_##TokenName, (SizeOfBuffer), (Buffer))\r | |
756 | \r | |
757 | \r | |
758 | /**\r | |
759 | Sets a Boolean PCD token value based on a GUID and a token name.\r | |
760 | \r | |
761 | Sets the Boolean value for the token specified by Guid and TokenName. Value is returned. \r | |
762 | If TokenName is not a valid token in the token space specified by Guid, \r | |
763 | then the module will not build.\r | |
764 | \r | |
765 | If Guid is NULL, then ASSERT().\r | |
766 | \r | |
767 | @param Guid Pointer to a 128-bit unique value that designates \r | |
768 | which namespace to retrieve a value from.\r | |
769 | @param TokenName The name of the PCD token to set the current value for. \r | |
770 | @param Value The Boolean value to set.\r | |
771 | \r | |
772 | @return Value. \r | |
773 | \r | |
774 | **/ \r | |
775 | #define PcdSetExBool(Guid, TokenName, Value) \\r | |
776 | LibPcdSetExBool((Guid), _PCD_TOKEN_##TokenName, (Value))\r | |
777 | \r | |
778 | \r | |
779 | /**\r | |
780 | This function provides a means by which SKU support can be established in the PCD infrastructure.\r | |
781 | \r | |
782 | Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r | |
783 | \r | |
784 | @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r | |
785 | set values associated with a PCD token.\r | |
786 | \r | |
787 | If SkuId >= 0x100, then ASSERT(). \r | |
788 | \r | |
789 | @return Return the SKU ID that just be set.\r | |
790 | \r | |
791 | **/\r | |
792 | UINTN\r | |
793 | EFIAPI\r | |
794 | LibPcdSetSku (\r | |
795 | IN UINTN SkuId\r | |
796 | );\r | |
797 | \r | |
798 | \r | |
799 | /**\r | |
800 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
801 | \r | |
802 | Returns the 8-bit value for the token specified by TokenNumber. \r | |
803 | \r | |
804 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
805 | \r | |
806 | @return Returns the 8-bit value for the token specified by TokenNumber. \r | |
807 | \r | |
808 | **/\r | |
809 | UINT8\r | |
810 | EFIAPI\r | |
811 | LibPcdGet8 (\r | |
812 | IN UINTN TokenNumber\r | |
813 | );\r | |
814 | \r | |
815 | \r | |
816 | /**\r | |
817 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
818 | \r | |
819 | Returns the 16-bit value for the token specified by TokenNumber. \r | |
820 | \r | |
821 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
822 | \r | |
823 | @return Returns the 16-bit value for the token specified by TokenNumber. \r | |
824 | \r | |
825 | **/\r | |
826 | UINT16\r | |
827 | EFIAPI\r | |
828 | LibPcdGet16 (\r | |
829 | IN UINTN TokenNumber\r | |
830 | );\r | |
831 | \r | |
832 | \r | |
833 | /**\r | |
834 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
835 | \r | |
836 | Returns the 32-bit value for the token specified by TokenNumber. \r | |
837 | \r | |
838 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
839 | \r | |
840 | @return Returns the 32-bit value for the token specified by TokenNumber.\r | |
841 | \r | |
842 | **/\r | |
843 | UINT32\r | |
844 | EFIAPI\r | |
845 | LibPcdGet32 (\r | |
846 | IN UINTN TokenNumber\r | |
847 | );\r | |
848 | \r | |
849 | \r | |
850 | /**\r | |
851 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
852 | \r | |
853 | Returns the 64-bit value for the token specified by TokenNumber.\r | |
854 | \r | |
855 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
856 | \r | |
857 | @return Returns the 64-bit value for the token specified by TokenNumber.\r | |
858 | \r | |
859 | **/\r | |
860 | UINT64\r | |
861 | EFIAPI\r | |
862 | LibPcdGet64 (\r | |
863 | IN UINTN TokenNumber\r | |
864 | );\r | |
865 | \r | |
866 | \r | |
867 | /**\r | |
868 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
869 | \r | |
870 | Returns the pointer to the buffer of the token specified by TokenNumber.\r | |
871 | \r | |
872 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
873 | \r | |
874 | @return Returns the pointer to the token specified by TokenNumber.\r | |
875 | \r | |
876 | **/\r | |
877 | VOID *\r | |
878 | EFIAPI\r | |
879 | LibPcdGetPtr (\r | |
880 | IN UINTN TokenNumber\r | |
881 | );\r | |
882 | \r | |
883 | \r | |
884 | /**\r | |
885 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
886 | \r | |
887 | Returns the Boolean value of the token specified by TokenNumber. \r | |
888 | \r | |
889 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
890 | \r | |
891 | @return Returns the Boolean value of the token specified by TokenNumber. \r | |
892 | \r | |
893 | **/\r | |
894 | BOOLEAN \r | |
895 | EFIAPI\r | |
896 | LibPcdGetBool (\r | |
897 | IN UINTN TokenNumber\r | |
898 | );\r | |
899 | \r | |
900 | \r | |
901 | /**\r | |
902 | This function provides a means by which to retrieve the size of a given PCD token.\r | |
903 | \r | |
904 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
905 | \r | |
906 | @return Returns the size of the token specified by TokenNumber. \r | |
907 | \r | |
908 | **/\r | |
909 | UINTN\r | |
910 | EFIAPI\r | |
911 | LibPcdGetSize (\r | |
912 | IN UINTN TokenNumber\r | |
913 | );\r | |
914 | \r | |
915 | \r | |
916 | /**\r | |
917 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
918 | \r | |
919 | Returns the 8-bit value for the token specified by TokenNumber and Guid.\r | |
920 | \r | |
921 | If Guid is NULL, then ASSERT(). \r | |
922 | \r | |
923 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
924 | which namespace to retrieve a value from.\r | |
925 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
926 | \r | |
927 | @return Return the UINT8.\r | |
928 | \r | |
929 | **/\r | |
930 | UINT8\r | |
931 | EFIAPI\r | |
932 | LibPcdGetEx8 (\r | |
933 | IN CONST GUID *Guid,\r | |
934 | IN UINTN TokenNumber\r | |
935 | );\r | |
936 | \r | |
937 | \r | |
938 | /**\r | |
939 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
940 | \r | |
941 | Returns the 16-bit value for the token specified by TokenNumber and Guid.\r | |
942 | \r | |
943 | If Guid is NULL, then ASSERT(). \r | |
944 | \r | |
945 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
946 | which namespace to retrieve a value from.\r | |
947 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
948 | \r | |
949 | @return Return the UINT16.\r | |
950 | \r | |
951 | **/\r | |
952 | UINT16\r | |
953 | EFIAPI\r | |
954 | LibPcdGetEx16 (\r | |
955 | IN CONST GUID *Guid,\r | |
956 | IN UINTN TokenNumber\r | |
957 | );\r | |
958 | \r | |
959 | \r | |
960 | /**\r | |
961 | Returns the 32-bit value for the token specified by TokenNumber and Guid.\r | |
962 | If Guid is NULL, then ASSERT(). \r | |
963 | \r | |
964 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
965 | which namespace to retrieve a value from.\r | |
966 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
967 | \r | |
968 | @return Return the UINT32.\r | |
969 | \r | |
970 | **/\r | |
971 | UINT32\r | |
972 | EFIAPI\r | |
973 | LibPcdGetEx32 (\r | |
974 | IN CONST GUID *Guid,\r | |
975 | IN UINTN TokenNumber\r | |
976 | );\r | |
977 | \r | |
978 | \r | |
979 | /**\r | |
980 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
981 | \r | |
982 | Returns the 64-bit value for the token specified by TokenNumber and Guid.\r | |
983 | \r | |
984 | If Guid is NULL, then ASSERT(). \r | |
985 | \r | |
986 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
987 | which namespace to retrieve a value from.\r | |
988 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
989 | \r | |
990 | @return Return the UINT64.\r | |
991 | \r | |
992 | **/\r | |
993 | UINT64\r | |
994 | EFIAPI\r | |
995 | LibPcdGetEx64 (\r | |
996 | IN CONST GUID *Guid,\r | |
997 | IN UINTN TokenNumber\r | |
998 | );\r | |
999 | \r | |
1000 | \r | |
1001 | /**\r | |
1002 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
1003 | \r | |
1004 | Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r | |
1005 | \r | |
1006 | If Guid is NULL, then ASSERT(). \r | |
1007 | \r | |
1008 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
1009 | which namespace to retrieve a value from.\r | |
1010 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
1011 | \r | |
1012 | @return Return the VOID* pointer.\r | |
1013 | \r | |
1014 | **/\r | |
1015 | VOID *\r | |
1016 | EFIAPI\r | |
1017 | LibPcdGetExPtr (\r | |
1018 | IN CONST GUID *Guid,\r | |
1019 | IN UINTN TokenNumber\r | |
1020 | );\r | |
1021 | \r | |
1022 | \r | |
1023 | /**\r | |
1024 | This function provides a means by which to retrieve a value for a given PCD token.\r | |
1025 | \r | |
1026 | Returns the Boolean value of the token specified by TokenNumber and Guid. \r | |
1027 | \r | |
1028 | If Guid is NULL, then ASSERT(). \r | |
1029 | \r | |
1030 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
1031 | which namespace to retrieve a value from.\r | |
1032 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
1033 | \r | |
1034 | @return Return the BOOLEAN.\r | |
1035 | \r | |
1036 | **/\r | |
1037 | BOOLEAN\r | |
1038 | EFIAPI\r | |
1039 | LibPcdGetExBool (\r | |
1040 | IN CONST GUID *Guid,\r | |
1041 | IN UINTN TokenNumber\r | |
1042 | );\r | |
1043 | \r | |
1044 | \r | |
1045 | /**\r | |
1046 | This function provides a means by which to retrieve the size of a given PCD token.\r | |
1047 | \r | |
1048 | Returns the size of the token specified by TokenNumber and Guid. \r | |
1049 | \r | |
1050 | If Guid is NULL, then ASSERT(). \r | |
1051 | \r | |
1052 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
1053 | which namespace to retrieve a value from.\r | |
1054 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
1055 | \r | |
1056 | @return Return the size.\r | |
1057 | \r | |
1058 | **/\r | |
1059 | UINTN\r | |
1060 | EFIAPI\r | |
1061 | LibPcdGetExSize (\r | |
1062 | IN CONST GUID *Guid,\r | |
1063 | IN UINTN TokenNumber\r | |
1064 | );\r | |
1065 | \r | |
1066 | \r | |
1067 | /**\r | |
1068 | This function provides a means by which to set a value for a given PCD token.\r | |
1069 | \r | |
1070 | Sets the 8-bit value for the token specified by TokenNumber \r | |
1071 | to the value specified by Value. Value is returned.\r | |
1072 | \r | |
1073 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1074 | @param[in] Value The 8-bit value to set.\r | |
1075 | \r | |
1076 | @return Return the value been set.\r | |
1077 | \r | |
1078 | **/\r | |
1079 | UINT8\r | |
1080 | EFIAPI\r | |
1081 | LibPcdSet8 (\r | |
1082 | IN UINTN TokenNumber,\r | |
1083 | IN UINT8 Value\r | |
1084 | );\r | |
1085 | \r | |
1086 | \r | |
1087 | /**\r | |
1088 | This function provides a means by which to set a value for a given PCD token.\r | |
1089 | \r | |
1090 | Sets the 16-bit value for the token specified by TokenNumber \r | |
1091 | to the value specified by Value. Value is returned.\r | |
1092 | \r | |
1093 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1094 | @param[in] Value The 16-bit value to set.\r | |
1095 | \r | |
1096 | @return Return the value been set.\r | |
1097 | \r | |
1098 | **/\r | |
1099 | UINT16\r | |
1100 | EFIAPI\r | |
1101 | LibPcdSet16 (\r | |
1102 | IN UINTN TokenNumber,\r | |
1103 | IN UINT16 Value\r | |
1104 | );\r | |
1105 | \r | |
1106 | \r | |
1107 | /**\r | |
1108 | This function provides a means by which to set a value for a given PCD token.\r | |
1109 | \r | |
1110 | Sets the 32-bit value for the token specified by TokenNumber \r | |
1111 | to the value specified by Value. Value is returned.\r | |
1112 | \r | |
1113 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1114 | @param[in] Value The 32-bit value to set.\r | |
1115 | \r | |
1116 | @return Return the value been set.\r | |
1117 | \r | |
1118 | **/\r | |
1119 | UINT32\r | |
1120 | EFIAPI\r | |
1121 | LibPcdSet32 (\r | |
1122 | IN UINTN TokenNumber,\r | |
1123 | IN UINT32 Value\r | |
1124 | );\r | |
1125 | \r | |
1126 | \r | |
1127 | /**\r | |
1128 | This function provides a means by which to set a value for a given PCD token.\r | |
1129 | \r | |
1130 | Sets the 64-bit value for the token specified by TokenNumber \r | |
1131 | to the value specified by Value. Value is returned.\r | |
1132 | \r | |
1133 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1134 | @param[in] Value The 64-bit value to set.\r | |
1135 | \r | |
1136 | @return Return the value been set.\r | |
1137 | \r | |
1138 | **/\r | |
1139 | UINT64\r | |
1140 | EFIAPI\r | |
1141 | LibPcdSet64 (\r | |
1142 | IN UINTN TokenNumber,\r | |
1143 | IN UINT64 Value\r | |
1144 | );\r | |
1145 | \r | |
1146 | \r | |
1147 | /**\r | |
1148 | This function provides a means by which to set a value for a given PCD token.\r | |
1149 | \r | |
1150 | Sets a buffer for the token specified by TokenNumber to the value \r | |
1151 | specified by Buffer and SizeOfBuffer. Buffer is returned. \r | |
1152 | If SizeOfBuffer is greater than the maximum size support by TokenNumber, \r | |
1153 | then set SizeOfBuffer to the maximum size supported by TokenNumber and \r | |
1154 | return NULL to indicate that the set operation was not actually performed. \r | |
1155 | \r | |
1156 | If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the \r | |
1157 | maximum size supported by TokenName and NULL must be returned.\r | |
1158 | \r | |
1159 | If SizeOfBuffer is NULL, then ASSERT().\r | |
1160 | If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r | |
1161 | \r | |
1162 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1163 | @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r | |
1164 | @param[in] Buffer A pointer to the buffer to set.\r | |
1165 | \r | |
1166 | @return Return the pointer for the buffer been set.\r | |
1167 | \r | |
1168 | **/\r | |
1169 | VOID *\r | |
1170 | EFIAPI\r | |
1171 | LibPcdSetPtr (\r | |
1172 | IN UINTN TokenNumber,\r | |
1173 | IN OUT UINTN *SizeOfBuffer,\r | |
1174 | IN CONST VOID *Buffer\r | |
1175 | );\r | |
1176 | \r | |
1177 | \r | |
1178 | /**\r | |
1179 | This function provides a means by which to set a value for a given PCD token.\r | |
1180 | \r | |
1181 | Sets the Boolean value for the token specified by TokenNumber \r | |
1182 | to the value specified by Value. Value is returned.\r | |
1183 | \r | |
1184 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1185 | @param[in] Value The boolean value to set.\r | |
1186 | \r | |
1187 | @return Return the value been set.\r | |
1188 | \r | |
1189 | **/\r | |
1190 | BOOLEAN\r | |
1191 | EFIAPI\r | |
1192 | LibPcdSetBool (\r | |
1193 | IN UINTN TokenNumber,\r | |
1194 | IN BOOLEAN Value\r | |
1195 | );\r | |
1196 | \r | |
1197 | \r | |
1198 | /**\r | |
1199 | This function provides a means by which to set a value for a given PCD token.\r | |
1200 | \r | |
1201 | Sets the 8-bit value for the token specified by TokenNumber and \r | |
1202 | Guid to the value specified by Value. Value is returned.\r | |
1203 | \r | |
1204 | If Guid is NULL, then ASSERT().\r | |
1205 | \r | |
1206 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
1207 | designates which namespace to set a value from.\r | |
1208 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1209 | @param[in] Value The 8-bit value to set.\r | |
1210 | \r | |
1211 | @return Return the value been set.\r | |
1212 | \r | |
1213 | **/\r | |
1214 | UINT8\r | |
1215 | EFIAPI\r | |
1216 | LibPcdSetEx8 (\r | |
1217 | IN CONST GUID *Guid,\r | |
1218 | IN UINTN TokenNumber,\r | |
1219 | IN UINT8 Value\r | |
1220 | );\r | |
1221 | \r | |
1222 | \r | |
1223 | /**\r | |
1224 | This function provides a means by which to set a value for a given PCD token.\r | |
1225 | \r | |
1226 | Sets the 16-bit value for the token specified by TokenNumber and \r | |
1227 | Guid to the value specified by Value. Value is returned.\r | |
1228 | \r | |
1229 | If Guid is NULL, then ASSERT().\r | |
1230 | \r | |
1231 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
1232 | designates which namespace to set a value from.\r | |
1233 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1234 | @param[in] Value The 16-bit value to set.\r | |
1235 | \r | |
1236 | @return Return the value been set.\r | |
1237 | \r | |
1238 | **/\r | |
1239 | UINT16\r | |
1240 | EFIAPI\r | |
1241 | LibPcdSetEx16 (\r | |
1242 | IN CONST GUID *Guid,\r | |
1243 | IN UINTN TokenNumber,\r | |
1244 | IN UINT16 Value\r | |
1245 | );\r | |
1246 | \r | |
1247 | \r | |
1248 | /**\r | |
1249 | This function provides a means by which to set a value for a given PCD token.\r | |
1250 | \r | |
1251 | Sets the 32-bit value for the token specified by TokenNumber and \r | |
1252 | Guid to the value specified by Value. Value is returned.\r | |
1253 | \r | |
1254 | If Guid is NULL, then ASSERT().\r | |
1255 | \r | |
1256 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
1257 | designates which namespace to set a value from.\r | |
1258 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1259 | @param[in] Value The 32-bit value to set.\r | |
1260 | \r | |
1261 | @return Return the value been set.\r | |
1262 | \r | |
1263 | **/\r | |
1264 | UINT32\r | |
1265 | EFIAPI\r | |
1266 | LibPcdSetEx32 (\r | |
1267 | IN CONST GUID *Guid,\r | |
1268 | IN UINTN TokenNumber,\r | |
1269 | IN UINT32 Value\r | |
1270 | );\r | |
1271 | \r | |
1272 | \r | |
1273 | /**\r | |
1274 | This function provides a means by which to set a value for a given PCD token.\r | |
1275 | \r | |
1276 | Sets the 64-bit value for the token specified by TokenNumber and \r | |
1277 | Guid to the value specified by Value. Value is returned.\r | |
1278 | If Guid is NULL, then ASSERT().\r | |
1279 | \r | |
1280 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
1281 | designates which namespace to set a value from.\r | |
1282 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1283 | @param[in] Value The 64-bit value to set.\r | |
1284 | \r | |
1285 | @return Return the value been set.\r | |
1286 | \r | |
1287 | **/\r | |
1288 | UINT64\r | |
1289 | EFIAPI\r | |
1290 | LibPcdSetEx64 (\r | |
1291 | IN CONST GUID *Guid,\r | |
1292 | IN UINTN TokenNumber,\r | |
1293 | IN UINT64 Value\r | |
1294 | );\r | |
1295 | \r | |
1296 | \r | |
1297 | /**\r | |
1298 | This function provides a means by which to set a value for a given PCD token.\r | |
1299 | \r | |
1300 | Sets a buffer for the token specified by TokenNumber to the value specified by \r | |
1301 | Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r | |
1302 | the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size \r | |
1303 | supported by TokenNumber and return NULL to indicate that the set operation \r | |
1304 | was not actually performed. \r | |
1305 | \r | |
1306 | If Guid is NULL, then ASSERT().\r | |
1307 | If SizeOfBuffer is NULL, then ASSERT().\r | |
1308 | If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r | |
1309 | \r | |
1310 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
1311 | designates which namespace to set a value from.\r | |
1312 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1313 | @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r | |
1314 | @param[in] Buffer A pointer to the buffer to set.\r | |
1315 | \r | |
1316 | @return Return the pinter to the buffer been set.\r | |
1317 | \r | |
1318 | **/\r | |
1319 | VOID *\r | |
1320 | EFIAPI\r | |
1321 | LibPcdSetExPtr (\r | |
1322 | IN CONST GUID *Guid,\r | |
1323 | IN UINTN TokenNumber,\r | |
1324 | IN OUT UINTN *SizeOfBuffer,\r | |
1325 | IN VOID *Buffer\r | |
1326 | );\r | |
1327 | \r | |
1328 | \r | |
1329 | /**\r | |
1330 | This function provides a means by which to set a value for a given PCD token.\r | |
1331 | \r | |
1332 | Sets the Boolean value for the token specified by TokenNumber and \r | |
1333 | Guid to the value specified by Value. Value is returned.\r | |
1334 | \r | |
1335 | If Guid is NULL, then ASSERT().\r | |
1336 | \r | |
1337 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
1338 | designates which namespace to set a value from.\r | |
1339 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
1340 | @param[in] Value The Boolean value to set.\r | |
1341 | \r | |
1342 | @return Return the value been set.\r | |
1343 | \r | |
1344 | **/\r | |
1345 | BOOLEAN\r | |
1346 | EFIAPI\r | |
1347 | LibPcdSetExBool (\r | |
1348 | IN CONST GUID *Guid,\r | |
1349 | IN UINTN TokenNumber,\r | |
1350 | IN BOOLEAN Value\r | |
1351 | );\r | |
1352 | \r | |
1353 | \r | |
1354 | /**\r | |
1355 | When the token specified by TokenNumber and Guid is set, \r | |
1356 | then notification function specified by NotificationFunction is called. \r | |
1357 | If Guid is NULL, then the default token space is used. \r | |
1358 | If NotificationFunction is NULL, then ASSERT().\r | |
1359 | \r | |
1360 | This notification function serves two purposes. Firstly, it notifies the module which \r | |
1361 | did the registration that the value of this PCD token has been set. Secondly, \r | |
1362 | it provides a mechanism for the module which did the registration to intercept \r | |
1363 | the set operation and override the value been set if necessary. After the invocation \r | |
1364 | of the callback function, TokenData will be used by PCD service PEIM or driver to \r | |
1365 | modify the internal data in PCD database. \r | |
1366 | \r | |
1367 | \r | |
1368 | @param[in] CallBackGuid The PCD token GUID being set.\r | |
1369 | @param[in] CallBackToken The PCD token number being set.\r | |
1370 | @param[in, out] TokenData A pointer to the token data being set.\r | |
1371 | @param[in] TokenDataSize The size, in bytes, of the data being set.\r | |
1372 | \r | |
1373 | **/\r | |
1374 | typedef\r | |
1375 | VOID\r | |
1376 | (EFIAPI *PCD_CALLBACK)(\r | |
1377 | IN CONST GUID *CallBackGuid, OPTIONAL\r | |
1378 | IN UINTN CallBackToken,\r | |
1379 | IN OUT VOID *TokenData,\r | |
1380 | IN UINTN TokenDataSize\r | |
1381 | );\r | |
1382 | \r | |
1383 | \r | |
1384 | /**\r | |
1385 | Set up a notification function that is called when a specified token is set.\r | |
1386 | \r | |
1387 | When the token specified by TokenNumber and Guid is set, \r | |
1388 | then notification function specified by NotificationFunction is called. \r | |
1389 | If Guid is NULL, then the default token space is used. \r | |
1390 | \r | |
1391 | If NotificationFunction is NULL, then ASSERT().\r | |
1392 | \r | |
1393 | @param[in] Guid Pointer to a 128-bit unique value that designates which \r | |
1394 | namespace to set a value from. If NULL, then the default \r | |
1395 | token space is used.\r | |
1396 | @param[in] TokenNumber The PCD token number to monitor.\r | |
1397 | @param[in] NotificationFunction The function to call when the token \r | |
1398 | specified by Guid and TokenNumber is set.\r | |
1399 | \r | |
1400 | **/\r | |
1401 | VOID\r | |
1402 | EFIAPI\r | |
1403 | LibPcdCallbackOnSet (\r | |
1404 | IN CONST GUID *Guid, OPTIONAL\r | |
1405 | IN UINTN TokenNumber,\r | |
1406 | IN PCD_CALLBACK NotificationFunction\r | |
1407 | );\r | |
1408 | \r | |
1409 | \r | |
1410 | /**\r | |
1411 | Disable a notification function that was established with LibPcdCallbackonSet().\r | |
1412 | \r | |
1413 | Disable a notification function that was previously established with LibPcdCallbackOnSet(). \r | |
1414 | \r | |
1415 | If NotificationFunction is NULL, then ASSERT().\r | |
1416 | If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, \r | |
1417 | and NotificationFunction, then ASSERT().\r | |
1418 | \r | |
1419 | @param[in] Guid Specify the GUID token space.\r | |
1420 | @param[in] TokenNumber Specify the token number.\r | |
1421 | @param[in] NotificationFunction The callback function to be unregistered.\r | |
1422 | \r | |
1423 | **/\r | |
1424 | VOID\r | |
1425 | EFIAPI\r | |
1426 | LibPcdCancelCallback (\r | |
1427 | IN CONST GUID *Guid, OPTIONAL\r | |
1428 | IN UINTN TokenNumber,\r | |
1429 | IN PCD_CALLBACK NotificationFunction\r | |
1430 | );\r | |
1431 | \r | |
1432 | \r | |
1433 | /**\r | |
1434 | Retrieves the next token in a token space.\r | |
1435 | \r | |
1436 | Retrieves the next PCD token number from the token space specified by Guid. \r | |
1437 | If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r | |
1438 | then the first token number is returned. Otherwise, the token number that \r | |
1439 | follows TokenNumber in the token space is returned. If TokenNumber is the last \r | |
1440 | token number in the token space, then 0 is returned. \r | |
1441 | \r | |
1442 | If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().\r | |
1443 | \r | |
1444 | @param[in] Guid Pointer to a 128-bit unique value that designates which namespace \r | |
1445 | to set a value from. If NULL, then the default token space is used.\r | |
1446 | @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD \r | |
1447 | token number.\r | |
1448 | \r | |
1449 | @return The next valid token number.\r | |
1450 | \r | |
1451 | **/\r | |
1452 | UINTN \r | |
1453 | EFIAPI\r | |
1454 | LibPcdGetNextToken (\r | |
1455 | IN CONST GUID *Guid, OPTIONAL\r | |
1456 | IN UINTN TokenNumber\r | |
1457 | );\r | |
1458 | \r | |
1459 | \r | |
1460 | \r | |
1461 | /**\r | |
1462 | Used to retrieve the list of available PCD token space GUIDs.\r | |
1463 | \r | |
1464 | Retrieves the next PCD token space from a token space specified by Guid.\r | |
1465 | Guid of NULL is reserved to mark the default local token namespace on the current\r | |
1466 | platform. If Guid is NULL, then the GUID of the first non-local token space of the \r | |
1467 | current platform is returned. If Guid is the last non-local token space, \r | |
1468 | then NULL is returned. \r | |
1469 | \r | |
1470 | If Guid is not NULL and is not a valid token space in the current platform, then ASSERT().\r | |
1471 | \r | |
1472 | \r | |
1473 | \r | |
1474 | @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace \r | |
1475 | to start the search.\r | |
1476 | \r | |
1477 | @return The next valid token namespace.\r | |
1478 | \r | |
1479 | **/\r | |
1480 | GUID * \r | |
1481 | EFIAPI\r | |
1482 | LibPcdGetNextTokenSpace (\r | |
1483 | IN CONST GUID *TokenSpaceGuid\r | |
1484 | );\r | |
1485 | \r | |
1486 | \r | |
1487 | /**\r | |
1488 | Sets a value of a patchable PCD entry that is type pointer.\r | |
1489 | \r | |
1490 | Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r | |
1491 | and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than \r | |
1492 | MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return \r | |
1493 | NULL to indicate that the set operation was not actually performed. \r | |
1494 | If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to \r | |
1495 | MaximumDatumSize and NULL must be returned.\r | |
1496 | \r | |
1497 | If PatchVariable is NULL, then ASSERT().\r | |
1498 | If SizeOfBuffer is NULL, then ASSERT().\r | |
1499 | If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r | |
1500 | \r | |
1501 | @param[in] PatchVariable A pointer to the global variable in a module that is \r | |
1502 | the target of the set operation.\r | |
1503 | @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r | |
1504 | @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r | |
1505 | @param[in] Buffer A pointer to the buffer to used to set the target variable.\r | |
1506 | \r | |
1507 | @return Return the pointer to the buffer been set.\r | |
1508 | \r | |
1509 | **/\r | |
1510 | VOID *\r | |
1511 | EFIAPI\r | |
1512 | LibPatchPcdSetPtr (\r | |
1513 | IN VOID *PatchVariable,\r | |
1514 | IN UINTN MaximumDatumSize,\r | |
1515 | IN OUT UINTN *SizeOfBuffer,\r | |
1516 | IN CONST VOID *Buffer\r | |
1517 | );\r | |
1518 | \r | |
1519 | #endif\r |