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