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