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