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