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