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