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