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