]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Pcd.h
Fix function comment to follows doxygen format.
[mirror_edk2.git] / MdePkg / Include / Protocol / Pcd.h
1 /** @file
2 Platform Configuration Database (PCD) Protocol
3
4 Copyright (c) 2006, 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_H__
16 #define __PCD_H__
17
18 #include <PiDxe.h>
19
20 extern EFI_GUID gPcdProtocolGuid;
21
22 #define PCD_PROTOCOL_GUID \
23 { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }
24
25 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
26
27
28 /**
29 Sets the SKU value for subsequent calls to set or get PCD token values.
30
31 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
32 SetSku() is normally called only once by the system.
33
34 For each item (token), the database can hold a single value that applies to all SKUs,
35 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
36 SKU-specific values are called SKU enabled.
37
38 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
39 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
40 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
41 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
42 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
43 set for that Id, the results are unpredictable.
44
45 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
46 set values associated with a PCD token.
47
48 @retval VOID
49
50 **/
51 typedef
52 VOID
53 (EFIAPI *PCD_PROTOCOL_SET_SKU)(
54 IN UINTN SkuId
55 );
56
57
58
59 /**
60 Retrieves an 8-bit value for a given PCD token.
61
62 Retrieves the current byte-sized value for a PCD token number.
63 If the TokenNumber is invalid, the results are unpredictable.
64
65 @param[in] TokenNumber The PCD token number.
66
67 @return The UINT8 value.
68
69 **/
70 typedef
71 UINT8
72 (EFIAPI *PCD_PROTOCOL_GET8)(
73 IN UINTN TokenNumber
74 );
75
76
77
78 /**
79 Retrieves an 16-bit value for a given PCD token.
80
81 Retrieves the current 16-bits value for a PCD token number.
82 If the TokenNumber is invalid, the results are unpredictable.
83
84 @param[in] TokenNumber The PCD token number.
85
86 @return The UINT16 value.
87
88 **/
89 typedef
90 UINT16
91 (EFIAPI *PCD_PROTOCOL_GET16)(
92 IN UINTN TokenNumber
93 );
94
95
96
97 /**
98 Retrieves an 32-bit value for a given PCD token.
99
100 Retrieves the current 32-bits value for a PCD token number.
101 If the TokenNumber is invalid, the results are unpredictable.
102
103 @param[in] TokenNumber The PCD token number.
104
105 @return The UINT32 value.
106
107 **/
108 typedef
109 UINT32
110 (EFIAPI *PCD_PROTOCOL_GET32)(
111 IN UINTN TokenNumber
112 );
113
114
115
116 /**
117 Retrieves an 64-bit value for a given PCD token.
118
119 Retrieves the current 64-bits value for a PCD token number.
120 If the TokenNumber is invalid, the results are unpredictable.
121
122 @param[in] TokenNumber The PCD token number.
123
124 @return The UINT64 value.
125
126 **/
127 typedef
128 UINT64
129 (EFIAPI *PCD_PROTOCOL_GET64)(
130 IN UINTN TokenNumber
131 );
132
133
134
135 /**
136 Retrieves a pointer to a value for a given PCD token.
137
138 Retrieves the current pointer to the buffer for a PCD token number.
139 Do not make any assumptions about the alignment of the pointer that
140 is returned by this function call. If the TokenNumber is invalid,
141 the results are unpredictable.
142
143 @param[in] TokenNumber The PCD token number.
144
145 @return The pointer to the buffer to be retrived.
146
147 **/
148 typedef
149 VOID *
150 (EFIAPI *PCD_PROTOCOL_GET_POINTER)(
151 IN UINTN TokenNumber
152 );
153
154
155
156 /**
157 Retrieves a Boolean value for a given PCD token.
158
159 Retrieves the current boolean value for a PCD token number.
160 Do not make any assumptions about the alignment of the pointer that
161 is returned by this function call. If the TokenNumber is invalid,
162 the results are unpredictable.
163
164 @param[in] TokenNumber The PCD token number.
165
166 @return The Boolean value.
167
168 **/
169 typedef
170 BOOLEAN
171 (EFIAPI *PCD_PROTOCOL_GET_BOOLEAN)(
172 IN UINTN TokenNumber
173 );
174
175
176
177 /**
178 Retrieves the size of the value for a given PCD token.
179
180 Retrieves the current size of a particular PCD token.
181 If the TokenNumber is invalid, the results are unpredictable.
182
183 @param[in] TokenNumber The PCD token number.
184
185 @return The size of the value for the PCD token.
186
187 **/
188 typedef
189 UINTN
190 (EFIAPI *PCD_PROTOCOL_GET_SIZE)(
191 IN UINTN TokenNumber
192 );
193
194
195
196 /**
197 Retrieves an 8-bit value for a given PCD token.
198
199 Retrieves the 8-bit value of a particular PCD token.
200 If the TokenNumber is invalid or the token space
201 specified by Guid does not exist, the results are
202 unpredictable.
203
204 @param[in] Guid The token space for the token number.
205 @param[in] TokenNumber The PCD token number.
206
207 @return The size 8-bit value for the PCD token.
208
209 **/
210 typedef
211 UINT8
212 (EFIAPI *PCD_PROTOCOL_GET_EX_8)(
213 IN CONST EFI_GUID *Guid,
214 IN UINTN TokenNumber
215 );
216
217
218
219 /**
220 Retrieves an 16-bit value for a given PCD token.
221
222 Retrieves the 16-bit value of a particular PCD token.
223 If the TokenNumber is invalid or the token space
224 specified by Guid does not exist, the results are
225 unpredictable.
226
227 @param[in] Guid The token space for the token number.
228 @param[in] TokenNumber The PCD token number.
229
230 @return The size 16-bit value for the PCD token.
231
232 **/
233 typedef
234 UINT16
235 (EFIAPI *PCD_PROTOCOL_GET_EX_16)(
236 IN CONST EFI_GUID *Guid,
237 IN UINTN TokenNumber
238 );
239
240
241
242 /**
243 Retrieves an 32-bit value for a given PCD token.
244
245 Retrieves the 32-bit value of a particular PCD token.
246 If the TokenNumber is invalid or the token space
247 specified by Guid does not exist, the results are
248 unpredictable.
249
250 @param[in] Guid The token space for the token number.
251 @param[in] TokenNumber The PCD token number.
252
253 @return The size 32-bit value for the PCD token.
254
255 **/
256 typedef
257 UINT32
258 (EFIAPI *PCD_PROTOCOL_GET_EX_32)(
259 IN CONST EFI_GUID *Guid,
260 IN UINTN TokenNumber
261 );
262
263
264
265 /**
266 Retrieves an 64-bit value for a given PCD token.
267
268 Retrieves the 64-bit value of a particular PCD token.
269 If the TokenNumber is invalid or the token space
270 specified by Guid does not exist, the results are
271 unpredictable.
272
273 @param[in] Guid The token space for the token number.
274 @param[in] TokenNumber The PCD token number.
275
276 @return The size 64-bit value for the PCD token.
277
278 **/
279 typedef
280 UINT64
281 (EFIAPI *PCD_PROTOCOL_GET_EX_64)(
282 IN CONST EFI_GUID *Guid,
283 IN UINTN TokenNumber
284 );
285
286
287
288 /**
289 Retrieves a pointer to a value for a given PCD token.
290
291 Retrieves the current pointer to the buffer for a PCD token number.
292 Do not make any assumptions about the alignment of the pointer that
293 is returned by this function call. If the TokenNumber is invalid,
294 the results are unpredictable.
295
296 @param[in] Guid The token space for the token number.
297 @param[in] TokenNumber The PCD token number.
298
299 @return The pointer to the buffer to be retrived.
300
301 **/
302 typedef
303 VOID *
304 (EFIAPI *PCD_PROTOCOL_GET_EX_POINTER)(
305 IN CONST EFI_GUID *Guid,
306 IN UINTN TokenNumber
307 );
308
309
310
311 /**
312 Retrieves an Boolean value for a given PCD token.
313
314 Retrieves the Boolean value of a particular PCD token.
315 If the TokenNumber is invalid or the token space
316 specified by Guid does not exist, the results are
317 unpredictable.
318
319 @param[in] Guid The token space for the token number.
320 @param[in] TokenNumber The PCD token number.
321
322 @return The size Boolean value for the PCD token.
323
324 **/
325 typedef
326 BOOLEAN
327 (EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN)(
328 IN CONST EFI_GUID *Guid,
329 IN UINTN TokenNumber
330 );
331
332
333
334 /**
335 Retrieves the size of the value for a given PCD token.
336
337 Retrieves the current size of a particular PCD token.
338 If the TokenNumber is invalid, the results are unpredictable.
339
340 @param[in] Guid The token space for the token number.
341 @param[in] TokenNumber The PCD token number.
342
343 @return The size of the value for the PCD token.
344
345 **/
346 typedef
347 UINTN
348 (EFIAPI *PCD_PROTOCOL_GET_EX_SIZE)(
349 IN CONST EFI_GUID *Guid,
350 IN UINTN TokenNumber
351 );
352
353
354
355 /**
356 Sets an 8-bit value for a given PCD token.
357
358 When the PCD service sets a value, it will check to ensure that the
359 size of the value being set is compatible with the Token's existing definition.
360 If it is not, an error will be returned.
361
362 @param[in] TokenNumber The PCD token number.
363 @param[in] Value The value to set for the PCD token.
364
365 @retval EFI_SUCCESS Procedure returned successfully.
366 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
367 being set was incompatible with a call to this function.
368 Use GetSize() to retrieve the size of the target data.
369 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
370
371 **/
372 typedef
373 EFI_STATUS
374 (EFIAPI *PCD_PROTOCOL_SET8)(
375 IN UINTN TokenNumber,
376 IN UINT8 Value
377 );
378
379
380
381 /**
382 Sets an 16-bit value for a given PCD token.
383
384 When the PCD service sets a value, it will check to ensure that the
385 size of the value being set is compatible with the Token's existing definition.
386 If it is not, an error will be returned.
387
388 @param[in] TokenNumber The PCD token number.
389 @param[in] Value The value to set for the PCD token.
390
391 @retval EFI_SUCCESS Procedure returned successfully.
392 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
393 being set was incompatible with a call to this function.
394 Use GetSize() to retrieve the size of the target data.
395 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
396
397 **/
398 typedef
399 EFI_STATUS
400 (EFIAPI *PCD_PROTOCOL_SET16)(
401 IN UINTN TokenNumber,
402 IN UINT16 Value
403 );
404
405
406
407 /**
408 Sets an 32-bit value for a given PCD token.
409
410 When the PCD service sets a value, it will check to ensure that the
411 size of the value being set is compatible with the Token's existing definition.
412 If it is not, an error will be returned.
413
414 @param[in] TokenNumber The PCD token number.
415 @param[in] Value The value to set for the PCD token.
416
417 @retval EFI_SUCCESS Procedure returned successfully.
418 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
419 being set was incompatible with a call to this function.
420 Use GetSize() to retrieve the size of the target data.
421 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
422
423 **/
424 typedef
425 EFI_STATUS
426 (EFIAPI *PCD_PROTOCOL_SET32)(
427 IN UINTN TokenNumber,
428 IN UINT32 Value
429 );
430
431
432
433 /**
434 Sets an 64-bit value for a given PCD token.
435
436 When the PCD service sets a value, it will check to ensure that the
437 size of the value being set is compatible with the Token's existing definition.
438 If it is not, an error will be returned.
439
440 @param[in] TokenNumber The PCD token number.
441 @param[in] Value The value to set for the PCD token.
442
443 @retval EFI_SUCCESS Procedure returned successfully.
444 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
445 being set was incompatible with a call to this function.
446 Use GetSize() to retrieve the size of the target data.
447 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
448
449 **/
450 typedef
451 EFI_STATUS
452 (EFIAPI *PCD_PROTOCOL_SET64)(
453 IN UINTN TokenNumber,
454 IN UINT64 Value
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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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.
693 Firstly, it notifies the module which did the registration that the value
694 of this PCD token has been set. Secondly, it provides a mechanism for the
695 module which did the registration to intercept the set operation and override
696 the value been set if necessary. After the invocation of the callback function,
697 TokenData will be used by PCD service DXE driver to modify the internal data in
698 PCD database.
699
700 @param[in] CallBackGuid The PCD token GUID being set.
701 @param[in] CallBackToken The PCD token number being set.
702 @param[in, out] TokenData A pointer to the token data being set.
703 @param[in] TokenDataSize The size, in bytes, of the data being set.
704
705 @retval VOID
706
707 **/
708 typedef
709 VOID
710 (EFIAPI *PCD_PROTOCOL_CALLBACK)(
711 IN CONST EFI_GUID *CallBackGuid, OPTIONAL
712 IN UINTN CallBackToken,
713 IN OUT VOID *TokenData,
714 IN UINTN TokenDataSize
715 );
716
717
718
719 /**
720 Specifies a function to be called anytime the value of a designated token is changed.
721
722 @param[in] TokenNumber The PCD token number.
723 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
724 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
725
726 @retval EFI_SUCCESS The PCD service has successfully established a call event
727 for the CallBackToken requested.
728 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
729
730 **/
731 typedef
732 EFI_STATUS
733 (EFIAPI *PCD_PROTOCOL_CALLBACK_ONSET)(
734 IN CONST EFI_GUID *Guid, OPTIONAL
735 IN UINTN TokenNumber,
736 IN PCD_PROTOCOL_CALLBACK CallBackFunction
737 );
738
739
740
741 /**
742 Cancels a previously set callback function for a particular PCD token number.
743
744 @param[in] TokenNumber The PCD token number.
745 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
746 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
747
748 @retval EFI_SUCCESS The PCD service has successfully established a call event
749 for the CallBackToken requested.
750 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
751
752 **/
753 typedef
754 EFI_STATUS
755 (EFIAPI *PCD_PROTOCOL_CANCEL_CALLBACK)(
756 IN CONST EFI_GUID *Guid, OPTIONAL
757 IN UINTN TokenNumber,
758 IN PCD_PROTOCOL_CALLBACK CallBackFunction
759 );
760
761
762
763 /**
764 Retrieves the next valid PCD token for a given namespace.
765
766 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
767 @param[in,out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
768 If the input token namespace or token number does not exist on the platform,
769 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
770 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
771 there is no valid token number for this token namespace, *TokenNumber will be assigned to
772 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
773 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
774
775 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
776 is already the last valid token number in the PCD database.
777 In the later case, *TokenNumber is updated with the value of 0.
778 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
779
780 **/
781 typedef
782 EFI_STATUS
783 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN)(
784 IN CONST EFI_GUID *Guid, OPTIONAL
785 IN OUT UINTN *TokenNumber
786 );
787
788
789
790 /**
791 Retrieves the next valid PCD token namespace for a given namespace.
792
793 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
794 a known token namespace from which the search will start. On output,
795 it designates the next valid token namespace on the platform. If the input
796 token namespace does not exist on the platform, an error is returned and
797 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
798 first token space of the current platform is assigned to *Guid the function
799 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
800 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
801 and the function return EFI_SUCCESS. If this input token namespace is the last
802 namespace on the platform, *Guid will be assigned to NULL and the function return
803 EFI_SUCCESS.
804
805 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
806 Or the input token space Guid is already the last valid token space Guid
807 in the PCD database. In the later case, *Guid is updated with the value of 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_PROTOCOL_GET_NEXT_TOKENSPACE)(
814 IN OUT CONST EFI_GUID **Guid
815 );
816
817
818
819 //
820 // Interface structure for the PCD Protocol
821 //
822 typedef struct {
823 PCD_PROTOCOL_SET_SKU SetSku;
824
825 PCD_PROTOCOL_GET8 Get8;
826 PCD_PROTOCOL_GET16 Get16;
827 PCD_PROTOCOL_GET32 Get32;
828 PCD_PROTOCOL_GET64 Get64;
829 PCD_PROTOCOL_GET_POINTER GetPtr;
830 PCD_PROTOCOL_GET_BOOLEAN GetBool;
831 PCD_PROTOCOL_GET_SIZE GetSize;
832
833 PCD_PROTOCOL_GET_EX_8 Get8Ex;
834 PCD_PROTOCOL_GET_EX_16 Get16Ex;
835 PCD_PROTOCOL_GET_EX_32 Get32Ex;
836 PCD_PROTOCOL_GET_EX_64 Get64Ex;
837 PCD_PROTOCOL_GET_EX_POINTER GetPtrEx;
838 PCD_PROTOCOL_GET_EX_BOOLEAN GetBoolEx;
839 PCD_PROTOCOL_GET_EX_SIZE GetSizeEx;
840
841 PCD_PROTOCOL_SET8 Set8;
842 PCD_PROTOCOL_SET16 Set16;
843 PCD_PROTOCOL_SET32 Set32;
844 PCD_PROTOCOL_SET64 Set64;
845 PCD_PROTOCOL_SET_POINTER SetPtr;
846 PCD_PROTOCOL_SET_BOOLEAN SetBool;
847
848 PCD_PROTOCOL_SET_EX_8 Set8Ex;
849 PCD_PROTOCOL_SET_EX_16 Set16Ex;
850 PCD_PROTOCOL_SET_EX_32 Set32Ex;
851 PCD_PROTOCOL_SET_EX_64 Set64Ex;
852 PCD_PROTOCOL_SET_EX_POINTER SetPtrEx;
853 PCD_PROTOCOL_SET_EX_BOOLEAN SetBoolEx;
854
855 PCD_PROTOCOL_CALLBACK_ONSET CallbackOnSet;
856 PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback;
857 PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken;
858 PCD_PROTOCOL_GET_NEXT_TOKENSPACE GetNextTokenSpace;
859 } PCD_PROTOCOL;
860
861 #endif