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