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