]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BasePcdLibNull/PcdLib.c
7cb3714a89cde6cbb487976f0c5c42d98d42f974
[mirror_edk2.git] / MdePkg / Library / BasePcdLibNull / PcdLib.c
1 /** @file
2 A emptry template implementation of PCD Library.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <Base.h>
10
11 #include <Library/DebugLib.h>
12 #include <Library/PcdLib.h>
13 #include <Library/BaseMemoryLib.h>
14
15
16 /**
17 This function provides a means by which SKU support can be established in the PCD infrastructure.
18
19 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
20
21 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
22 set values associated with a PCD token.
23
24 @return Return the SKU ID that just be set.
25
26 **/
27 UINTN
28 EFIAPI
29 LibPcdSetSku (
30 IN UINTN SkuId
31 )
32 {
33 ASSERT (FALSE);
34
35 return 0;
36 }
37
38 /**
39 This function provides a means by which to retrieve a value for a given PCD token.
40
41 Returns the 8-bit value for the token specified by TokenNumber.
42
43 @param[in] TokenNumber The PCD token number to retrieve a current value for.
44
45 @return Returns the 8-bit value for the token specified by TokenNumber.
46
47 **/
48 UINT8
49 EFIAPI
50 LibPcdGet8 (
51 IN UINTN TokenNumber
52 )
53 {
54 ASSERT (FALSE);
55
56 return 0;
57 }
58
59
60
61 /**
62 This function provides a means by which to retrieve a value for a given PCD token.
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 This function provides a means by which to retrieve a value for a given PCD token.
86
87 Returns the 32-bit value for the token specified by TokenNumber.
88
89 @param[in] TokenNumber The PCD token number to retrieve a current value for.
90
91 @return Returns the 32-bit value for the token specified by TokenNumber.
92
93 **/
94 UINT32
95 EFIAPI
96 LibPcdGet32 (
97 IN UINTN TokenNumber
98 )
99 {
100 ASSERT (FALSE);
101
102 return 0;
103 }
104
105
106
107 /**
108 This function provides a means by which to retrieve a value for a given PCD token.
109
110 Returns the 64-bit value for the token specified by TokenNumber.
111
112 @param[in] TokenNumber The PCD token number to retrieve a current value for.
113
114 @return Returns the 64-bit value for the token specified by TokenNumber.
115
116 **/
117 UINT64
118 EFIAPI
119 LibPcdGet64 (
120 IN UINTN TokenNumber
121 )
122 {
123 ASSERT (FALSE);
124
125 return 0;
126 }
127
128
129
130 /**
131 This function provides a means by which to retrieve a value for a given PCD token.
132
133 Returns the pointer to the buffer of the token specified by TokenNumber.
134
135 @param[in] TokenNumber The PCD token number to retrieve a current value for.
136
137 @return Returns the pointer to the token specified by TokenNumber.
138
139 **/
140 VOID *
141 EFIAPI
142 LibPcdGetPtr (
143 IN UINTN TokenNumber
144 )
145 {
146 ASSERT (FALSE);
147
148 return 0;
149 }
150
151
152
153 /**
154 This function provides a means by which to retrieve a value for a given PCD token.
155
156 Returns the Boolean value of the token specified by TokenNumber.
157
158 @param[in] TokenNumber The PCD token number to retrieve a current value for.
159
160 @return Returns the Boolean value of the token specified by TokenNumber.
161
162 **/
163 BOOLEAN
164 EFIAPI
165 LibPcdGetBool (
166 IN UINTN TokenNumber
167 )
168 {
169 ASSERT (FALSE);
170
171 return 0;
172 }
173
174
175
176 /**
177 This function provides a means by which to retrieve the size of a given PCD token.
178
179 @param[in] TokenNumber The PCD token number to retrieve a current value for.
180
181 @return Returns the size of the token specified by TokenNumber.
182
183 **/
184 UINTN
185 EFIAPI
186 LibPcdGetSize (
187 IN UINTN TokenNumber
188 )
189 {
190 ASSERT (FALSE);
191
192 return 0;
193 }
194
195
196
197 /**
198 This function provides a means by which to retrieve a value for a given PCD token.
199
200 Returns the 8-bit value for the token specified by TokenNumber and Guid.
201
202 If Guid is NULL, then ASSERT().
203
204 @param[in] Guid The pointer to a 128-bit unique value that designates
205 which namespace to retrieve a value from.
206 @param[in] TokenNumber The PCD token number to retrieve a current value for.
207
208 @return Return the UINT8.
209
210 **/
211 UINT8
212 EFIAPI
213 LibPcdGetEx8 (
214 IN CONST GUID *Guid,
215 IN UINTN TokenNumber
216 )
217 {
218 ASSERT (FALSE);
219
220 return 0;
221 }
222
223
224
225 /**
226 This function provides a means by which to retrieve a value for a given PCD token.
227
228 Returns the 16-bit value for the token specified by TokenNumber and Guid.
229
230 If Guid is NULL, then ASSERT().
231
232 @param[in] Guid The pointer to a 128-bit unique value that designates
233 which namespace to retrieve a value from.
234 @param[in] TokenNumber The PCD token number to retrieve a current value for.
235
236 @return Return the UINT16.
237
238 **/
239 UINT16
240 EFIAPI
241 LibPcdGetEx16 (
242 IN CONST GUID *Guid,
243 IN UINTN TokenNumber
244 )
245 {
246 ASSERT (FALSE);
247
248 return 0;
249 }
250
251
252
253 /**
254 Returns the 32-bit value for the token specified by TokenNumber and Guid.
255 If Guid is NULL, then ASSERT().
256
257 @param[in] Guid The pointer to a 128-bit unique value that designates
258 which namespace to retrieve a value from.
259 @param[in] TokenNumber The PCD token number to retrieve a current value for.
260
261 @return Return the UINT32.
262
263 **/
264 UINT32
265 EFIAPI
266 LibPcdGetEx32 (
267 IN CONST GUID *Guid,
268 IN UINTN TokenNumber
269 )
270 {
271 ASSERT (FALSE);
272
273 return 0;
274 }
275
276
277
278 /**
279 This function provides a means by which to retrieve a value for a given PCD token.
280
281 Returns the 64-bit value for the token specified by TokenNumber and Guid.
282
283 If Guid is NULL, then ASSERT().
284
285 @param[in] Guid The pointer to a 128-bit unique value that designates
286 which namespace to retrieve a value from.
287 @param[in] TokenNumber The PCD token number to retrieve a current value for.
288
289 @return Return the UINT64.
290
291 **/
292 UINT64
293 EFIAPI
294 LibPcdGetEx64 (
295 IN CONST GUID *Guid,
296 IN UINTN TokenNumber
297 )
298 {
299 ASSERT (FALSE);
300
301 return 0;
302 }
303
304
305
306 /**
307 This function provides a means by which to retrieve a value for a given PCD token.
308
309 Returns the pointer to the buffer of token specified by TokenNumber and Guid.
310
311 If Guid is NULL, then ASSERT().
312
313 @param[in] Guid The pointer to a 128-bit unique value that designates
314 which namespace to retrieve a value from.
315 @param[in] TokenNumber The PCD token number to retrieve a current value for.
316
317 @return Return the VOID* pointer.
318
319 **/
320 VOID *
321 EFIAPI
322 LibPcdGetExPtr (
323 IN CONST GUID *Guid,
324 IN UINTN TokenNumber
325 )
326 {
327 ASSERT (FALSE);
328
329 return 0;
330 }
331
332
333
334 /**
335 This function provides a means by which to retrieve a value for a given PCD token.
336
337 Returns the Boolean value of the token specified by TokenNumber and Guid.
338
339 If Guid is NULL, then ASSERT().
340
341 @param[in] Guid The pointer to a 128-bit unique value that designates
342 which namespace to retrieve a value from.
343 @param[in] TokenNumber The PCD token number to retrieve a current value for.
344
345 @return Return the BOOLEAN.
346
347 **/
348 BOOLEAN
349 EFIAPI
350 LibPcdGetExBool (
351 IN CONST GUID *Guid,
352 IN UINTN TokenNumber
353 )
354 {
355 ASSERT (FALSE);
356
357 return 0;
358 }
359
360
361
362 /**
363 This function provides a means by which to retrieve the size of a given PCD token.
364
365 Returns the size of the token specified by TokenNumber and Guid.
366
367 If Guid is NULL, then ASSERT().
368
369 @param[in] Guid The pointer to a 128-bit unique value that designates
370 which namespace to retrieve a value from.
371 @param[in] TokenNumber The PCD token number to retrieve a current value for.
372
373 @return Return the size.
374
375 **/
376 UINTN
377 EFIAPI
378 LibPcdGetExSize (
379 IN CONST GUID *Guid,
380 IN UINTN TokenNumber
381 )
382 {
383 ASSERT (FALSE);
384
385 return 0;
386 }
387
388
389 /**
390 This function provides a means by which to set a value for a given PCD token.
391
392 Sets the 8-bit value for the token specified by TokenNumber
393 to the value specified by Value.
394
395 @param[in] TokenNumber The PCD token number to set a current value for.
396 @param[in] Value The 8-bit value to set.
397
398 @return The status of the set operation.
399
400 **/
401 RETURN_STATUS
402 EFIAPI
403 LibPcdSet8S (
404 IN UINTN TokenNumber,
405 IN UINT8 Value
406 )
407 {
408 ASSERT (FALSE);
409
410 return RETURN_INVALID_PARAMETER;
411 }
412
413 /**
414 This function provides a means by which to set a value for a given PCD token.
415
416 Sets the 16-bit value for the token specified by TokenNumber
417 to the value specified by Value.
418
419 @param[in] TokenNumber The PCD token number to set a current value for.
420 @param[in] Value The 16-bit value to set.
421
422 @return The status of the set operation.
423
424 **/
425 RETURN_STATUS
426 EFIAPI
427 LibPcdSet16S (
428 IN UINTN TokenNumber,
429 IN UINT16 Value
430 )
431 {
432 ASSERT (FALSE);
433
434 return RETURN_INVALID_PARAMETER;
435 }
436
437 /**
438 This function provides a means by which to set a value for a given PCD token.
439
440 Sets the 32-bit value for the token specified by TokenNumber
441 to the value specified by Value.
442
443 @param[in] TokenNumber The PCD token number to set a current value for.
444 @param[in] Value The 32-bit value to set.
445
446 @return The status of the set operation.
447
448 **/
449 RETURN_STATUS
450 EFIAPI
451 LibPcdSet32S (
452 IN UINTN TokenNumber,
453 IN UINT32 Value
454 )
455 {
456 ASSERT (FALSE);
457
458 return RETURN_INVALID_PARAMETER;
459 }
460
461 /**
462 This function provides a means by which to set a value for a given PCD token.
463
464 Sets the 64-bit value for the token specified by TokenNumber
465 to the value specified by Value.
466
467 @param[in] TokenNumber The PCD token number to set a current value for.
468 @param[in] Value The 64-bit value to set.
469
470 @return The status of the set operation.
471
472 **/
473 RETURN_STATUS
474 EFIAPI
475 LibPcdSet64S (
476 IN UINTN TokenNumber,
477 IN UINT64 Value
478 )
479 {
480 ASSERT (FALSE);
481
482 return RETURN_INVALID_PARAMETER;
483 }
484
485 /**
486 This function provides a means by which to set a value for a given PCD token.
487
488 Sets a buffer for the token specified by TokenNumber to the value specified
489 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
490 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
491 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
492 was not actually performed.
493
494 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
495 maximum size supported by TokenName and EFI_INVALID_PARAMETER must be returned.
496
497 If SizeOfBuffer is NULL, then ASSERT().
498 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
499
500 @param[in] TokenNumber The PCD token number to set a current value for.
501 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
502 @param[in] Buffer A pointer to the buffer to set.
503
504 @return The status of the set operation.
505
506 **/
507 RETURN_STATUS
508 EFIAPI
509 LibPcdSetPtrS (
510 IN UINTN TokenNumber,
511 IN OUT UINTN *SizeOfBuffer,
512 IN CONST VOID *Buffer
513 )
514 {
515 ASSERT (FALSE);
516
517 return RETURN_INVALID_PARAMETER;
518 }
519
520 /**
521 This function provides a means by which to set a value for a given PCD token.
522
523 Sets the boolean value for the token specified by TokenNumber
524 to the value specified by Value.
525
526 @param[in] TokenNumber The PCD token number to set a current value for.
527 @param[in] Value The boolean value to set.
528
529 @return The status of the set operation.
530
531 **/
532 RETURN_STATUS
533 EFIAPI
534 LibPcdSetBoolS (
535 IN UINTN TokenNumber,
536 IN BOOLEAN Value
537 )
538 {
539 ASSERT (FALSE);
540
541 return RETURN_INVALID_PARAMETER;
542 }
543
544 /**
545 This function provides a means by which to set a value for a given PCD token.
546
547 Sets the 8-bit value for the token specified by TokenNumber
548 to the value specified by Value.
549
550 If Guid is NULL, then ASSERT().
551
552 @param[in] Guid The 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 8-bit value to set.
556
557 @return The status of the set operation.
558
559 **/
560 RETURN_STATUS
561 EFIAPI
562 LibPcdSetEx8S (
563 IN CONST GUID *Guid,
564 IN UINTN TokenNumber,
565 IN UINT8 Value
566 )
567 {
568 ASSERT (FALSE);
569
570 return RETURN_INVALID_PARAMETER;
571 }
572
573 /**
574 This function provides a means by which to set a value for a given PCD token.
575
576 Sets the 16-bit value for the token specified by TokenNumber
577 to the value specified by Value.
578
579 If Guid is NULL, then ASSERT().
580
581 @param[in] Guid The 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 16-bit value to set.
585
586 @return The status of the set operation.
587
588 **/
589 RETURN_STATUS
590 EFIAPI
591 LibPcdSetEx16S (
592 IN CONST GUID *Guid,
593 IN UINTN TokenNumber,
594 IN UINT16 Value
595 )
596 {
597 ASSERT (FALSE);
598
599 return RETURN_INVALID_PARAMETER;
600 }
601
602 /**
603 This function provides a means by which to set a value for a given PCD token.
604
605 Sets the 32-bit value for the token specified by TokenNumber
606 to the value specified by Value.
607
608 If Guid is NULL, then ASSERT().
609
610 @param[in] Guid The pointer to a 128-bit unique value that
611 designates which namespace to set a value from.
612 @param[in] TokenNumber The PCD token number to set a current value for.
613 @param[in] Value The 32-bit value to set.
614
615 @return The status of the set operation.
616
617 **/
618 RETURN_STATUS
619 EFIAPI
620 LibPcdSetEx32S (
621 IN CONST GUID *Guid,
622 IN UINTN TokenNumber,
623 IN UINT32 Value
624 )
625 {
626 ASSERT (FALSE);
627
628 return RETURN_INVALID_PARAMETER;
629 }
630
631 /**
632 This function provides a means by which to set a value for a given PCD token.
633
634 Sets the 64-bit value for the token specified by TokenNumber
635 to the value specified by Value.
636
637 If Guid is NULL, then ASSERT().
638
639 @param[in] Guid The pointer to a 128-bit unique value that
640 designates which namespace to set a value from.
641 @param[in] TokenNumber The PCD token number to set a current value for.
642 @param[in] Value The 64-bit value to set.
643
644 @return The status of the set operation.
645
646 **/
647 RETURN_STATUS
648 EFIAPI
649 LibPcdSetEx64S (
650 IN CONST GUID *Guid,
651 IN UINTN TokenNumber,
652 IN UINT64 Value
653 )
654 {
655 ASSERT (FALSE);
656
657 return RETURN_INVALID_PARAMETER;
658 }
659
660 /**
661 This function provides a means by which to set a value for a given PCD token.
662
663 Sets a buffer for the token specified by TokenNumber to the value specified by
664 Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
665 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
666 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation
667 was not actually performed.
668
669 If Guid is NULL, then ASSERT().
670 If SizeOfBuffer is NULL, then ASSERT().
671 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
672
673 @param[in] Guid Pointer to a 128-bit unique value that
674 designates which namespace to set a value from.
675 @param[in] TokenNumber The PCD token number to set a current value for.
676 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
677 @param[in] Buffer A pointer to the buffer to set.
678
679 @return The status of the set operation.
680
681 **/
682 RETURN_STATUS
683 EFIAPI
684 LibPcdSetExPtrS (
685 IN CONST GUID *Guid,
686 IN UINTN TokenNumber,
687 IN OUT UINTN *SizeOfBuffer,
688 IN VOID *Buffer
689 )
690 {
691 ASSERT (FALSE);
692
693 return RETURN_INVALID_PARAMETER;
694 }
695
696 /**
697 This function provides a means by which to set a value for a given PCD token.
698
699 Sets the boolean value for the token specified by TokenNumber
700 to the value specified by Value.
701
702 If Guid is NULL, then ASSERT().
703
704 @param[in] Guid The pointer to a 128-bit unique value that
705 designates which namespace to set a value from.
706 @param[in] TokenNumber The PCD token number to set a current value for.
707 @param[in] Value The boolean value to set.
708
709 @return The status of the set operation.
710
711 **/
712 RETURN_STATUS
713 EFIAPI
714 LibPcdSetExBoolS (
715 IN CONST GUID *Guid,
716 IN UINTN TokenNumber,
717 IN BOOLEAN Value
718 )
719 {
720 ASSERT (FALSE);
721
722 return RETURN_INVALID_PARAMETER;
723 }
724
725 /**
726 Set up a notification function that is called when a specified token is set.
727
728 When the token specified by TokenNumber and Guid is set,
729 then notification function specified by NotificationFunction is called.
730 If Guid is NULL, then the default token space is used.
731
732 If NotificationFunction is NULL, then ASSERT().
733
734 @param[in] Guid The pointer to a 128-bit unique value that designates which
735 namespace to set a value from. If NULL, then the default
736 token space is used.
737 @param[in] TokenNumber The PCD token number to monitor.
738 @param[in] NotificationFunction The function to call when the token
739 specified by Guid and TokenNumber is set.
740
741 **/
742 VOID
743 EFIAPI
744 LibPcdCallbackOnSet (
745 IN CONST GUID *Guid OPTIONAL,
746 IN UINTN TokenNumber,
747 IN PCD_CALLBACK NotificationFunction
748 )
749 {
750 ASSERT (FALSE);
751 }
752
753
754
755 /**
756 Disable a notification function that was established with LibPcdCallbackonSet().
757
758 Disable a notification function that was previously established with LibPcdCallbackOnSet().
759
760 If NotificationFunction is NULL, then ASSERT().
761 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
762 and NotificationFunction, then ASSERT().
763
764 @param[in] Guid Specify the GUID token space.
765 @param[in] TokenNumber Specify the token number.
766 @param[in] NotificationFunction The callback function to be unregistered.
767
768 **/
769 VOID
770 EFIAPI
771 LibPcdCancelCallback (
772 IN CONST GUID *Guid OPTIONAL,
773 IN UINTN TokenNumber,
774 IN PCD_CALLBACK NotificationFunction
775 )
776 {
777 ASSERT (FALSE);
778 }
779
780
781
782 /**
783 Retrieves the next token in a token space.
784
785 Retrieves the next PCD token number from the token space specified by Guid.
786 If Guid is NULL, then the default token space is used. If TokenNumber is 0,
787 then the first token number is returned. Otherwise, the token number that
788 follows TokenNumber in the token space is returned. If TokenNumber is the last
789 token number in the token space, then 0 is returned.
790
791 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
792
793 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace
794 to set a value from. If NULL, then the default token space is used.
795 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
796 token number.
797
798 @return The next valid token number.
799
800 **/
801 UINTN
802 EFIAPI
803 LibPcdGetNextToken (
804 IN CONST GUID *Guid OPTIONAL,
805 IN UINTN TokenNumber
806 )
807 {
808 ASSERT (FALSE);
809
810 return 0;
811 }
812
813
814
815 /**
816 Used to retrieve the list of available PCD token space GUIDs.
817
818 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
819 in the platform.
820 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
821 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
822
823 @param TokenSpaceGuid The pointer to a PCD token space GUID.
824
825 @return The next valid token namespace.
826
827 **/
828 GUID *
829 EFIAPI
830 LibPcdGetNextTokenSpace (
831 IN CONST GUID *TokenSpaceGuid
832 )
833 {
834 ASSERT (FALSE);
835
836 return NULL;
837 }
838
839
840 /**
841 Sets a value of a patchable PCD entry that is type pointer.
842
843 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
844 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
845 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
846 NULL to indicate that the set operation was not actually performed.
847 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
848 MaximumDatumSize and NULL must be returned.
849
850 If PatchVariable is NULL, then ASSERT().
851 If SizeOfBuffer is NULL, then ASSERT().
852 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
853
854 @param[out] PatchVariable A pointer to the global variable in a module that is
855 the target of the set operation.
856 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
857 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
858 @param[in] Buffer A pointer to the buffer to used to set the target variable.
859
860 @return Return the pointer to the buffer that was set.
861
862 **/
863 VOID *
864 EFIAPI
865 LibPatchPcdSetPtr (
866 OUT VOID *PatchVariable,
867 IN UINTN MaximumDatumSize,
868 IN OUT UINTN *SizeOfBuffer,
869 IN CONST VOID *Buffer
870 )
871 {
872 ASSERT (PatchVariable != NULL);
873 ASSERT (SizeOfBuffer != NULL);
874
875 if (*SizeOfBuffer > 0) {
876 ASSERT (Buffer != NULL);
877 }
878
879 if ((*SizeOfBuffer > MaximumDatumSize) ||
880 (*SizeOfBuffer == MAX_ADDRESS)) {
881 *SizeOfBuffer = MaximumDatumSize;
882 return NULL;
883 }
884
885 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
886
887 return (VOID *) Buffer;
888 }
889
890 /**
891 Sets a value of a patchable PCD entry that is type pointer.
892
893 Sets the PCD entry specified by PatchVariable to the value specified
894 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
895 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
896 to indicate that the set operation was not actually performed.
897 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
898 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
899
900 If PatchVariable is NULL, then ASSERT().
901 If SizeOfBuffer is NULL, then ASSERT().
902 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
903
904 @param[out] PatchVariable A pointer to the global variable in a module that is
905 the target of the set operation.
906 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
907 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
908 @param[in] Buffer A pointer to the buffer to used to set the target variable.
909
910 @return The status of the set operation.
911
912 **/
913 RETURN_STATUS
914 EFIAPI
915 LibPatchPcdSetPtrS (
916 OUT VOID *PatchVariable,
917 IN UINTN MaximumDatumSize,
918 IN OUT UINTN *SizeOfBuffer,
919 IN CONST VOID *Buffer
920 )
921 {
922 ASSERT (PatchVariable != NULL);
923 ASSERT (SizeOfBuffer != NULL);
924
925 if (*SizeOfBuffer > 0) {
926 ASSERT (Buffer != NULL);
927 }
928
929 if ((*SizeOfBuffer > MaximumDatumSize) ||
930 (*SizeOfBuffer == MAX_ADDRESS)) {
931 *SizeOfBuffer = MaximumDatumSize;
932 return RETURN_INVALID_PARAMETER;
933 }
934
935 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
936
937 return RETURN_SUCCESS;
938 }
939
940 /**
941 Sets a value and size of a patchable PCD entry that is type pointer.
942
943 Sets the PCD entry specified by PatchVariable to the value specified by Buffer
944 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
945 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
946 NULL to indicate that the set operation was not actually performed.
947 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
948 MaximumDatumSize and NULL must be returned.
949
950 If PatchVariable is NULL, then ASSERT().
951 If SizeOfPatchVariable is NULL, then ASSERT().
952 If SizeOfBuffer is NULL, then ASSERT().
953 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
954
955 @param[out] PatchVariable A pointer to the global variable in a module that is
956 the target of the set operation.
957 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
958 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
959 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
960 @param[in] Buffer A pointer to the buffer to used to set the target variable.
961
962 @return Return the pointer to the buffer been set.
963
964 **/
965 VOID *
966 EFIAPI
967 LibPatchPcdSetPtrAndSize (
968 OUT VOID *PatchVariable,
969 OUT UINTN *SizeOfPatchVariable,
970 IN UINTN MaximumDatumSize,
971 IN OUT UINTN *SizeOfBuffer,
972 IN CONST VOID *Buffer
973 )
974 {
975 ASSERT (PatchVariable != NULL);
976 ASSERT (SizeOfPatchVariable != NULL);
977 ASSERT (SizeOfBuffer != NULL);
978
979 if (*SizeOfBuffer > 0) {
980 ASSERT (Buffer != NULL);
981 }
982
983 if ((*SizeOfBuffer > MaximumDatumSize) ||
984 (*SizeOfBuffer == MAX_ADDRESS)) {
985 *SizeOfBuffer = MaximumDatumSize;
986 return NULL;
987 }
988
989 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
990 *SizeOfPatchVariable = *SizeOfBuffer;
991
992 return (VOID *) Buffer;
993 }
994
995 /**
996 Sets a value and size of a patchable PCD entry that is type pointer.
997
998 Sets the PCD entry specified by PatchVariable to the value specified
999 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
1000 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
1001 to indicate that the set operation was not actually performed.
1002 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
1003 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
1004
1005 If PatchVariable is NULL, then ASSERT().
1006 If SizeOfPatchVariable is NULL, then ASSERT().
1007 If SizeOfBuffer is NULL, then ASSERT().
1008 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1009
1010 @param[out] PatchVariable A pointer to the global variable in a module that is
1011 the target of the set operation.
1012 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
1013 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
1014 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
1015 @param[in] Buffer A pointer to the buffer to used to set the target variable.
1016
1017 @return The status of the set operation.
1018
1019 **/
1020 RETURN_STATUS
1021 EFIAPI
1022 LibPatchPcdSetPtrAndSizeS (
1023 OUT VOID *PatchVariable,
1024 OUT UINTN *SizeOfPatchVariable,
1025 IN UINTN MaximumDatumSize,
1026 IN OUT UINTN *SizeOfBuffer,
1027 IN CONST VOID *Buffer
1028 )
1029 {
1030 ASSERT (PatchVariable != NULL);
1031 ASSERT (SizeOfPatchVariable != NULL);
1032 ASSERT (SizeOfBuffer != NULL);
1033
1034 if (*SizeOfBuffer > 0) {
1035 ASSERT (Buffer != NULL);
1036 }
1037
1038 if ((*SizeOfBuffer > MaximumDatumSize) ||
1039 (*SizeOfBuffer == MAX_ADDRESS)) {
1040 *SizeOfBuffer = MaximumDatumSize;
1041 return RETURN_INVALID_PARAMETER;
1042 }
1043
1044 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);
1045 *SizeOfPatchVariable = *SizeOfBuffer;
1046
1047 return RETURN_SUCCESS;
1048 }
1049
1050 /**
1051 Retrieve additional information associated with a PCD token.
1052
1053 This includes information such as the type of value the TokenNumber is associated with as well as possible
1054 human readable name that is associated with the token.
1055
1056 If TokenNumber is not in the default token space specified, then ASSERT().
1057
1058 @param[in] TokenNumber The PCD token number.
1059 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1060 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1061 **/
1062 VOID
1063 EFIAPI
1064 LibPcdGetInfo (
1065 IN UINTN TokenNumber,
1066 OUT PCD_INFO *PcdInfo
1067 )
1068 {
1069 ASSERT (FALSE);
1070 }
1071
1072 /**
1073 Retrieve additional information associated with a PCD token.
1074
1075 This includes information such as the type of value the TokenNumber is associated with as well as possible
1076 human readable name that is associated with the token.
1077
1078 If TokenNumber is not in the token space specified by Guid, then ASSERT().
1079
1080 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
1081 @param[in] TokenNumber The PCD token number.
1082 @param[out] PcdInfo The returned information associated with the requested TokenNumber.
1083 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
1084 **/
1085 VOID
1086 EFIAPI
1087 LibPcdGetInfoEx (
1088 IN CONST GUID *Guid,
1089 IN UINTN TokenNumber,
1090 OUT PCD_INFO *PcdInfo
1091 )
1092 {
1093 ASSERT (FALSE);
1094 }
1095
1096 /**
1097 Retrieve the currently set SKU Id.
1098
1099 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
1100 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
1101 Id is returned.
1102 **/
1103 UINTN
1104 EFIAPI
1105 LibPcdGetSku (
1106 VOID
1107 )
1108 {
1109 ASSERT (FALSE);
1110
1111 return 0;
1112 }