]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | Implementation of PcdLib class library for DXE phase.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation<BR>\r | |
5 | All rights reserved. This program and the accompanying materials \r | |
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 | |
14 | Module Name: DxePcdLib.c\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | static PCD_PROTOCOL *mPcd;\r | |
19 | \r | |
20 | /**\r | |
21 | The constructor function caches the PCD_PROTOCOL pointer.\r | |
22 | \r | |
23 | @param[in] ImageHandle The firmware allocated handle for the EFI image. \r | |
24 | @param[in] SystemTable A pointer to the EFI System Table.\r | |
25 | \r | |
26 | @retval EFI_SUCCESS The constructor always return EFI_SUCCESS.\r | |
27 | \r | |
28 | **/\r | |
29 | EFI_STATUS\r | |
30 | EFIAPI\r | |
31 | PcdLibConstructor (\r | |
32 | IN EFI_HANDLE ImageHandle,\r | |
33 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
34 | )\r | |
35 | {\r | |
36 | EFI_STATUS Status;\r | |
37 | \r | |
38 | Status = gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **)&mPcd);\r | |
39 | ASSERT_EFI_ERROR (Status);\r | |
40 | \r | |
41 | return EFI_SUCCESS;\r | |
42 | }\r | |
43 | \r | |
44 | \r | |
45 | /**\r | |
46 | Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r | |
47 | \r | |
48 | @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r | |
49 | set values associated with a PCD token.\r | |
50 | \r | |
51 | @retval UINTN Return the SKU ID that just be set.\r | |
52 | \r | |
53 | **/\r | |
54 | UINTN\r | |
55 | EFIAPI\r | |
56 | LibPcdSetSku (\r | |
57 | IN UINTN SkuId\r | |
58 | )\r | |
59 | {\r | |
60 | EFI_STATUS Status;\r | |
61 | \r | |
62 | Status = mPcd->SetSku (SkuId);\r | |
63 | ASSERT_EFI_ERROR (Status);\r | |
64 | \r | |
65 | return SkuId;\r | |
66 | }\r | |
67 | \r | |
68 | \r | |
69 | \r | |
70 | /**\r | |
71 | Returns the 8-bit value for the token specified by TokenNumber. \r | |
72 | \r | |
73 | @param[in] The PCD token number to retrieve a current value for.\r | |
74 | \r | |
75 | @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber. \r | |
76 | \r | |
77 | **/\r | |
78 | UINT8\r | |
79 | EFIAPI\r | |
80 | LibPcdGet8 (\r | |
81 | IN UINTN TokenNumber\r | |
82 | )\r | |
83 | {\r | |
84 | return mPcd->Get8 (TokenNumber);\r | |
85 | }\r | |
86 | \r | |
87 | \r | |
88 | \r | |
89 | /**\r | |
90 | Returns the 16-bit value for the token specified by TokenNumber. \r | |
91 | \r | |
92 | @param[in] The PCD token number to retrieve a current value for.\r | |
93 | \r | |
94 | @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber. \r | |
95 | \r | |
96 | **/\r | |
97 | UINT16\r | |
98 | EFIAPI\r | |
99 | LibPcdGet16 (\r | |
100 | IN UINTN TokenNumber\r | |
101 | )\r | |
102 | {\r | |
103 | return mPcd->Get16 (TokenNumber);\r | |
104 | }\r | |
105 | \r | |
106 | \r | |
107 | \r | |
108 | /**\r | |
109 | Returns the 32-bit value for the token specified by TokenNumber. \r | |
110 | \r | |
111 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
112 | \r | |
113 | @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.\r | |
114 | \r | |
115 | **/\r | |
116 | UINT32\r | |
117 | EFIAPI\r | |
118 | LibPcdGet32 (\r | |
119 | IN UINTN TokenNumber\r | |
120 | )\r | |
121 | {\r | |
122 | return mPcd->Get32 (TokenNumber);\r | |
123 | }\r | |
124 | \r | |
125 | \r | |
126 | \r | |
127 | /**\r | |
128 | Returns the 64-bit value for the token specified by TokenNumber.\r | |
129 | \r | |
130 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
131 | \r | |
132 | @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.\r | |
133 | \r | |
134 | **/\r | |
135 | UINT64\r | |
136 | EFIAPI\r | |
137 | LibPcdGet64 (\r | |
138 | IN UINTN TokenNumber\r | |
139 | )\r | |
140 | {\r | |
141 | return mPcd->Get64 (TokenNumber);\r | |
142 | }\r | |
143 | \r | |
144 | \r | |
145 | \r | |
146 | /**\r | |
147 | Returns the pointer to the buffer of the token specified by TokenNumber.\r | |
148 | \r | |
149 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
150 | \r | |
151 | @retval VOID* Returns the pointer to the token specified by TokenNumber.\r | |
152 | \r | |
153 | **/\r | |
154 | VOID *\r | |
155 | EFIAPI\r | |
156 | LibPcdGetPtr (\r | |
157 | IN UINTN TokenNumber\r | |
158 | )\r | |
159 | {\r | |
160 | return mPcd->GetPtr (TokenNumber);\r | |
161 | }\r | |
162 | \r | |
163 | \r | |
164 | \r | |
165 | /**\r | |
166 | Returns the Boolean value of the token specified by TokenNumber. \r | |
167 | \r | |
168 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
169 | \r | |
170 | @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber. \r | |
171 | \r | |
172 | **/\r | |
173 | BOOLEAN \r | |
174 | EFIAPI\r | |
175 | LibPcdGetBool (\r | |
176 | IN UINTN TokenNumber\r | |
177 | )\r | |
178 | {\r | |
179 | return mPcd->GetBool (TokenNumber);\r | |
180 | }\r | |
181 | \r | |
182 | \r | |
183 | \r | |
184 | /**\r | |
185 | Returns the size of the token specified by TokenNumber. \r | |
186 | \r | |
187 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
188 | \r | |
189 | @retval UINTN Returns the size of the token specified by TokenNumber. \r | |
190 | \r | |
191 | **/\r | |
192 | UINTN\r | |
193 | EFIAPI\r | |
194 | LibPcdGetSize (\r | |
195 | IN UINTN TokenNumber\r | |
196 | )\r | |
197 | {\r | |
198 | return mPcd->GetSize (TokenNumber);\r | |
199 | }\r | |
200 | \r | |
201 | \r | |
202 | \r | |
203 | /**\r | |
204 | Returns the 8-bit value for the token specified by TokenNumber and Guid.\r | |
205 | If Guid is NULL, then ASSERT(). \r | |
206 | \r | |
207 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
208 | which namespace to retrieve a value from.\r | |
209 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
210 | \r | |
211 | @retval UINT8 Return the UINT8.\r | |
212 | \r | |
213 | **/\r | |
214 | UINT8\r | |
215 | EFIAPI\r | |
216 | LibPcdGetEx8 (\r | |
217 | IN CONST GUID *Guid,\r | |
218 | IN UINTN TokenNumber\r | |
219 | )\r | |
220 | {\r | |
221 | ASSERT (Guid != NULL);\r | |
222 | \r | |
223 | return mPcd->Get8Ex (Guid, TokenNumber);\r | |
224 | }\r | |
225 | \r | |
226 | \r | |
227 | /**\r | |
228 | Returns the 16-bit value for the token specified by TokenNumber and Guid.\r | |
229 | If Guid is NULL, then ASSERT(). \r | |
230 | \r | |
231 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
232 | which namespace to retrieve a value from.\r | |
233 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
234 | \r | |
235 | @retval UINT16 Return the UINT16.\r | |
236 | \r | |
237 | **/\r | |
238 | UINT16\r | |
239 | EFIAPI\r | |
240 | LibPcdGetEx16 (\r | |
241 | IN CONST GUID *Guid,\r | |
242 | IN UINTN TokenNumber\r | |
243 | )\r | |
244 | {\r | |
245 | ASSERT (Guid != NULL);\r | |
246 | \r | |
247 | return mPcd->Get16Ex (Guid, TokenNumber);\r | |
248 | }\r | |
249 | \r | |
250 | \r | |
251 | /**\r | |
252 | Returns the 32-bit value for the token specified by TokenNumber and Guid.\r | |
253 | If Guid is NULL, then ASSERT(). \r | |
254 | \r | |
255 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
256 | which namespace to retrieve a value from.\r | |
257 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
258 | \r | |
259 | @retval UINT32 Return the UINT32.\r | |
260 | \r | |
261 | **/\r | |
262 | UINT32\r | |
263 | EFIAPI\r | |
264 | LibPcdGetEx32 (\r | |
265 | IN CONST GUID *Guid,\r | |
266 | IN UINTN TokenNumber\r | |
267 | )\r | |
268 | {\r | |
269 | ASSERT (Guid != NULL);\r | |
270 | \r | |
271 | return mPcd->Get32Ex (Guid, TokenNumber);\r | |
272 | }\r | |
273 | \r | |
274 | \r | |
275 | \r | |
276 | /**\r | |
277 | Returns the 64-bit value for the token specified by TokenNumber and Guid.\r | |
278 | If Guid is NULL, then ASSERT(). \r | |
279 | \r | |
280 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
281 | which namespace to retrieve a value from.\r | |
282 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
283 | \r | |
284 | @retval UINT64 Return the UINT64.\r | |
285 | \r | |
286 | **/\r | |
287 | UINT64\r | |
288 | EFIAPI\r | |
289 | LibPcdGetEx64 (\r | |
290 | IN CONST GUID *Guid,\r | |
291 | IN UINTN TokenNumber\r | |
292 | )\r | |
293 | {\r | |
294 | ASSERT (Guid != NULL);\r | |
295 | \r | |
296 | return mPcd->Get64Ex (Guid, TokenNumber);\r | |
297 | }\r | |
298 | \r | |
299 | \r | |
300 | \r | |
301 | /**\r | |
302 | Returns the pointer to the token specified by TokenNumber and Guid.\r | |
303 | If Guid is NULL, then ASSERT(). \r | |
304 | \r | |
305 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
306 | which namespace to retrieve a value from.\r | |
307 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
308 | \r | |
309 | @retval VOID* Return the VOID* pointer.\r | |
310 | \r | |
311 | **/\r | |
312 | VOID *\r | |
313 | EFIAPI\r | |
314 | LibPcdGetExPtr (\r | |
315 | IN CONST GUID *Guid,\r | |
316 | IN UINTN TokenNumber\r | |
317 | )\r | |
318 | {\r | |
319 | ASSERT (Guid != NULL);\r | |
320 | \r | |
321 | return mPcd->GetPtrEx (Guid, TokenNumber);\r | |
322 | }\r | |
323 | \r | |
324 | \r | |
325 | \r | |
326 | /**\r | |
327 | Returns the Boolean value of the token specified by TokenNumber and Guid. \r | |
328 | If Guid is NULL, then ASSERT(). \r | |
329 | \r | |
330 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
331 | which namespace to retrieve a value from.\r | |
332 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
333 | \r | |
334 | @retval BOOLEAN Return the BOOLEAN.\r | |
335 | \r | |
336 | **/\r | |
337 | BOOLEAN\r | |
338 | EFIAPI\r | |
339 | LibPcdGetExBool (\r | |
340 | IN CONST GUID *Guid,\r | |
341 | IN UINTN TokenNumber\r | |
342 | )\r | |
343 | {\r | |
344 | ASSERT (Guid != NULL);\r | |
345 | \r | |
346 | return mPcd->GetBoolEx (Guid, TokenNumber);\r | |
347 | }\r | |
348 | \r | |
349 | \r | |
350 | \r | |
351 | /**\r | |
352 | Returns the size of the token specified by TokenNumber and Guid. \r | |
353 | If Guid is NULL, then ASSERT(). \r | |
354 | \r | |
355 | @param[in] Guid Pointer to a 128-bit unique value that designates \r | |
356 | which namespace to retrieve a value from.\r | |
357 | @param[in] TokenNumber The PCD token number to retrieve a current value for.\r | |
358 | \r | |
359 | @retval UINTN Return the size.\r | |
360 | \r | |
361 | **/\r | |
362 | UINTN\r | |
363 | EFIAPI\r | |
364 | LibPcdGetExSize (\r | |
365 | IN CONST GUID *Guid,\r | |
366 | IN UINTN TokenNumber\r | |
367 | )\r | |
368 | {\r | |
369 | ASSERT (Guid != NULL);\r | |
370 | \r | |
371 | return mPcd->GetSizeEx (Guid, TokenNumber);\r | |
372 | }\r | |
373 | \r | |
374 | \r | |
375 | \r | |
376 | /**\r | |
377 | Sets the 8-bit value for the token specified by TokenNumber \r | |
378 | to the value specified by Value. Value is returned.\r | |
379 | \r | |
380 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
381 | @param[in] Value The 8-bit value to set.\r | |
382 | \r | |
383 | @retval UINT8 Return the value been set.\r | |
384 | \r | |
385 | **/\r | |
386 | UINT8\r | |
387 | EFIAPI\r | |
388 | LibPcdSet8 (\r | |
389 | IN UINTN TokenNumber,\r | |
390 | IN UINT8 Value\r | |
391 | )\r | |
392 | {\r | |
393 | EFI_STATUS Status;\r | |
394 | \r | |
395 | Status = mPcd->Set8 (TokenNumber, Value);\r | |
396 | \r | |
397 | ASSERT_EFI_ERROR (Status);\r | |
398 | \r | |
399 | return Value;\r | |
400 | }\r | |
401 | \r | |
402 | \r | |
403 | \r | |
404 | /**\r | |
405 | Sets the 16-bit value for the token specified by TokenNumber \r | |
406 | to the value specified by Value. Value is returned.\r | |
407 | \r | |
408 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
409 | @param[in] Value The 16-bit value to set.\r | |
410 | \r | |
411 | @retval UINT16 Return the value been set.\r | |
412 | \r | |
413 | **/\r | |
414 | UINT16\r | |
415 | EFIAPI\r | |
416 | LibPcdSet16 (\r | |
417 | IN UINTN TokenNumber,\r | |
418 | IN UINT16 Value\r | |
419 | )\r | |
420 | {\r | |
421 | EFI_STATUS Status;\r | |
422 | \r | |
423 | Status = mPcd->Set16 (TokenNumber, Value);\r | |
424 | \r | |
425 | ASSERT_EFI_ERROR (Status);\r | |
426 | \r | |
427 | return Value;\r | |
428 | }\r | |
429 | \r | |
430 | \r | |
431 | \r | |
432 | /**\r | |
433 | Sets the 32-bit value for the token specified by TokenNumber \r | |
434 | to the value specified by Value. Value is returned.\r | |
435 | \r | |
436 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
437 | @param[in] Value The 32-bit value to set.\r | |
438 | \r | |
439 | @retval UINT32 Return the value been set.\r | |
440 | \r | |
441 | **/\r | |
442 | UINT32\r | |
443 | EFIAPI\r | |
444 | LibPcdSet32 (\r | |
445 | IN UINTN TokenNumber,\r | |
446 | IN UINT32 Value\r | |
447 | )\r | |
448 | {\r | |
449 | EFI_STATUS Status;\r | |
450 | Status = mPcd->Set32 (TokenNumber, Value);\r | |
451 | \r | |
452 | ASSERT_EFI_ERROR (Status);\r | |
453 | \r | |
454 | return Value;\r | |
455 | }\r | |
456 | \r | |
457 | \r | |
458 | \r | |
459 | /**\r | |
460 | Sets the 64-bit value for the token specified by TokenNumber \r | |
461 | to the value specified by Value. Value is returned.\r | |
462 | \r | |
463 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
464 | @param[in] Value The 64-bit value to set.\r | |
465 | \r | |
466 | @retval UINT64 Return the value been set.\r | |
467 | \r | |
468 | **/\r | |
469 | UINT64\r | |
470 | EFIAPI\r | |
471 | LibPcdSet64 (\r | |
472 | IN UINTN TokenNumber,\r | |
473 | IN UINT64 Value\r | |
474 | )\r | |
475 | {\r | |
476 | EFI_STATUS Status;\r | |
477 | \r | |
478 | Status = mPcd->Set64 (TokenNumber, Value);\r | |
479 | \r | |
480 | ASSERT_EFI_ERROR (Status);\r | |
481 | \r | |
482 | return Value;\r | |
483 | }\r | |
484 | \r | |
485 | \r | |
486 | \r | |
487 | /**\r | |
488 | Sets a buffer for the token specified by TokenNumber to \r | |
489 | the value specified by Value. Value is returned.\r | |
490 | If Value is NULL, then ASSERT().\r | |
491 | \r | |
492 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
493 | @param[in] Value A pointer to the buffer to set.\r | |
494 | \r | |
495 | @retval VOID* Return the pointer for the buffer been set.\r | |
496 | \r | |
497 | **/\r | |
498 | VOID *\r | |
499 | EFIAPI\r | |
500 | LibPcdSetPtr (\r | |
501 | IN UINTN TokenNumber,\r | |
502 | IN CONST VOID *Value\r | |
503 | )\r | |
504 | {\r | |
505 | EFI_STATUS Status;\r | |
506 | \r | |
507 | ASSERT (Value != NULL);\r | |
508 | \r | |
509 | Status = mPcd->SetPtr (TokenNumber, Value);\r | |
510 | \r | |
511 | ASSERT_EFI_ERROR (Status);\r | |
512 | \r | |
513 | return (VOID *)Value;\r | |
514 | }\r | |
515 | \r | |
516 | \r | |
517 | \r | |
518 | /**\r | |
519 | Sets the Boolean value for the token specified by TokenNumber \r | |
520 | to the value specified by Value. Value is returned.\r | |
521 | \r | |
522 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
523 | @param[in] Value The boolean value to set.\r | |
524 | \r | |
525 | @retval BOOLEAN Return the value been set.\r | |
526 | \r | |
527 | **/\r | |
528 | BOOLEAN\r | |
529 | EFIAPI\r | |
530 | LibPcdSetBool (\r | |
531 | IN UINTN TokenNumber,\r | |
532 | IN BOOLEAN Value\r | |
533 | )\r | |
534 | {\r | |
535 | EFI_STATUS Status;\r | |
536 | \r | |
537 | Status = mPcd->SetBool (TokenNumber, Value);\r | |
538 | \r | |
539 | ASSERT_EFI_ERROR (Status);\r | |
540 | \r | |
541 | return Value;\r | |
542 | }\r | |
543 | \r | |
544 | \r | |
545 | \r | |
546 | /**\r | |
547 | Sets the 8-bit value for the token specified by TokenNumber and \r | |
548 | Guid to the value specified by Value. Value is returned.\r | |
549 | If Guid is NULL, then ASSERT().\r | |
550 | \r | |
551 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
552 | designates which namespace to set a value from.\r | |
553 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
554 | @param[in] Value The 8-bit value to set.\r | |
555 | \r | |
556 | @retval UINT8 Return the value been set.\r | |
557 | \r | |
558 | **/\r | |
559 | UINT8\r | |
560 | EFIAPI\r | |
561 | LibPcdSetEx8 (\r | |
562 | IN CONST GUID *Guid,\r | |
563 | IN UINTN TokenNumber,\r | |
564 | IN UINT8 Value\r | |
565 | )\r | |
566 | {\r | |
567 | EFI_STATUS Status;\r | |
568 | \r | |
569 | ASSERT (Guid != NULL);\r | |
570 | \r | |
571 | Status = mPcd->Set8Ex (Guid, TokenNumber, Value);\r | |
572 | \r | |
573 | ASSERT_EFI_ERROR (Status);\r | |
574 | \r | |
575 | return Value;\r | |
576 | }\r | |
577 | \r | |
578 | \r | |
579 | \r | |
580 | /**\r | |
581 | Sets the 16-bit value for the token specified by TokenNumber and \r | |
582 | Guid to the value specified by Value. Value is returned.\r | |
583 | If Guid is NULL, then ASSERT().\r | |
584 | \r | |
585 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
586 | designates which namespace to set a value from.\r | |
587 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
588 | @param[in] Value The 16-bit value to set.\r | |
589 | \r | |
590 | @retval UINT8 Return the value been set.\r | |
591 | \r | |
592 | **/\r | |
593 | UINT16\r | |
594 | EFIAPI\r | |
595 | LibPcdSetEx16 (\r | |
596 | IN CONST GUID *Guid,\r | |
597 | IN UINTN TokenNumber,\r | |
598 | IN UINT16 Value\r | |
599 | )\r | |
600 | {\r | |
601 | EFI_STATUS Status;\r | |
602 | \r | |
603 | ASSERT (Guid != NULL);\r | |
604 | \r | |
605 | Status = mPcd->Set16Ex (Guid, TokenNumber, Value);\r | |
606 | \r | |
607 | ASSERT_EFI_ERROR (Status);\r | |
608 | \r | |
609 | return Value;\r | |
610 | }\r | |
611 | \r | |
612 | \r | |
613 | \r | |
614 | /**\r | |
615 | Sets the 32-bit value for the token specified by TokenNumber and \r | |
616 | Guid to the value specified by Value. Value is returned.\r | |
617 | If Guid is NULL, then ASSERT().\r | |
618 | \r | |
619 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
620 | designates which namespace to set a value from.\r | |
621 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
622 | @param[in] Value The 32-bit value to set.\r | |
623 | \r | |
624 | @retval UINT32 Return the value been set.\r | |
625 | \r | |
626 | **/\r | |
627 | UINT32\r | |
628 | EFIAPI\r | |
629 | LibPcdSetEx32 (\r | |
630 | IN CONST GUID *Guid,\r | |
631 | IN UINTN TokenNumber,\r | |
632 | IN UINT32 Value\r | |
633 | )\r | |
634 | {\r | |
635 | EFI_STATUS Status;\r | |
636 | \r | |
637 | ASSERT (Guid != NULL);\r | |
638 | \r | |
639 | Status = mPcd->Set32Ex (Guid, TokenNumber, Value);\r | |
640 | \r | |
641 | ASSERT_EFI_ERROR (Status);\r | |
642 | \r | |
643 | return Value;\r | |
644 | }\r | |
645 | \r | |
646 | \r | |
647 | \r | |
648 | /**\r | |
649 | Sets the 64-bit value for the token specified by TokenNumber and \r | |
650 | Guid to the value specified by Value. Value is returned.\r | |
651 | If Guid is NULL, then ASSERT().\r | |
652 | \r | |
653 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
654 | designates which namespace to set a value from.\r | |
655 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
656 | @param[in] Value The 64-bit value to set.\r | |
657 | \r | |
658 | @retval UINT64 Return the value been set.\r | |
659 | \r | |
660 | **/\r | |
661 | UINT64\r | |
662 | EFIAPI\r | |
663 | LibPcdSetEx64 (\r | |
664 | IN CONST GUID *Guid,\r | |
665 | IN UINTN TokenNumber,\r | |
666 | IN UINT64 Value\r | |
667 | )\r | |
668 | {\r | |
669 | EFI_STATUS Status;\r | |
670 | \r | |
671 | ASSERT (Guid != NULL);\r | |
672 | \r | |
673 | Status = mPcd->Set64Ex (Guid, TokenNumber, Value);\r | |
674 | \r | |
675 | ASSERT_EFI_ERROR (Status);\r | |
676 | \r | |
677 | return Value;\r | |
678 | }\r | |
679 | \r | |
680 | \r | |
681 | \r | |
682 | /**\r | |
683 | Sets a buffer for the token specified by TokenNumber and \r | |
684 | Guid to the value specified by Value. Value is returned.\r | |
685 | If Guid is NULL, then ASSERT().\r | |
686 | If Value is NULL, then ASSERT().\r | |
687 | \r | |
688 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
689 | designates which namespace to set a value from.\r | |
690 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
691 | @param[in] Value The 8-bit value to set.\r | |
692 | \r | |
693 | @retval VOID * Return the value been set.\r | |
694 | \r | |
695 | **/\r | |
696 | VOID *\r | |
697 | EFIAPI\r | |
698 | LibPcdSetExPtr (\r | |
699 | IN CONST GUID *Guid,\r | |
700 | IN UINTN TokenNumber,\r | |
701 | IN CONST VOID *Value\r | |
702 | )\r | |
703 | {\r | |
704 | EFI_STATUS Status;\r | |
705 | \r | |
706 | ASSERT (Guid != NULL);\r | |
707 | ASSERT (Value != NULL);\r | |
708 | \r | |
709 | Status = mPcd->SetPtrEx (Guid, TokenNumber, Value);\r | |
710 | \r | |
711 | ASSERT_EFI_ERROR (Status);\r | |
712 | \r | |
713 | return (VOID *)Value;\r | |
714 | }\r | |
715 | \r | |
716 | \r | |
717 | \r | |
718 | /**\r | |
719 | Sets the Boolean value for the token specified by TokenNumber and \r | |
720 | Guid to the value specified by Value. Value is returned.\r | |
721 | If Guid is NULL, then ASSERT().\r | |
722 | \r | |
723 | @param[in] Guid Pointer to a 128-bit unique value that \r | |
724 | designates which namespace to set a value from.\r | |
725 | @param[in] TokenNumber The PCD token number to set a current value for.\r | |
726 | @param[in] Value The Boolean value to set.\r | |
727 | \r | |
728 | @retval Boolean Return the value been set.\r | |
729 | \r | |
730 | **/\r | |
731 | BOOLEAN\r | |
732 | EFIAPI\r | |
733 | LibPcdSetExBool (\r | |
734 | IN CONST GUID *Guid,\r | |
735 | IN UINTN TokenNumber,\r | |
736 | IN BOOLEAN Value\r | |
737 | )\r | |
738 | {\r | |
739 | EFI_STATUS Status;\r | |
740 | \r | |
741 | ASSERT (Guid != NULL);\r | |
742 | \r | |
743 | Status = mPcd->SetBoolEx (Guid, TokenNumber, Value);\r | |
744 | \r | |
745 | ASSERT_EFI_ERROR (Status);\r | |
746 | \r | |
747 | return Value;\r | |
748 | }\r | |
749 | \r | |
750 | \r | |
751 | \r | |
752 | /**\r | |
753 | When the token specified by TokenNumber and Guid is set, \r | |
754 | then notification function specified by NotificationFunction is called. \r | |
755 | If Guid is NULL, then the default token space is used. \r | |
756 | If NotificationFunction is NULL, then ASSERT().\r | |
757 | \r | |
758 | @param[in] Guid Pointer to a 128-bit unique value that designates which \r | |
759 | namespace to set a value from. If NULL, then the default \r | |
760 | token space is used.\r | |
761 | @param[in] TokenNumber The PCD token number to monitor.\r | |
762 | @param[in] NotificationFunction The function to call when the token \r | |
763 | specified by Guid and TokenNumber is set.\r | |
764 | \r | |
765 | @retval VOID\r | |
766 | \r | |
767 | **/\r | |
768 | VOID\r | |
769 | EFIAPI\r | |
770 | LibPcdCallbackOnSet (\r | |
771 | IN CONST GUID *Guid, OPTIONAL\r | |
772 | IN UINTN TokenNumber,\r | |
773 | IN PCD_CALLBACK NotificationFunction\r | |
774 | )\r | |
775 | {\r | |
776 | EFI_STATUS Status;\r | |
777 | \r | |
778 | ASSERT (NotificationFunction != NULL);\r | |
779 | \r | |
780 | Status = mPcd->CallbackOnSet (TokenNumber, Guid, NotificationFunction);\r | |
781 | \r | |
782 | ASSERT_EFI_ERROR (Status);\r | |
783 | \r | |
784 | return;\r | |
785 | }\r | |
786 | \r | |
787 | \r | |
788 | \r | |
789 | /**\r | |
790 | Disable a notification function that was established with LibPcdCallbackonSet().\r | |
791 | If NotificationFunction is NULL, then ASSERT().\r | |
792 | \r | |
793 | @param[in] Guid Specify the GUID token space.\r | |
794 | @param[in] TokenNumber Specify the token number.\r | |
795 | @param[in] NotificationFunction The callback function to be unregistered.\r | |
796 | \r | |
797 | @retval VOID\r | |
798 | \r | |
799 | **/\r | |
800 | VOID\r | |
801 | EFIAPI\r | |
802 | LibPcdCancelCallback (\r | |
803 | IN CONST GUID *Guid, OPTIONAL\r | |
804 | IN UINTN TokenNumber,\r | |
805 | IN PCD_CALLBACK NotificationFunction\r | |
806 | )\r | |
807 | {\r | |
808 | EFI_STATUS Status;\r | |
809 | \r | |
810 | ASSERT (NotificationFunction != NULL);\r | |
811 | \r | |
812 | Status = mPcd->CancelCallback (TokenNumber, Guid, NotificationFunction);\r | |
813 | \r | |
814 | ASSERT_EFI_ERROR (Status);\r | |
815 | \r | |
816 | return;\r | |
817 | }\r | |
818 | \r | |
819 | \r | |
820 | \r | |
821 | /**\r | |
822 | Retrieves the next PCD token number from the token space specified by Guid. \r | |
823 | If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r | |
824 | then the first token number is returned. Otherwise, the token number that \r | |
825 | follows TokenNumber in the token space is returned. If TokenNumber is the last \r | |
826 | token number in the token space, then 0 is returned. If TokenNumber is not 0 and \r | |
827 | is not in the token space specified by Guid, then ASSERT().\r | |
828 | \r | |
829 | @param[in] Pointer to a 128-bit unique value that designates which namespace \r | |
830 | to set a value from. If NULL, then the default token space is used.\r | |
831 | @param[in] The previous PCD token number. If 0, then retrieves the first PCD \r | |
832 | token number.\r | |
833 | \r | |
834 | @retval UINTN The next valid token number.\r | |
835 | \r | |
836 | **/\r | |
837 | UINTN \r | |
838 | EFIAPI\r | |
839 | LibPcdGetNextToken (\r | |
840 | IN CONST GUID *Guid, OPTIONAL\r | |
841 | IN OUT UINTN *TokenNumber\r | |
842 | )\r | |
843 | {\r | |
844 | EFI_STATUS Status;\r | |
845 | \r | |
846 | Status = mPcd->GetNextToken (Guid, TokenNumber);\r | |
847 | \r | |
848 | ASSERT_EFI_ERROR (Status);\r | |
849 | \r | |
850 | return (*TokenNumber);\r | |
851 | }\r | |
852 | \r |