]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/Pcd.h
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Include / Ppi / Pcd.h
1 /* @file
2 Platform Configuration Database (PCD) PPI
3
4 Copyright (c) 2006 - 2007, 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 #ifndef __PCD_PPI_H__
16 #define __PCD_PPI_H__
17
18
19 #define PCD_PPI_GUID \
20 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }
21
22 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
23
24
25
26 /**
27 Sets the SKU value for subsequent calls to set or get PCD token values.
28
29 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
30 SetSku() is normally called only once by the system.
31
32 For each item (token), the database can hold a single value that applies to all SKUs,
33 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
34 SKU-specific values are called SKU enabled.
35
36 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
37 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
38 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
39 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
40 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
41 set for that Id, the results are unpredictable.
42
43 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
44 set values associated with a PCD token.
45
46 @retval VOID
47
48 **/
49 typedef
50 VOID
51 (EFIAPI *PCD_PPI_SET_SKU) (
52 IN UINTN SkuId
53 );
54
55
56
57 /**
58 Retrieves an 8-bit value for a given PCD token.
59
60 Retrieves the current byte-sized value for a PCD token number.
61 If the TokenNumber is invalid, the results are unpredictable.
62
63 @param[in] TokenNumber The PCD token number.
64
65 @return The UINT8 value.
66
67 **/
68 typedef
69 UINT8
70 (EFIAPI *PCD_PPI_GET8) (
71 IN UINTN TokenNumber
72 );
73
74
75
76 /**
77 Retrieves an 16-bit value for a given PCD token.
78
79 Retrieves the current 16-bits value for a PCD token number.
80 If the TokenNumber is invalid, the results are unpredictable.
81
82 @param[in] TokenNumber The PCD token number.
83
84 @return The UINT16 value.
85
86 **/
87 typedef
88 UINT16
89 (EFIAPI *PCD_PPI_GET16) (
90 IN UINTN TokenNumber
91 );
92
93
94
95 /**
96 Retrieves an 32-bit value for a given PCD token.
97
98 Retrieves the current 32-bits value for a PCD token number.
99 If the TokenNumber is invalid, the results are unpredictable.
100
101 @param[in] TokenNumber The PCD token number.
102
103 @return The UINT32 value.
104
105 **/
106 typedef
107 UINT32
108 (EFIAPI *PCD_PPI_GET32) (
109 IN UINTN TokenNumber
110 );
111
112
113
114 /**
115 Retrieves an 64-bit value for a given PCD token.
116
117 Retrieves the current 64-bits value for a PCD token number.
118 If the TokenNumber is invalid, the results are unpredictable.
119
120 @param[in] TokenNumber The PCD token number.
121
122 @return The UINT64 value.
123
124 **/
125 typedef
126 UINT64
127 (EFIAPI *PCD_PPI_GET64) (
128 IN UINTN TokenNumber
129 );
130
131
132
133 /**
134 Retrieves a pointer to a value for a given PCD token.
135
136 Retrieves the current pointer to the buffer for a PCD token number.
137 Do not make any assumptions about the alignment of the pointer that
138 is returned by this function call. If the TokenNumber is invalid,
139 the results are unpredictable.
140
141 @param[in] TokenNumber The PCD token number.
142
143 @return The pointer to the buffer to be retrived.
144
145 **/
146 typedef
147 VOID *
148 (EFIAPI *PCD_PPI_GET_POINTER) (
149 IN UINTN TokenNumber
150 );
151
152
153
154 /**
155 Retrieves a Boolean value for a given PCD token.
156
157 Retrieves the current boolean value for a PCD token number.
158 Do not make any assumptions about the alignment of the pointer that
159 is returned by this function call. If the TokenNumber is invalid,
160 the results are unpredictable.
161
162 @param[in] TokenNumber The PCD token number.
163
164 @return The Boolean value.
165
166 **/
167 typedef
168 BOOLEAN
169 (EFIAPI *PCD_PPI_GET_BOOLEAN) (
170 IN UINTN TokenNumber
171 );
172
173
174
175 /**
176 Retrieves the size of the value for a given PCD token.
177
178 Retrieves the current size of a particular PCD token.
179 If the TokenNumber is invalid, the results are unpredictable.
180
181 @param[in] TokenNumber The PCD token number.
182
183 @return The size of the value for the PCD token.
184
185 **/
186 typedef
187 UINTN
188 (EFIAPI *PCD_PPI_GET_SIZE) (
189 IN UINTN TokenNumber
190 );
191
192
193
194 /**
195 Retrieves an 8-bit value for a given PCD token.
196
197 Retrieves the 8-bit value of a particular PCD token.
198 If the TokenNumber is invalid or the token space
199 specified by Guid does not exist, the results are
200 unpredictable.
201
202 @param[in] Guid The token space for the token number.
203 @param[in] TokenNumber The PCD token number.
204
205 @return The size 8-bit value for the PCD token.
206
207 **/
208 typedef
209 UINT8
210 (EFIAPI *PCD_PPI_GET_EX_8) (
211 IN CONST EFI_GUID *Guid,
212 IN UINTN TokenNumber
213 );
214
215
216
217 /**
218 Retrieves an 16-bit value for a given PCD token.
219
220 Retrieves the 16-bit value of a particular PCD token.
221 If the TokenNumber is invalid or the token space
222 specified by Guid does not exist, the results are
223 unpredictable.
224
225 @param[in] Guid The token space for the token number.
226 @param[in] TokenNumber The PCD token number.
227
228 @return The size 16-bit value for the PCD token.
229
230 **/
231 typedef
232 UINT16
233 (EFIAPI *PCD_PPI_GET_EX_16) (
234 IN CONST EFI_GUID *Guid,
235 IN UINTN TokenNumber
236 );
237
238
239
240 /**
241 Retrieves an 32-bit value for a given PCD token.
242
243 Retrieves the 32-bit value of a particular PCD token.
244 If the TokenNumber is invalid or the token space
245 specified by Guid does not exist, the results are
246 unpredictable.
247
248 @param[in] Guid The token space for the token number.
249 @param[in] TokenNumber The PCD token number.
250
251 @return The size 32-bit value for the PCD token.
252
253 **/
254 typedef
255 UINT32
256 (EFIAPI *PCD_PPI_GET_EX_32) (
257 IN CONST EFI_GUID *Guid,
258 IN UINTN TokenNumber
259 );
260
261
262
263 /**
264 Retrieves an 64-bit value for a given PCD token.
265
266 Retrieves the 64-bit value of a particular PCD token.
267 If the TokenNumber is invalid or the token space
268 specified by Guid does not exist, the results are
269 unpredictable.
270
271 @param[in] Guid The token space for the token number.
272 @param[in] TokenNumber The PCD token number.
273
274 @return The size 64-bit value for the PCD token.
275
276 **/
277 typedef
278 UINT64
279 (EFIAPI *PCD_PPI_GET_EX_64) (
280 IN CONST EFI_GUID *Guid,
281 IN UINTN TokenNumber
282 );
283
284
285
286 /**
287 Retrieves a pointer to a value for a given PCD token.
288
289 Retrieves the current pointer to the buffer for a PCD token number.
290 Do not make any assumptions about the alignment of the pointer that
291 is returned by this function call. If the TokenNumber is invalid,
292 the results are unpredictable.
293
294 @param[in] Guid The token space for the token number.
295 @param[in] TokenNumber The PCD token number.
296
297 @return The pointer to the buffer to be retrived.
298
299 **/
300 typedef
301 VOID *
302 (EFIAPI *PCD_PPI_GET_EX_POINTER) (
303 IN CONST EFI_GUID *Guid,
304 IN UINTN TokenNumber
305 );
306
307
308
309 /**
310 Retrieves an Boolean value for a given PCD token.
311
312 Retrieves the Boolean value of a particular PCD token.
313 If the TokenNumber is invalid or the token space
314 specified by Guid does not exist, the results are
315 unpredictable.
316
317 @param[in] Guid The token space for the token number.
318 @param[in] TokenNumber The PCD token number.
319
320 @return The size Boolean value for the PCD token.
321
322 **/
323 typedef
324 BOOLEAN
325 (EFIAPI *PCD_PPI_GET_EX_BOOLEAN) (
326 IN CONST EFI_GUID *Guid,
327 IN UINTN TokenNumber
328 );
329
330
331
332 /**
333 Retrieves the size of the value for a given PCD token.
334
335 Retrieves the current size of a particular PCD token.
336 If the TokenNumber is invalid, the results are unpredictable.
337
338 @param[in] Guid The token space for the token number.
339 @param[in] TokenNumber The PCD token number.
340
341 @return The size of the value for the PCD token.
342
343 **/
344 typedef
345 UINTN
346 (EFIAPI *PCD_PPI_GET_EX_SIZE) (
347 IN CONST EFI_GUID *Guid,
348 IN UINTN TokenNumber
349 );
350
351
352
353 /**
354 Sets an 8-bit value for a given PCD token.
355
356 When the PCD service sets a value, it will check to ensure that the
357 size of the value being set is compatible with the Token's existing definition.
358 If it is not, an error will be returned.
359
360 @param[in] TokenNumber The PCD token number.
361 @param[in] Value The value to set for the PCD token.
362
363 @retval EFI_SUCCESS Procedure returned successfully.
364 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
365 being set was incompatible with a call to this function.
366 Use GetSize() to retrieve the size of the target data.
367 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
368
369 **/
370 typedef
371 EFI_STATUS
372 (EFIAPI *PCD_PPI_SET8) (
373 IN UINTN TokenNumber,
374 IN UINT8 Value
375 );
376
377
378
379 /**
380 Sets an 16-bit value for a given PCD token.
381
382 When the PCD service sets a value, it will check to ensure that the
383 size of the value being set is compatible with the Token's existing definition.
384 If it is not, an error will be returned.
385
386 @param[in] TokenNumber The PCD token number.
387 @param[in] Value The value to set for the PCD token.
388
389 @retval EFI_SUCCESS Procedure returned successfully.
390 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
391 being set was incompatible with a call to this function.
392 Use GetSize() to retrieve the size of the target data.
393 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
394
395 **/
396 typedef
397 EFI_STATUS
398 (EFIAPI *PCD_PPI_SET16) (
399 IN UINTN TokenNumber,
400 IN UINT16 Value
401 );
402
403
404
405 /**
406 Sets an 32-bit value for a given PCD token.
407
408 When the PCD service sets a value, it will check to ensure that the
409 size of the value being set is compatible with the Token's existing definition.
410 If it is not, an error will be returned.
411
412 @param[in] TokenNumber The PCD token number.
413 @param[in] Value The value to set for the PCD token.
414
415 @retval EFI_SUCCESS Procedure returned successfully.
416 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
417 being set was incompatible with a call to this function.
418 Use GetSize() to retrieve the size of the target data.
419 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
420
421 **/
422 typedef
423 EFI_STATUS
424 (EFIAPI *PCD_PPI_SET32) (
425 IN UINTN TokenNumber,
426 IN UINT32 Value
427 );
428
429
430
431 /**
432 Sets an 64-bit value for a given PCD token.
433
434 When the PCD service sets a value, it will check to ensure that the
435 size of the value being set is compatible with the Token's existing definition.
436 If it is not, an error will be returned.
437
438 @param[in] TokenNumber The PCD token number.
439 @param[in] Value The value to set for the PCD token.
440
441 @retval EFI_SUCCESS Procedure returned successfully.
442 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
443 being set was incompatible with a call to this function.
444 Use GetSize() to retrieve the size of the target data.
445 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
446
447 **/
448 typedef
449 EFI_STATUS
450 (EFIAPI *PCD_PPI_SET64) (
451 IN UINTN TokenNumber,
452 IN UINT64 Value
453 );
454
455
456
457
458 /**
459 Sets a value of a specified size for a given PCD token.
460
461 When the PCD service sets a value, it will check to ensure that the
462 size of the value being set is compatible with the Token's existing definition.
463 If it is not, an error will be returned.
464
465 @param[in] TokenNumber The PCD token number.
466 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
467 On input, if the SizeOfValue is greater than the maximum size supported
468 for this TokenNumber then the output value of SizeOfValue will reflect
469 the maximum size supported for this TokenNumber.
470 @param[in] Buffer The buffer to set for the PCD token.
471
472 @retval EFI_SUCCESS Procedure returned successfully.
473 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
474 being set was incompatible with a call to this function.
475 Use GetSize() to retrieve the size of the target data.
476 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
477
478 **/
479 typedef
480 EFI_STATUS
481 (EFIAPI *PCD_PPI_SET_POINTER) (
482 IN UINTN TokenNumber,
483 IN OUT UINTN *SizeOfBuffer,
484 IN VOID *Buffer
485 );
486
487
488
489 /**
490 Sets an Boolean value for a given PCD token.
491
492 When the PCD service sets a value, it will check to ensure that the
493 size of the value being set is compatible with the Token's existing definition.
494 If it is not, an error will be returned.
495
496 @param[in] TokenNumber The PCD token number.
497 @param[in] Value The value to set for the PCD token.
498
499 @retval EFI_SUCCESS Procedure returned successfully.
500 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
501 being set was incompatible with a call to this function.
502 Use GetSize() to retrieve the size of the target data.
503 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
504
505 **/
506 typedef
507 EFI_STATUS
508 (EFIAPI *PCD_PPI_SET_BOOLEAN) (
509 IN UINTN TokenNumber,
510 IN BOOLEAN Value
511 );
512
513
514
515 /**
516 Sets an 8-bit value for a given PCD token.
517
518 When the PCD service sets a value, it will check to ensure that the
519 size of the value being set is compatible with the Token's existing definition.
520 If it is not, an error will be returned.
521
522 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
523 @param[in] TokenNumber The PCD token number.
524 @param[in] Value The value to set for the PCD token.
525
526 @retval EFI_SUCCESS Procedure returned successfully.
527 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
528 being set was incompatible with a call to this function.
529 Use GetSize() to retrieve the size of the target data.
530 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
531
532 **/
533 typedef
534 EFI_STATUS
535 (EFIAPI *PCD_PPI_SET_EX_8) (
536 IN CONST EFI_GUID *Guid,
537 IN UINTN TokenNumber,
538 IN UINT8 Value
539 );
540
541
542
543 /**
544 Sets an 16-bit value for a given PCD token.
545
546 When the PCD service sets a value, it will check to ensure that the
547 size of the value being set is compatible with the Token's existing definition.
548 If it is not, an error will be returned.
549
550 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
551 @param[in] TokenNumber The PCD token number.
552 @param[in] Value The value to set for the PCD token.
553
554 @retval EFI_SUCCESS Procedure returned successfully.
555 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
556 being set was incompatible with a call to this function.
557 Use GetSize() to retrieve the size of the target data.
558 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
559
560 **/
561 typedef
562 EFI_STATUS
563 (EFIAPI *PCD_PPI_SET_EX_16) (
564 IN CONST EFI_GUID *Guid,
565 IN UINTN TokenNumber,
566 IN UINT16 Value
567 );
568
569
570
571 /**
572 Sets an 32-bit value for a given PCD token.
573
574 When the PCD service sets a value, it will check to ensure that the
575 size of the value being set is compatible with the Token's existing definition.
576 If it is not, an error will be returned.
577
578 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
579 @param[in] TokenNumber The PCD token number.
580 @param[in] Value The value to set for the PCD token.
581
582 @retval EFI_SUCCESS Procedure returned successfully.
583 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
584 being set was incompatible with a call to this function.
585 Use GetSize() to retrieve the size of the target data.
586 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
587
588 **/
589 typedef
590 EFI_STATUS
591 (EFIAPI *PCD_PPI_SET_EX_32) (
592 IN CONST EFI_GUID *Guid,
593 IN UINTN TokenNumber,
594 IN UINT32 Value
595 );
596
597
598
599 /**
600 Sets an 64-bit value for a given PCD token.
601
602 When the PCD service sets a value, it will check to ensure that the
603 size of the value being set is compatible with the Token's existing definition.
604 If it is not, an error will be returned.
605
606 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
607 @param[in] TokenNumber The PCD token number.
608 @param[in] Value The value to set for the PCD token.
609
610 @retval EFI_SUCCESS Procedure returned successfully.
611 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
612 being set was incompatible with a call to this function.
613 Use GetSize() to retrieve the size of the target data.
614 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
615
616 **/
617 typedef
618 EFI_STATUS
619 (EFIAPI *PCD_PPI_SET_EX_64) (
620 IN CONST EFI_GUID *Guid,
621 IN UINTN TokenNumber,
622 IN UINT64 Value
623 );
624
625
626
627 /**
628 Sets a value of a specified size for a given PCD token.
629
630 When the PCD service sets a value, it will check to ensure that the
631 size of the value being set is compatible with the Token's existing definition.
632 If it is not, an error will be returned.
633
634 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
635 @param[in] TokenNumber The PCD token number.
636 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
637 On input, if the SizeOfValue is greater than the maximum size supported
638 for this TokenNumber then the output value of SizeOfValue will reflect
639 the maximum size supported for this TokenNumber.
640 @param[in] Buffer The buffer to set for the PCD token.
641
642 @retval EFI_SUCCESS Procedure returned successfully.
643 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
644 being set was incompatible with a call to this function.
645 Use GetSize() to retrieve the size of the target data.
646 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
647
648 **/
649 typedef
650 EFI_STATUS
651 (EFIAPI *PCD_PPI_SET_EX_POINTER) (
652 IN CONST EFI_GUID *Guid,
653 IN UINTN TokenNumber,
654 IN OUT UINTN *SizeOfBuffer,
655 IN VOID *Buffer
656 );
657
658
659
660 /**
661 Sets an Boolean value for a given PCD token.
662
663 When the PCD service sets a value, it will check to ensure that the
664 size of the value being set is compatible with the Token's existing definition.
665 If it is not, an error will be returned.
666
667 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
668 @param[in] TokenNumber The PCD token number.
669 @param[in] Value The value to set for the PCD token.
670
671 @retval EFI_SUCCESS Procedure returned successfully.
672 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
673 being set was incompatible with a call to this function.
674 Use GetSize() to retrieve the size of the target data.
675 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
676
677 **/
678 typedef
679 EFI_STATUS
680 (EFIAPI *PCD_PPI_SET_EX_BOOLEAN) (
681 IN CONST EFI_GUID *Guid,
682 IN UINTN TokenNumber,
683 IN BOOLEAN Value
684 );
685
686
687
688 /**
689 Callback on SET function prototype definition.
690
691 This notification function serves two purposes. Firstly, it notifies the module
692 which did the registration that the value of this PCD token has been set. Secondly,
693 it provides a mechanism for the module which did the registration to intercept the set
694 operation and override the value been set if necessary. After the invocation of the
695 callback function, TokenData will be used by PCD service PEIM to modify the internal data
696 in PCD database.
697
698 @param[in] CallBackGuid The PCD token GUID being set.
699 @param[in] CallBackToken The PCD token number being set.
700 @param[in, out] TokenData A pointer to the token data being set.
701 @param[in] TokenDataSize The size, in bytes, of the data being set.
702
703 @retval VOID
704
705 **/
706 typedef
707 VOID
708 (EFIAPI *PCD_PPI_CALLBACK) (
709 IN CONST EFI_GUID *CallBackGuid, OPTIONAL
710 IN UINTN CallBackToken,
711 IN OUT VOID *TokenData,
712 IN UINTN TokenDataSize
713 );
714
715
716
717 /**
718 Specifies a function to be called anytime the value of a designated token is changed.
719
720 @param[in] TokenNumber The PCD token number.
721 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
722 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
723
724 @retval EFI_SUCCESS The PCD service has successfully established a call event
725 for the CallBackToken requested.
726 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
727
728 **/
729 typedef
730 EFI_STATUS
731 (EFIAPI *PCD_PPI_CALLBACK_ONSET) (
732 IN CONST EFI_GUID *Guid, OPTIONAL
733 IN UINTN TokenNumber,
734 IN PCD_PPI_CALLBACK CallBackFunction
735 );
736
737
738
739 /**
740 Cancels a previously set callback function for a particular PCD token number.
741
742 @param[in] TokenNumber The PCD token number.
743 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
744 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
745
746 @retval EFI_SUCCESS The PCD service has successfully established a call event
747 for the CallBackToken requested.
748 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
749
750 **/
751 typedef
752 EFI_STATUS
753 (EFIAPI *PCD_PPI_CANCEL_CALLBACK) (
754 IN CONST EFI_GUID *Guid, OPTIONAL
755 IN UINTN TokenNumber,
756 IN PCD_PPI_CALLBACK CallBackFunction
757 );
758
759
760
761 /**
762 Retrieves the next valid PCD token for a given namespace.
763
764 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
765 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
766 If the input token namespace or token number does not exist on the platform, an error is
767 returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
768 have the pointer reference a TokenNumber value of 0. If the input token number is 0
769 and there is no valid token number for this token namespace, *TokenNumber will be
770 assigned to 0 and the function return EFI_SUCCESS. If the token number is the last valid
771 token number, *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
772
773 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
774 Or the input token number is already the last valid token number in the PCD database.
775 In the later case, *TokenNumber is updated with the value of 0.
776 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
777
778 **/
779 typedef
780 EFI_STATUS
781 (EFIAPI *PCD_PPI_GET_NEXT_TOKEN) (
782 IN CONST EFI_GUID *Guid, OPTIONAL
783 IN OUT UINTN *TokenNumber
784 );
785
786
787
788 /**
789 Retrieves the next valid PCD token namespace for a given namespace.
790
791 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known
792 token namespace from which the search will start. On output, it designates
793 the next valid token namespace on the platform. If the input token namespace
794 does not exist on the platform, an error is returned and the value of *Guid is
795 undefined. If *Guid is NULL, then the GUID of the first token space of the
796 current platform is assigned to *Guid the function return EFI_SUCCESS.
797 If *Guid is NULL and there is no namespace exist in the platform other than the default
798 (NULL) tokennamespace, *Guid is unchanged and the function return EFI_SUCCESS.
799 If this input token namespace is the last namespace on the platform,
800 *Guid will be assigned to NULL and the function return EFI_SUCCESS.
801
802 @retval EFI_SUCCESS The PCD service has retrieved the next valid token namespace.
803 Or the input token namespace is already the last valid token
804 number in the PCD database. In the later case, *Guid is updated
805 with the value of NULL. Or the input token name space is NULL and there
806 is no valid token namespace other than the default namespace (NULL).
807 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
808
809 **/
810 typedef
811 EFI_STATUS
812 (EFIAPI *PCD_PPI_GET_NEXT_TOKENSPACE) (
813 IN OUT CONST EFI_GUID **Guid
814 );
815
816
817
818 //
819 // Interface structure for the PCD PPI
820 //
821 typedef struct {
822 PCD_PPI_SET_SKU SetSku;
823
824 PCD_PPI_GET8 Get8;
825 PCD_PPI_GET16 Get16;
826 PCD_PPI_GET32 Get32;
827 PCD_PPI_GET64 Get64;
828 PCD_PPI_GET_POINTER GetPtr;
829 PCD_PPI_GET_BOOLEAN GetBool;
830 PCD_PPI_GET_SIZE GetSize;
831
832 PCD_PPI_GET_EX_8 Get8Ex;
833 PCD_PPI_GET_EX_16 Get16Ex;
834 PCD_PPI_GET_EX_32 Get32Ex;
835 PCD_PPI_GET_EX_64 Get64Ex;
836 PCD_PPI_GET_EX_POINTER GetPtrEx;
837 PCD_PPI_GET_EX_BOOLEAN GetBoolEx;
838 PCD_PPI_GET_EX_SIZE GetSizeEx;
839
840 PCD_PPI_SET8 Set8;
841 PCD_PPI_SET16 Set16;
842 PCD_PPI_SET32 Set32;
843 PCD_PPI_SET64 Set64;
844 PCD_PPI_SET_POINTER SetPtr;
845 PCD_PPI_SET_BOOLEAN SetBool;
846
847 PCD_PPI_SET_EX_8 Set8Ex;
848 PCD_PPI_SET_EX_16 Set16Ex;
849 PCD_PPI_SET_EX_32 Set32Ex;
850 PCD_PPI_SET_EX_64 Set64Ex;
851 PCD_PPI_SET_EX_POINTER SetPtrEx;
852 PCD_PPI_SET_EX_BOOLEAN SetBoolEx;
853
854 PCD_PPI_CALLBACK_ONSET CallbackOnSet;
855 PCD_PPI_CANCEL_CALLBACK CancelCallback;
856 PCD_PPI_GET_NEXT_TOKEN GetNextToken;
857 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace;
858 } PCD_PPI;
859
860
861 extern EFI_GUID gPcdPpiGuid;
862
863 #endif