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