]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BasePcdLibNull/PcdLib.c
Make sure the PCD dxe service driver can handle the case where no PEIM is using any...
[mirror_edk2.git] / MdePkg / Library / BasePcdLibNull / PcdLib.c
1 /** @file
2 A emptry template implementation of PCD Library.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: PcdLib.c
14
15 **/
16
17
18
19 /**
20 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
21
22 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
23 set values associated with a PCD token.
24
25 @retval SKU_ID Return the SKU ID that just be set.
26
27 **/
28 SKU_ID
29 EFIAPI
30 LibPcdSetSku (
31 IN SKU_ID SkuId
32 )
33 {
34 return SkuId;
35 }
36
37
38
39 /**
40 Returns the 8-bit value for the token specified by TokenNumber.
41
42 @param[in] The PCD token number to retrieve a current value for.
43
44 @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber.
45
46 **/
47 UINT8
48 EFIAPI
49 LibPcdGet8 (
50 IN PCD_TOKEN_NUMBER TokenNumber
51 )
52 {
53 return 0;
54 }
55
56
57
58 /**
59 Returns the 16-bit value for the token specified by TokenNumber.
60
61 @param[in] The PCD token number to retrieve a current value for.
62
63 @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber.
64
65 **/
66 UINT16
67 EFIAPI
68 LibPcdGet16 (
69 IN PCD_TOKEN_NUMBER TokenNumber
70 )
71 {
72 return 0;
73 }
74
75
76
77 /**
78 Returns the 32-bit value for the token specified by TokenNumber.
79
80 @param[in] TokenNumber The PCD token number to retrieve a current value for.
81
82 @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.
83
84 **/
85 UINT32
86 EFIAPI
87 LibPcdGet32 (
88 IN PCD_TOKEN_NUMBER TokenNumber
89 )
90 {
91 return 0;
92 }
93
94
95
96 /**
97 Returns the 64-bit value for the token specified by TokenNumber.
98
99 @param[in] TokenNumber The PCD token number to retrieve a current value for.
100
101 @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.
102
103 **/
104 UINT64
105 EFIAPI
106 LibPcdGet64 (
107 IN PCD_TOKEN_NUMBER TokenNumber
108 )
109 {
110 return 0;
111 }
112
113
114
115 /**
116 Returns the pointer to the buffer of the token specified by TokenNumber.
117
118 @param[in] TokenNumber The PCD token number to retrieve a current value for.
119
120 @retval VOID* Returns the pointer to the token specified by TokenNumber.
121
122 **/
123 VOID *
124 EFIAPI
125 LibPcdGetPtr (
126 IN PCD_TOKEN_NUMBER TokenNumber
127 )
128 {
129 return 0;
130 }
131
132
133
134 /**
135 Returns the Boolean value of the token specified by TokenNumber.
136
137 @param[in] TokenNumber The PCD token number to retrieve a current value for.
138
139 @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber.
140
141 **/
142 BOOLEAN
143 EFIAPI
144 LibPcdGetBool (
145 IN PCD_TOKEN_NUMBER TokenNumber
146 )
147 {
148 return 0;
149 }
150
151
152
153 /**
154 Returns the size of the token specified by TokenNumber.
155
156 @param[in] TokenNumber The PCD token number to retrieve a current value for.
157
158 @retval UINTN Returns the size of the token specified by TokenNumber.
159
160 **/
161 UINTN
162 EFIAPI
163 LibPcdGetSize (
164 IN PCD_TOKEN_NUMBER TokenNumber
165 )
166 {
167 return 0;
168 }
169
170
171
172 /**
173 Returns the 8-bit value for the token specified by TokenNumber and Guid.
174 If Guid is NULL, then ASSERT().
175
176 @param[in] Guid Pointer to a 128-bit unique value that designates
177 which namespace to retrieve a value from.
178 @param[in] TokenNumber The PCD token number to retrieve a current value for.
179
180 @retval UINT8 Return the UINT8.
181
182 **/
183 UINT8
184 EFIAPI
185 LibPcdGetEx8 (
186 IN CONST GUID *Guid,
187 IN PCD_TOKEN_NUMBER TokenNumber
188 )
189 {
190 ASSERT (Guid != NULL);
191
192 return 0;
193 }
194
195
196
197 /**
198 Returns the 16-bit value for the token specified by TokenNumber and Guid.
199 If Guid is NULL, then ASSERT().
200
201 @param[in] Guid Pointer to a 128-bit unique value that designates
202 which namespace to retrieve a value from.
203 @param[in] TokenNumber The PCD token number to retrieve a current value for.
204
205 @retval UINT16 Return the UINT16.
206
207 **/
208 UINT16
209 EFIAPI
210 LibPcdGetEx16 (
211 IN CONST GUID *Guid,
212 IN PCD_TOKEN_NUMBER TokenNumber
213 )
214 {
215 ASSERT (Guid != NULL);
216
217 return 0;
218 }
219
220
221
222 /**
223 Returns the 32-bit value for the token specified by TokenNumber and Guid.
224 If Guid is NULL, then ASSERT().
225
226 @param[in] Guid Pointer to a 128-bit unique value that designates
227 which namespace to retrieve a value from.
228 @param[in] TokenNumber The PCD token number to retrieve a current value for.
229
230 @retval UINT32 Return the UINT32.
231
232 **/
233 UINT32
234 EFIAPI
235 LibPcdGetEx32 (
236 IN CONST GUID *Guid,
237 IN PCD_TOKEN_NUMBER TokenNumber
238 )
239 {
240 ASSERT (Guid != NULL);
241
242 return 0;
243 }
244
245
246
247 /**
248 Returns the 64-bit value for the token specified by TokenNumber and Guid.
249 If Guid is NULL, then ASSERT().
250
251 @param[in] Guid Pointer to a 128-bit unique value that designates
252 which namespace to retrieve a value from.
253 @param[in] TokenNumber The PCD token number to retrieve a current value for.
254
255 @retval UINT64 Return the UINT64.
256
257 **/
258 UINT64
259 EFIAPI
260 LibPcdGetEx64 (
261 IN CONST GUID *Guid,
262 IN PCD_TOKEN_NUMBER TokenNumber
263 )
264 {
265 ASSERT (Guid != NULL);
266
267 return 0;
268 }
269
270
271
272 /**
273 Returns the pointer to the buffer of the token specified by TokenNumber and Guid.
274 If Guid is NULL, then ASSERT().
275
276 @param[in] Guid Pointer to a 128-bit unique value that designates
277 which namespace to retrieve a value from.
278 @param[in] TokenNumber The PCD token number to retrieve a current value for.
279
280 @retval VOID* Return the VOID* pointer.
281
282 **/
283 VOID *
284 EFIAPI
285 LibPcdGetExPtr (
286 IN CONST GUID *Guid,
287 IN PCD_TOKEN_NUMBER TokenNumber
288 )
289 {
290 ASSERT (Guid != NULL);
291
292 return 0;
293 }
294
295
296
297 /**
298 Returns the Boolean value of the token specified by TokenNumber and Guid.
299 If Guid is NULL, then ASSERT().
300
301 @param[in] Guid Pointer to a 128-bit unique value that designates
302 which namespace to retrieve a value from.
303 @param[in] TokenNumber The PCD token number to retrieve a current value for.
304
305 @retval BOOLEAN Return the BOOLEAN.
306
307 **/
308 BOOLEAN
309 EFIAPI
310 LibPcdGetExBool (
311 IN CONST GUID *Guid,
312 IN PCD_TOKEN_NUMBER TokenNumber
313 )
314 {
315 ASSERT (Guid != NULL);
316
317 return 0;
318 }
319
320
321
322 /**
323 Returns the size of the token specified by TokenNumber and Guid.
324 If Guid is NULL, then ASSERT().
325
326 @param[in] Guid Pointer to a 128-bit unique value that designates
327 which namespace to retrieve a value from.
328 @param[in] TokenNumber The PCD token number to retrieve a current value for.
329
330 @retval UINTN Return the size.
331
332 **/
333 UINTN
334 EFIAPI
335 LibPcdGetExSize (
336 IN CONST GUID *Guid,
337 IN PCD_TOKEN_NUMBER TokenNumber
338 )
339 {
340 ASSERT (Guid != NULL);
341
342 return 0;
343 }
344
345
346
347 /**
348 Sets the 8-bit value for the token specified by TokenNumber
349 to the value specified by Value. Value is returned.
350
351 @param[in] TokenNumber The PCD token number to set a current value for.
352 @param[in] Value The 8-bit value to set.
353
354 @retval UINT8 Return the value been set.
355
356 **/
357 UINT8
358 EFIAPI
359 LibPcdSet8 (
360 IN PCD_TOKEN_NUMBER TokenNumber,
361 IN UINT8 Value
362 )
363 {
364 return Value;
365 }
366
367
368
369 /**
370 Sets the 16-bit value for the token specified by TokenNumber
371 to the value specified by Value. Value is returned.
372
373 @param[in] TokenNumber The PCD token number to set a current value for.
374 @param[in] Value The 16-bit value to set.
375
376 @retval UINT16 Return the value been set.
377
378 **/
379 UINT16
380 EFIAPI
381 LibPcdSet16 (
382 IN PCD_TOKEN_NUMBER TokenNumber,
383 IN UINT16 Value
384 )
385 {
386 return Value;
387 }
388
389
390
391 /**
392 Sets the 32-bit value for the token specified by TokenNumber
393 to the value specified by Value. Value is returned.
394
395 @param[in] TokenNumber The PCD token number to set a current value for.
396 @param[in] Value The 32-bit value to set.
397
398 @retval UINT32 Return the value been set.
399
400 **/
401 UINT32
402 EFIAPI
403 LibPcdSet32 (
404 IN PCD_TOKEN_NUMBER TokenNumber,
405 IN UINT32 Value
406 )
407 {
408 return Value;
409 }
410
411
412
413 /**
414 Sets the 64-bit value for the token specified by TokenNumber
415 to the value specified by Value. Value is returned.
416
417 @param[in] TokenNumber The PCD token number to set a current value for.
418 @param[in] Value The 64-bit value to set.
419
420 @retval UINT64 Return the value been set.
421
422 **/
423 UINT64
424 EFIAPI
425 LibPcdSet64 (
426 IN PCD_TOKEN_NUMBER TokenNumber,
427 IN UINT64 Value
428 )
429 {
430 return Value;
431 }
432
433
434
435 /**
436 Sets a buffer for the token specified by TokenNumber to
437 the value specified by Value. Value is returned.
438 If Value is NULL, then ASSERT().
439
440 @param[in] TokenNumber The PCD token number to set a current value for.
441 @param[in] Value A pointer to the buffer to set.
442
443 @retval VOID* Return the pointer for the buffer been set.
444
445 **/
446 VOID *
447 EFIAPI
448 LibPcdSetPtr (
449 IN PCD_TOKEN_NUMBER TokenNumber,
450 IN UINTN SizeOfBuffer,
451 IN VOID *Buffer
452 )
453 {
454 ASSERT (Buffer != NULL);
455
456 return Buffer;
457 }
458
459
460
461 /**
462 Sets the Boolean value for the token specified by TokenNumber
463 to the value specified by Value. Value is returned.
464
465 @param[in] TokenNumber The PCD token number to set a current value for.
466 @param[in] Value The boolean value to set.
467
468 @retval BOOLEAN Return the value been set.
469
470 **/
471 BOOLEAN
472 EFIAPI
473 LibPcdSetBool (
474 IN PCD_TOKEN_NUMBER TokenNumber,
475 IN BOOLEAN Value
476 )
477 {
478 return Value;
479 }
480
481
482
483 /**
484 Sets the 8-bit value for the token specified by TokenNumber and
485 Guid to the value specified by Value. Value is returned.
486 If Guid is NULL, then ASSERT().
487
488 @param[in] Guid Pointer to a 128-bit unique value that
489 designates which namespace to set a value from.
490 @param[in] TokenNumber The PCD token number to set a current value for.
491 @param[in] Value The 8-bit value to set.
492
493 @retval UINT8 Return the value been set.
494
495 **/
496 UINT8
497 EFIAPI
498 LibPcdSetEx8 (
499 IN CONST GUID *Guid,
500 IN PCD_TOKEN_NUMBER TokenNumber,
501 IN UINT8 Value
502 )
503 {
504 ASSERT (Guid != NULL);
505
506 return Value;
507 }
508
509
510
511 /**
512 Sets the 16-bit value for the token specified by TokenNumber and
513 Guid to the value specified by Value. Value is returned.
514 If Guid is NULL, then ASSERT().
515
516 @param[in] Guid Pointer to a 128-bit unique value that
517 designates which namespace to set a value from.
518 @param[in] TokenNumber The PCD token number to set a current value for.
519 @param[in] Value The 16-bit value to set.
520
521 @retval UINT8 Return the value been set.
522
523 **/
524 UINT16
525 EFIAPI
526 LibPcdSetEx16 (
527 IN CONST GUID *Guid,
528 IN PCD_TOKEN_NUMBER TokenNumber,
529 IN UINT16 Value
530 )
531 {
532 ASSERT (Guid != NULL);
533
534 return Value;
535 }
536
537
538
539 /**
540 Sets the 32-bit value for the token specified by TokenNumber and
541 Guid to the value specified by Value. Value is returned.
542 If Guid is NULL, then ASSERT().
543
544 @param[in] Guid Pointer to a 128-bit unique value that
545 designates which namespace to set a value from.
546 @param[in] TokenNumber The PCD token number to set a current value for.
547 @param[in] Value The 32-bit value to set.
548
549 @retval UINT32 Return the value been set.
550
551 **/
552 UINT32
553 EFIAPI
554 LibPcdSetEx32 (
555 IN CONST GUID *Guid,
556 IN PCD_TOKEN_NUMBER TokenNumber,
557 IN UINT32 Value
558 )
559 {
560 ASSERT (Guid != NULL);
561
562 return Value;
563 }
564
565
566
567 /**
568 Sets the 64-bit value for the token specified by TokenNumber and
569 Guid to the value specified by Value. Value is returned.
570 If Guid is NULL, then ASSERT().
571
572 @param[in] Guid Pointer to a 128-bit unique value that
573 designates which namespace to set a value from.
574 @param[in] TokenNumber The PCD token number to set a current value for.
575 @param[in] Value The 64-bit value to set.
576
577 @retval UINT64 Return the value been set.
578
579 **/
580 UINT64
581 EFIAPI
582 LibPcdSetEx64 (
583 IN CONST GUID *Guid,
584 IN PCD_TOKEN_NUMBER TokenNumber,
585 IN UINT64 Value
586 )
587 {
588 ASSERT (Guid != NULL);
589
590 return Value;
591 }
592
593
594
595 /**
596 Sets a buffer for the token specified by TokenNumber and
597 Guid to the value specified by Value. Value is returned.
598 If Guid is NULL, then ASSERT().
599 If Value is NULL, then ASSERT().
600
601 @param[in] Guid Pointer to a 128-bit unique value that
602 designates which namespace to set a value from.
603 @param[in] TokenNumber The PCD token number to set a current value for.
604 @param[in] Value The 8-bit value to set.
605
606 @retval VOID * Return the value been set.
607
608 **/
609 VOID *
610 EFIAPI
611 LibPcdSetExPtr (
612 IN CONST GUID *Guid,
613 IN PCD_TOKEN_NUMBER TokenNumber,
614 IN UINTN SizeOfBuffer,
615 IN VOID *Buffer
616 )
617 {
618 ASSERT (Guid != NULL);
619 ASSERT (Buffer != NULL);
620
621 return Buffer;
622 }
623
624
625
626 /**
627 Sets the Boolean value for the token specified by TokenNumber and
628 Guid to the value specified by Value. Value is returned.
629 If Guid is NULL, then ASSERT().
630
631 @param[in] Guid Pointer to a 128-bit unique value that
632 designates which namespace to set a value from.
633 @param[in] TokenNumber The PCD token number to set a current value for.
634 @param[in] Value The Boolean value to set.
635
636 @retval Boolean Return the value been set.
637
638 **/
639 BOOLEAN
640 EFIAPI
641 LibPcdSetExBool (
642 IN CONST GUID *Guid,
643 IN PCD_TOKEN_NUMBER TokenNumber,
644 IN BOOLEAN Value
645 )
646 {
647 ASSERT (Guid != NULL);
648
649 return Value;
650 }
651
652
653
654 /**
655 When the token specified by TokenNumber and Guid is set,
656 then notification function specified by NotificationFunction is called.
657 If Guid is NULL, then the default token space is used.
658 If NotificationFunction is NULL, then ASSERT().
659
660 @param[in] Guid Pointer to a 128-bit unique value that designates which
661 namespace to set a value from. If NULL, then the default
662 token space is used.
663 @param[in] TokenNumber The PCD token number to monitor.
664 @param[in] NotificationFunction The function to call when the token
665 specified by Guid and TokenNumber is set.
666
667 @retval VOID
668
669 **/
670 VOID
671 EFIAPI
672 LibPcdCallbackOnSet (
673 IN CONST GUID *Guid, OPTIONAL
674 IN PCD_TOKEN_NUMBER TokenNumber,
675 IN PCD_CALLBACK NotificationFunction
676 )
677 {
678 ASSERT (NotificationFunction != NULL);
679 }
680
681
682
683 /**
684 Disable a notification function that was established with LibPcdCallbackonSet().
685 If NotificationFunction is NULL, then ASSERT().
686
687 @param[in] Guid Specify the GUID token space.
688 @param[in] TokenNumber Specify the token number.
689 @param[in] NotificationFunction The callback function to be unregistered.
690
691 @retval VOID
692
693 **/
694 VOID
695 EFIAPI
696 LibPcdCancelCallback (
697 IN CONST GUID *Guid, OPTIONAL
698 IN PCD_TOKEN_NUMBER TokenNumber,
699 IN PCD_CALLBACK NotificationFunction
700 )
701 {
702 ASSERT (NotificationFunction != NULL);
703 }
704
705
706
707 /**
708 Retrieves the next PCD token number from the token space specified by Guid.
709 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
710 then the first token number is returned. Otherwise, the token number that
711 follows TokenNumber in the token space is returned. If TokenNumber is the last
712 token number in the token space, then 0 is returned. If TokenNumber is not 0 and
713 is not in the token space specified by Guid, then ASSERT().
714
715 @param[in] Pointer to a 128-bit unique value that designates which namespace
716 to set a value from. If NULL, then the default token space is used.
717 @param[in] The previous PCD token number. If 0, then retrieves the first PCD
718 token number.
719
720 @retval PCD_TOKEN_NUMBER The next valid token number.
721
722 **/
723 PCD_TOKEN_NUMBER
724 EFIAPI
725 LibPcdGetNextToken (
726 IN CONST GUID *Guid, OPTIONAL
727 IN PCD_TOKEN_NUMBER TokenNumber
728 )
729 {
730 return 0;
731 }