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