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