]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PcdLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Library / PcdLib.h
CommitLineData
fb3df220 1/** @file\r
50a64e5b 2 Provides library services to get and set Platform Configuration Database entries.\r
3\r
1a2f870c 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
f754f721 9 translated to a variable or macro that is auto-generated by build tool in\r
50a64e5b 10 module's autogen.h/autogen.c.\r
9095d37b
LG
11 The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are\r
12 only available prior to ExitBootServices(). If access to PCD values are required\r
64735d24 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
50a64e5b 16\r
9095d37b 17Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 18SPDX-License-Identifier: BSD-2-Clause-Patent\r
fb3df220 19\r
fb3df220 20**/\r
21\r
22#ifndef __PCD_LIB_H__\r
23#define __PCD_LIB_H__\r
24\r
64735d24 25/**\r
26 Retrieves a token number based on a token name.\r
27\r
88fd27e5 28 Returns the token number associated with the PCD token specified by TokenName.\r
64735d24 29 If TokenName is not a valid token in the token space, then the module will not build.\r
64735d24 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
2f88bd3a 36#define PcdToken(TokenName) _PCD_TOKEN_##TokenName\r
fb3df220 37\r
64735d24 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
88fd27e5 43 If TokenName is not a feature flag PCD, then the module will not build.\r
64735d24 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
2f88bd3a 50#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
fb3df220 51\r
64735d24 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
88fd27e5 57 If TokenName is not a fixed at build PCD, then the module will not build.\r
64735d24 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
2f88bd3a 64#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName\r
64735d24 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
88fd27e5 71 If TokenName is not a fixed at build PCD, then the module will not build.\r
64735d24 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
2f88bd3a 78#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName\r
64735d24 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
88fd27e5 85 If TokenName is not a fixed at build PCD, then the module will not build.\r
64735d24 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
2f88bd3a 92#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName\r
64735d24 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
88fd27e5 99 If TokenName is not a fixed at build PCD, then the module will not build.\r
64735d24 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
2f88bd3a 106#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName\r
64735d24 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
88fd27e5 113 If TokenName is not a fixed at build PCD, then the module will not build.\r
64735d24 114\r
115 @param TokenName The name of the PCD token to retrieve a current value for.\r
116\r
9095d37b 117 @return The Boolean value for the token.\r
64735d24 118\r
119**/\r
2f88bd3a 120#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName\r
fb3df220 121\r
64735d24 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
88fd27e5 127 If TokenName is not a fixed at build PCD, then the module will not build.\r
64735d24 128\r
129 @param TokenName The name of the PCD token to retrieve a current value for.\r
130\r
9095d37b 131 @return A pointer to the buffer.\r
64735d24 132\r
133**/\r
2f88bd3a 134#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)\r
fb3df220 135\r
64735d24 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
88fd27e5 141 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
2f88bd3a 148#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName\r
64735d24 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
88fd27e5 155 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
2f88bd3a 162#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName\r
64735d24 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
88fd27e5 169 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
2f88bd3a 176#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName\r
64735d24 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
88fd27e5 183 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
2f88bd3a 190#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName\r
64735d24 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
88fd27e5 197 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
2f88bd3a 204#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName\r
64735d24 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
88fd27e5 211 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
2f88bd3a 218#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)\r
64735d24 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
88fd27e5 225 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
9095d37b 229\r
7b5b3124 230 @return Return the Value that was set.\r
64735d24 231\r
232**/\r
2f88bd3a 233#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
64735d24 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
88fd27e5 240 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
7b5b3124 245 @return Return the Value that was set.\r
64735d24 246\r
247**/\r
2f88bd3a 248#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
64735d24 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
88fd27e5 255 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
7b5b3124 260 @return Return the Value that was set.\r
64735d24 261\r
262**/\r
2f88bd3a 263#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
64735d24 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
88fd27e5 270 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
7b5b3124 275 @return Return the Value that was set.\r
64735d24 276\r
277**/\r
2f88bd3a 278#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
64735d24 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
88fd27e5 285 If TokenName is not a patchable in module PCD, then the module will not build.\r
64735d24 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
7b5b3124 290 @return Return the Value that was set.\r
64735d24 291\r
292**/\r
2f88bd3a 293#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))\r
64735d24 294\r
295/**\r
296 Sets a pointer to a binary patchable PCD token buffer based on a token name.\r
297\r
9095d37b 298 Sets the buffer for the token specified by TokenName. Buffer is returned.\r
64735d24 299 If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer\r
9095d37b
LG
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
64735d24 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
88fd27e5 304 If TokenName is not a patchable in module PCD, then the module will not build.\r
9095d37b 305\r
64735d24 306 If SizeOfBuffer is NULL, then ASSERT().\r
307 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
9095d37b 308\r
64735d24 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
7b5b3124 313 @return Return the pointer to the Buffer that was set.\r
64735d24 314\r
315**/\r
fb3df220 316#define PatchPcdSetPtr(TokenName, Size, Buffer) \\r
f8308f0a
LG
317 LibPatchPcdSetPtrAndSize ( \\r
318 (VOID *)_gPcd_BinaryPatch_##TokenName, \\r
319 &_gPcd_BinaryPatch_Size_##TokenName, \\r
fb3df220 320 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \\r
321 (Size), \\r
322 (Buffer) \\r
323 )\r
2f88bd3a 324\r
64735d24 325/**\r
326 Retrieves an 8-bit PCD token value based on a token name.\r
9095d37b 327\r
64735d24 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
9095d37b 330\r
64735d24 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
2f88bd3a 336#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName\r
64735d24 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
2f88bd3a 349#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName\r
64735d24 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
2f88bd3a 362#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName\r
64735d24 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
2f88bd3a 375#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName\r
64735d24 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
2f88bd3a 388#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName\r
64735d24 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
2f88bd3a 401#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName\r
64735d24 402\r
bf8e99a4
LG
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
2f88bd3a 414#define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName\r
bf8e99a4
LG
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
2f88bd3a 427#define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName\r
bf8e99a4
LG
428\r
429/**\r
430 Retrieves the size of the PCD token based on a token name.\r
9095d37b 431\r
bf8e99a4
LG
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
9095d37b 434\r
bf8e99a4
LG
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
2f88bd3a 440#define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName\r
bf8e99a4
LG
441\r
442/**\r
443 Retrieve the size of a given PCD token.\r
bf8e99a4 444\r
9095d37b
LG
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
bf8e99a4
LG
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
2f88bd3a 455#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))\r
bf8e99a4 456\r
9a355841
SZ
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
2f88bd3a 469#define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value))\r
9a355841
SZ
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
fb3df220 481\r
9a355841 482**/\r
2f88bd3a 483#define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value))\r
9a355841
SZ
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
2f88bd3a 497#define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value))\r
9a355841
SZ
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
2f88bd3a 511#define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value))\r
9a355841
SZ
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
9a355841
SZ
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
2f88bd3a 549#define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value))\r
64735d24 550\r
419db80b
BF
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
88fd27e5 555 If TokenName is not a valid token in the token space, then the module will not build.\r
419db80b 556\r
9095d37b 557 @param Guid Pointer to a 128-bit unique value that designates\r
419db80b 558 which namespace to retrieve a value from.\r
9095d37b 559 @param TokenName The name of the PCD token to retrieve a current value for.\r
419db80b
BF
560\r
561 @return Return the token number.\r
562\r
563**/\r
2f88bd3a 564#define PcdTokenEx(Guid, TokenName) _PCD_TOKEN_EX_##TokenName(Guid)\r
419db80b 565\r
64735d24 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
9095d37b 570 If TokenName is not a valid token in the token space specified by Guid,\r
64735d24 571 then the module will not build.\r
9095d37b 572\r
64735d24 573 If Guid is NULL, then ASSERT().\r
574\r
9095d37b 575 @param Guid Pointer to a 128-bit unique value that designates\r
64735d24 576 which namespace to retrieve a value from.\r
9095d37b 577 @param TokenName The name of the PCD token to retrieve a current value for.\r
64735d24 578\r
579 @return An 8-bit PCD token value.\r
580\r
581**/\r
2f88bd3a 582#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 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
9095d37b 588 If TokenName is not a valid token in the token space specified by Guid,\r
64735d24 589 then the module will not build.\r
590\r
591 If Guid is NULL, then ASSERT().\r
592\r
9095d37b 593 @param Guid Pointer to a 128-bit unique value that designates\r
64735d24 594 which namespace to retrieve a value from.\r
9095d37b 595 @param TokenName The name of the PCD token to retrieve a current value for.\r
64735d24 596\r
597 @return A 16-bit PCD token value.\r
598\r
599**/\r
2f88bd3a 600#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 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
9095d37b 606 If TokenName is not a valid token in the token space specified by Guid,\r
64735d24 607 then the module will not build.\r
608\r
609 If Guid is NULL, then ASSERT().\r
610\r
9095d37b 611 @param Guid Pointer to a 128-bit unique value that designates\r
64735d24 612 which namespace to retrieve a value from.\r
9095d37b 613 @param TokenName The name of the PCD token to retrieve a current value for.\r
64735d24 614\r
615 @return A 32-bit PCD token value.\r
616\r
617**/\r
2f88bd3a 618#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 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
9095d37b 624 If TokenName is not a valid token in the token space specified by Guid,\r
64735d24 625 then the module will not build.\r
626\r
627 If Guid is NULL, then ASSERT().\r
628\r
9095d37b 629 @param Guid Pointer to a 128-bit unique value that designates\r
64735d24 630 which namespace to retrieve a value from.\r
9095d37b 631 @param TokenName The name of the PCD token to retrieve a current value for.\r
64735d24 632\r
633 @return A 64-bit PCD token value.\r
634\r
635**/\r
2f88bd3a 636#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 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
9095d37b 642 If TokenName is not a valid token in the token space specified by Guid,\r
64735d24 643 then the module will not build.\r
644\r
645 If Guid is NULL, then ASSERT().\r
646\r
9095d37b 647 @param Guid Pointer to a 128-bit unique value that designates\r
64735d24 648 which namespace to retrieve a value from.\r
9095d37b 649 @param TokenName The name of the PCD token to retrieve a current value for.\r
64735d24 650\r
651 @return A pointer to a PCD token buffer.\r
652\r
653**/\r
2f88bd3a 654#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))\r
64735d24 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
9095d37b 660 If TokenName is not a valid token in the token space specified by Guid,\r
64735d24 661 then the module will not build.\r
662\r
663 If Guid is NULL, then ASSERT().\r
664\r
9095d37b 665 @param Guid Pointer to a 128-bit unique value that designates\r
64735d24 666 which namespace to retrieve a value from.\r
9095d37b 667 @param TokenName The name of the PCD token to retrieve a current value for.\r
64735d24 668\r
669 @return A Boolean PCD token value.\r
670\r
671**/\r
2f88bd3a 672#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))\r
9a355841 673\r
9a355841
SZ
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
fb3df220 680\r
9a355841
SZ
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
2f88bd3a 691#define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
9a355841
SZ
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
2f88bd3a 710#define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
9a355841
SZ
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
2f88bd3a 729#define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
9a355841
SZ
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
2f88bd3a 748#define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))\r
9a355841
SZ
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
9a355841
SZ
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
fb3df220 797\r
798/**\r
64735d24 799 This function provides a means by which SKU support can be established in the PCD infrastructure.\r
800\r
fb3df220 801 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
802\r
b677694d 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
fb3df220 805\r
1a2f870c 806 @return Return the SKU ID that was set.\r
fb3df220 807\r
808**/\r
809UINTN\r
810EFIAPI\r
811LibPcdSetSku (\r
2f88bd3a 812 IN UINTN SkuId\r
fb3df220 813 );\r
814\r
fb3df220 815/**\r
64735d24 816 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
817\r
818 Returns the 8-bit value for the token specified by TokenNumber.\r
fb3df220 819\r
2a254b90 820 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 821\r
9095d37b 822 @return Returns the 8-bit value for the token specified by TokenNumber.\r
fb3df220 823\r
824**/\r
825UINT8\r
826EFIAPI\r
827LibPcdGet8 (\r
2f88bd3a 828 IN UINTN TokenNumber\r
fb3df220 829 );\r
830\r
fb3df220 831/**\r
64735d24 832 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
833\r
834 Returns the 16-bit value for the token specified by TokenNumber.\r
fb3df220 835\r
2a254b90 836 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 837\r
9095d37b 838 @return Returns the 16-bit value for the token specified by TokenNumber.\r
fb3df220 839\r
840**/\r
841UINT16\r
842EFIAPI\r
843LibPcdGet16 (\r
2f88bd3a 844 IN UINTN TokenNumber\r
fb3df220 845 );\r
846\r
fb3df220 847/**\r
64735d24 848 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
849\r
850 Returns the 32-bit value for the token specified by TokenNumber.\r
fb3df220 851\r
852 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
853\r
f73e0ad2 854 @return Returns the 32-bit value for the token specified by TokenNumber.\r
fb3df220 855\r
856**/\r
857UINT32\r
858EFIAPI\r
859LibPcdGet32 (\r
2f88bd3a 860 IN UINTN TokenNumber\r
fb3df220 861 );\r
862\r
fb3df220 863/**\r
64735d24 864 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 865\r
fb3df220 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
f73e0ad2 870 @return Returns the 64-bit value for the token specified by TokenNumber.\r
fb3df220 871\r
872**/\r
873UINT64\r
874EFIAPI\r
875LibPcdGet64 (\r
2f88bd3a 876 IN UINTN TokenNumber\r
fb3df220 877 );\r
878\r
fb3df220 879/**\r
64735d24 880 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 881\r
fb3df220 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
f73e0ad2 886 @return Returns the pointer to the token specified by TokenNumber.\r
fb3df220 887\r
888**/\r
889VOID *\r
890EFIAPI\r
891LibPcdGetPtr (\r
2f88bd3a 892 IN UINTN TokenNumber\r
fb3df220 893 );\r
894\r
fb3df220 895/**\r
64735d24 896 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
897\r
898 Returns the Boolean value of the token specified by TokenNumber.\r
fb3df220 899\r
900 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
901\r
9095d37b 902 @return Returns the Boolean value of the token specified by TokenNumber.\r
fb3df220 903\r
904**/\r
9095d37b 905BOOLEAN\r
fb3df220 906EFIAPI\r
907LibPcdGetBool (\r
2f88bd3a 908 IN UINTN TokenNumber\r
fb3df220 909 );\r
910\r
fb3df220 911/**\r
64735d24 912 This function provides a means by which to retrieve the size of a given PCD token.\r
fb3df220 913\r
914 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
915\r
9095d37b 916 @return Returns the size of the token specified by TokenNumber.\r
fb3df220 917\r
918**/\r
919UINTN\r
920EFIAPI\r
921LibPcdGetSize (\r
2f88bd3a 922 IN UINTN TokenNumber\r
fb3df220 923 );\r
924\r
fb3df220 925/**\r
64735d24 926 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 927\r
fb3df220 928 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
fb3df220 929\r
9095d37b
LG
930 If Guid is NULL, then ASSERT().\r
931\r
932 @param[in] Guid Pointer to a 128-bit unique value that designates\r
b677694d 933 which namespace to retrieve a value from.\r
934 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 935\r
f73e0ad2 936 @return Return the UINT8.\r
fb3df220 937\r
938**/\r
939UINT8\r
940EFIAPI\r
941LibPcdGetEx8 (\r
2f88bd3a
MK
942 IN CONST GUID *Guid,\r
943 IN UINTN TokenNumber\r
fb3df220 944 );\r
945\r
fb3df220 946/**\r
64735d24 947 This function provides a means by which to retrieve a value for a given PCD token.\r
948\r
fb3df220 949 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
fb3df220 950\r
9095d37b
LG
951 If Guid is NULL, then ASSERT().\r
952\r
953 @param[in] Guid Pointer to a 128-bit unique value that designates\r
b677694d 954 which namespace to retrieve a value from.\r
955 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 956\r
f73e0ad2 957 @return Return the UINT16.\r
fb3df220 958\r
959**/\r
960UINT16\r
961EFIAPI\r
962LibPcdGetEx16 (\r
2f88bd3a
MK
963 IN CONST GUID *Guid,\r
964 IN UINTN TokenNumber\r
fb3df220 965 );\r
966\r
fb3df220 967/**\r
968 Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
9095d37b 969 If Guid is NULL, then ASSERT().\r
fb3df220 970\r
9095d37b 971 @param[in] Guid Pointer to a 128-bit unique value that designates\r
b677694d 972 which namespace to retrieve a value from.\r
973 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 974\r
f73e0ad2 975 @return Return the UINT32.\r
fb3df220 976\r
977**/\r
978UINT32\r
979EFIAPI\r
980LibPcdGetEx32 (\r
2f88bd3a
MK
981 IN CONST GUID *Guid,\r
982 IN UINTN TokenNumber\r
fb3df220 983 );\r
984\r
fb3df220 985/**\r
64735d24 986 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 987\r
fb3df220 988 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
fb3df220 989\r
9095d37b
LG
990 If Guid is NULL, then ASSERT().\r
991\r
992 @param[in] Guid Pointer to a 128-bit unique value that designates\r
fb287b56 993 which namespace to retrieve a value from.\r
994 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 995\r
f73e0ad2 996 @return Return the UINT64.\r
fb3df220 997\r
998**/\r
999UINT64\r
1000EFIAPI\r
1001LibPcdGetEx64 (\r
2f88bd3a
MK
1002 IN CONST GUID *Guid,\r
1003 IN UINTN TokenNumber\r
fb3df220 1004 );\r
1005\r
fb3df220 1006/**\r
64735d24 1007 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 1008\r
fb3df220 1009 Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
fb3df220 1010\r
9095d37b
LG
1011 If Guid is NULL, then ASSERT().\r
1012\r
1013 @param[in] Guid Pointer to a 128-bit unique value that designates\r
fb287b56 1014 which namespace to retrieve a value from.\r
1015 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1016\r
f73e0ad2 1017 @return Return the VOID* pointer.\r
fb3df220 1018\r
1019**/\r
1020VOID *\r
1021EFIAPI\r
1022LibPcdGetExPtr (\r
2f88bd3a
MK
1023 IN CONST GUID *Guid,\r
1024 IN UINTN TokenNumber\r
fb3df220 1025 );\r
1026\r
fb3df220 1027/**\r
64735d24 1028 This function provides a means by which to retrieve a value for a given PCD token.\r
fb3df220 1029\r
9095d37b
LG
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
fb287b56 1035 which namespace to retrieve a value from.\r
1036 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1037\r
f73e0ad2 1038 @return Return the BOOLEAN.\r
fb3df220 1039\r
1040**/\r
1041BOOLEAN\r
1042EFIAPI\r
1043LibPcdGetExBool (\r
2f88bd3a
MK
1044 IN CONST GUID *Guid,\r
1045 IN UINTN TokenNumber\r
fb3df220 1046 );\r
1047\r
fb3df220 1048/**\r
64735d24 1049 This function provides a means by which to retrieve the size of a given PCD token.\r
fb3df220 1050\r
9095d37b
LG
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
fb287b56 1056 which namespace to retrieve a value from.\r
1057 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
fb3df220 1058\r
f73e0ad2 1059 @return Return the size.\r
fb3df220 1060\r
1061**/\r
1062UINTN\r
1063EFIAPI\r
1064LibPcdGetExSize (\r
2f88bd3a
MK
1065 IN CONST GUID *Guid,\r
1066 IN UINTN TokenNumber\r
fb3df220 1067 );\r
1068\r
9a355841
SZ
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
1081RETURN_STATUS\r
1082EFIAPI\r
1083LibPcdSet8S (\r
2f88bd3a
MK
1084 IN UINTN TokenNumber,\r
1085 IN UINT8 Value\r
9a355841
SZ
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
1100RETURN_STATUS\r
1101EFIAPI\r
1102LibPcdSet16S (\r
2f88bd3a
MK
1103 IN UINTN TokenNumber,\r
1104 IN UINT16 Value\r
9a355841
SZ
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
1119RETURN_STATUS\r
1120EFIAPI\r
1121LibPcdSet32S (\r
2f88bd3a
MK
1122 IN UINTN TokenNumber,\r
1123 IN UINT32 Value\r
9a355841
SZ
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
1138RETURN_STATUS\r
1139EFIAPI\r
1140LibPcdSet64S (\r
2f88bd3a
MK
1141 IN UINTN TokenNumber,\r
1142 IN UINT64 Value\r
9a355841
SZ
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
1167RETURN_STATUS\r
1168EFIAPI\r
1169LibPcdSetPtrS (\r
2f88bd3a
MK
1170 IN UINTN TokenNumber,\r
1171 IN OUT UINTN *SizeOfBuffer,\r
1172 IN CONST VOID *Buffer\r
9a355841
SZ
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
1187RETURN_STATUS\r
1188EFIAPI\r
1189LibPcdSetBoolS (\r
2f88bd3a
MK
1190 IN UINTN TokenNumber,\r
1191 IN BOOLEAN Value\r
9a355841
SZ
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
1210RETURN_STATUS\r
1211EFIAPI\r
1212LibPcdSetEx8S (\r
2f88bd3a
MK
1213 IN CONST GUID *Guid,\r
1214 IN UINTN TokenNumber,\r
1215 IN UINT8 Value\r
9a355841
SZ
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
1234RETURN_STATUS\r
1235EFIAPI\r
1236LibPcdSetEx16S (\r
2f88bd3a
MK
1237 IN CONST GUID *Guid,\r
1238 IN UINTN TokenNumber,\r
1239 IN UINT16 Value\r
9a355841
SZ
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
1258RETURN_STATUS\r
1259EFIAPI\r
1260LibPcdSetEx32S (\r
2f88bd3a
MK
1261 IN CONST GUID *Guid,\r
1262 IN UINTN TokenNumber,\r
1263 IN UINT32 Value\r
9a355841
SZ
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
1282RETURN_STATUS\r
1283EFIAPI\r
1284LibPcdSetEx64S (\r
2f88bd3a
MK
1285 IN CONST GUID *Guid,\r
1286 IN UINTN TokenNumber,\r
1287 IN UINT64 Value\r
9a355841
SZ
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
1312RETURN_STATUS\r
1313EFIAPI\r
1314LibPcdSetExPtrS (\r
2f88bd3a
MK
1315 IN CONST GUID *Guid,\r
1316 IN UINTN TokenNumber,\r
1317 IN OUT UINTN *SizeOfBuffer,\r
1318 IN VOID *Buffer\r
9a355841
SZ
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
1337RETURN_STATUS\r
1338EFIAPI\r
1339LibPcdSetExBoolS (\r
2f88bd3a
MK
1340 IN CONST GUID *Guid,\r
1341 IN UINTN TokenNumber,\r
1342 IN BOOLEAN Value\r
9a355841 1343 );\r
fb3df220 1344\r
1345/**\r
b677694d 1346 This notification function serves two purposes.\r
fb3df220 1347\r
1a2f870c 1348 Firstly, it notifies the module that did the registration that the value of this\r
b677694d 1349 PCD token has been set.\r
1a2f870c 1350 Secondly, it provides a mechanism for the module that did the registration to intercept\r
b677694d 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
9095d37b 1353 internal data in PCD database.\r
fb3df220 1354\r
2a254b90 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
fb3df220 1359\r
fb3df220 1360**/\r
1361typedef\r
1362VOID\r
78bf8f2d 1363(EFIAPI *PCD_CALLBACK)(\r
d0e2f823 1364 IN CONST GUID *CallBackGuid OPTIONAL,\r
fb3df220 1365 IN UINTN CallBackToken,\r
1366 IN OUT VOID *TokenData,\r
1367 IN UINTN TokenDataSize\r
1368 );\r
1369\r
fb3df220 1370/**\r
64735d24 1371 Set up a notification function that is called when a specified token is set.\r
9095d37b
LG
1372\r
1373 When the token specified by TokenNumber and Guid is set,\r
1374 then notification function specified by NotificationFunction is called.\r
b677694d 1375 If Guid is NULL, then the default token space is used.\r
fb3df220 1376 If NotificationFunction is NULL, then ASSERT().\r
1377\r
9095d37b
LG
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
b677694d 1380 token space is used.\r
1381 @param[in] TokenNumber The PCD token number to monitor.\r
9095d37b 1382 @param[in] NotificationFunction The function to call when the token\r
fb287b56 1383 specified by Guid and TokenNumber is set.\r
fb3df220 1384\r
1385**/\r
1386VOID\r
1387EFIAPI\r
1388LibPcdCallbackOnSet (\r
2f88bd3a
MK
1389 IN CONST GUID *Guid OPTIONAL,\r
1390 IN UINTN TokenNumber,\r
1391 IN PCD_CALLBACK NotificationFunction\r
fb3df220 1392 );\r
1393\r
fb3df220 1394/**\r
1395 Disable a notification function that was established with LibPcdCallbackonSet().\r
9095d37b 1396\r
b677694d 1397 Disable a notification function that was previously established with LibPcdCallbackOnSet().\r
64735d24 1398 If NotificationFunction is NULL, then ASSERT().\r
9095d37b 1399 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,\r
64735d24 1400 and NotificationFunction, then ASSERT().\r
9095d37b 1401\r
b677694d 1402 @param[in] Guid Specify the GUID token space.\r
1403 @param[in] TokenNumber Specify the token number.\r
fb3df220 1404 @param[in] NotificationFunction The callback function to be unregistered.\r
1405\r
fb3df220 1406**/\r
1407VOID\r
1408EFIAPI\r
1409LibPcdCancelCallback (\r
2f88bd3a
MK
1410 IN CONST GUID *Guid OPTIONAL,\r
1411 IN UINTN TokenNumber,\r
1412 IN PCD_CALLBACK NotificationFunction\r
fb3df220 1413 );\r
1414\r
fb3df220 1415/**\r
64735d24 1416 Retrieves the next token in a token space.\r
9095d37b
LG
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
64735d24 1424 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().\r
fb3df220 1425\r
9095d37b 1426 @param[in] Guid Pointer to a 128-bit unique value that designates which namespace\r
2a254b90 1427 to set a value from. If NULL, then the default token space is used.\r
9095d37b 1428 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD\r
2a254b90 1429 token number.\r
fb3df220 1430\r
f73e0ad2 1431 @return The next valid token number.\r
fb3df220 1432\r
1433**/\r
9095d37b 1434UINTN\r
fb3df220 1435EFIAPI\r
1436LibPcdGetNextToken (\r
2f88bd3a
MK
1437 IN CONST GUID *Guid OPTIONAL,\r
1438 IN UINTN TokenNumber\r
fb3df220 1439 );\r
1440\r
fb3df220 1441/**\r
64735d24 1442 Used to retrieve the list of available PCD token space GUIDs.\r
9095d37b 1443\r
b677694d 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
9095d37b 1448\r
b677694d 1449 @param TokenSpaceGuid Pointer to the a PCD token space GUID\r
fb3df220 1450\r
f73e0ad2 1451 @return The next valid token namespace.\r
fb3df220 1452\r
1453**/\r
b677694d 1454GUID *\r
fb3df220 1455EFIAPI\r
1456LibPcdGetNextTokenSpace (\r
64735d24 1457 IN CONST GUID *TokenSpaceGuid\r
fb3df220 1458 );\r
1459\r
fb3df220 1460/**\r
64735d24 1461 Sets a value of a patchable PCD entry that is type pointer.\r
9095d37b
LG
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
fb3df220 1468 MaximumDatumSize and NULL must be returned.\r
9095d37b 1469\r
fb3df220 1470 If PatchVariable is NULL, then ASSERT().\r
d3057543 1471 If SizeOfBuffer is NULL, then ASSERT().\r
1472 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
fb3df220 1473\r
9095d37b 1474 @param[out] PatchVariable A pointer to the global variable in a module that is\r
fb3df220 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
9095d37b 1479\r
502bfcef 1480 @return Return the pointer to the Buffer that was set.\r
fb3df220 1481\r
1482**/\r
1483VOID *\r
1484EFIAPI\r
1485LibPatchPcdSetPtr (\r
2f88bd3a
MK
1486 OUT VOID *PatchVariable,\r
1487 IN UINTN MaximumDatumSize,\r
1488 IN OUT UINTN *SizeOfBuffer,\r
1489 IN CONST VOID *Buffer\r
fb3df220 1490 );\r
1491\r
9a355841
SZ
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
f8308f0a 1506 @param[out] PatchVariable A pointer to the global variable in a module that is\r
9a355841
SZ
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
9095d37b 1511\r
9a355841
SZ
1512 @return The status of the set operation.\r
1513\r
1514**/\r
1515RETURN_STATUS\r
1516EFIAPI\r
1517LibPatchPcdSetPtrS (\r
2f88bd3a
MK
1518 OUT VOID *PatchVariable,\r
1519 IN UINTN MaximumDatumSize,\r
1520 IN OUT UINTN *SizeOfBuffer,\r
1521 IN CONST VOID *Buffer\r
f8308f0a
LG
1522 );\r
1523\r
1524/**\r
1525 Sets a value and size of a patchable PCD entry that is type pointer.\r
9095d37b
LG
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
f8308f0a 1532 MaximumDatumSize and NULL must be returned.\r
9095d37b 1533\r
f8308f0a
LG
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
9095d37b 1539 @param[out] PatchVariable A pointer to the global variable in a module that is\r
f8308f0a
LG
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
9095d37b 1545\r
f8308f0a
LG
1546 @return Return the pointer to the Buffer that was set.\r
1547\r
1548**/\r
1549VOID *\r
1550EFIAPI\r
1551LibPatchPcdSetPtrAndSize (\r
2f88bd3a
MK
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
f8308f0a
LG
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
9095d37b 1580\r
f8308f0a
LG
1581 @return The status of the set operation.\r
1582\r
1583**/\r
1584RETURN_STATUS\r
1585EFIAPI\r
1586LibPatchPcdSetPtrAndSizeS (\r
2f88bd3a
MK
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
9a355841
SZ
1592 );\r
1593\r
96d6d004
SZ
1594typedef 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
1603typedef 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
2f88bd3a 1608 PCD_TYPE PcdType;\r
96d6d004
SZ
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
2f88bd3a 1613 UINTN PcdSize;\r
96d6d004
SZ
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
2f88bd3a 1620 CHAR8 *PcdName;\r
96d6d004
SZ
1621} PCD_INFO;\r
1622\r
96d6d004
SZ
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
1635VOID\r
1636EFIAPI\r
1637LibPcdGetInfo (\r
2f88bd3a
MK
1638 IN UINTN TokenNumber,\r
1639 OUT PCD_INFO *PcdInfo\r
96d6d004
SZ
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
1655VOID\r
1656EFIAPI\r
1657LibPcdGetInfoEx (\r
2f88bd3a
MK
1658 IN CONST GUID *Guid,\r
1659 IN UINTN TokenNumber,\r
1660 OUT PCD_INFO *PcdInfo\r
96d6d004
SZ
1661 );\r
1662\r
1663/**\r
1664 Retrieve the currently set SKU Id.\r
1665\r
96d6d004
SZ
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
1670UINTN\r
1671EFIAPI\r
1672LibPcdGetSku (\r
1673 VOID\r
1674 );\r
1675\r
fb3df220 1676#endif\r