]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Pcd.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / Pcd.h
1 /** @file
2 Native Platform Configuration Database (PCD) Protocol
3
4 Different with the EFI_PCD_PROTOCOL defined in PI 1.2 specification, the native
5 PCD protocol provide interfaces for dynamic and dynamic-ex type PCD.
6 The interfaces in dynamic type PCD do not require the token space guid as parameter,
7 but interfaces in dynamic-ex type PCD require token space guid as parameter.
8
9 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
11
12 @par Revision Reference:
13 This Protocol was introduced in PI Specification 1.2.
14
15 **/
16
17 #ifndef __PCD_H__
18 #define __PCD_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
49 **/
50 typedef
51 VOID
52 (EFIAPI *PCD_PROTOCOL_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_PROTOCOL_GET8)(
72 IN UINTN TokenNumber
73 );
74
75
76
77 /**
78 Retrieves a 16-bit value for a given PCD token.
79
80 Retrieves the current 16-bit 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_PROTOCOL_GET16)(
91 IN UINTN TokenNumber
92 );
93
94
95
96 /**
97 Retrieves a 32-bit value for a given PCD token.
98
99 Retrieves the current 32-bit 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_PROTOCOL_GET32)(
110 IN UINTN TokenNumber
111 );
112
113
114
115 /**
116 Retrieves a 64-bit value for a given PCD token.
117
118 Retrieves the current 64-bit 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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_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_PROTOCOL_GET_SIZE)(
190 IN UINTN TokenNumber
191 );
192
193
194
195 /**
196 Retrieves an 8-bit value for a given PCD token.
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_PROTOCOL_GET_EX_8)(
212 IN CONST EFI_GUID *Guid,
213 IN UINTN TokenNumber
214 );
215
216
217
218 /**
219 Retrieves a 16-bit value for a given PCD token.
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_PROTOCOL_GET_EX_16)(
235 IN CONST EFI_GUID *Guid,
236 IN UINTN TokenNumber
237 );
238
239
240
241 /**
242 Retrieves a 32-bit value for a given PCD token.
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_PROTOCOL_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.
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_PROTOCOL_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.
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 retrieved.
299
300 **/
301 typedef
302 VOID *
303 (EFIAPI *PCD_PROTOCOL_GET_EX_POINTER)(
304 IN CONST EFI_GUID *Guid,
305 IN UINTN TokenNumber
306 );
307
308
309
310 /**
311 Retrieves a Boolean value for a given PCD token.
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_PROTOCOL_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.
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_PROTOCOL_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 The 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_PROTOCOL_SET8)(
374 IN UINTN TokenNumber,
375 IN UINT8 Value
376 );
377
378
379
380 /**
381 Sets a 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 The 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_PROTOCOL_SET16)(
400 IN UINTN TokenNumber,
401 IN UINT16 Value
402 );
403
404
405
406 /**
407 Sets a 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 The 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_PROTOCOL_SET32)(
426 IN UINTN TokenNumber,
427 IN UINT32 Value
428 );
429
430
431
432 /**
433 Sets a 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 The 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_PROTOCOL_SET64)(
452 IN UINTN TokenNumber,
453 IN UINT64 Value
454 );
455
456
457
458 /**
459 Sets a value of a specified size for a given PCD token.
460
461 When the PCD service sets a value, it will check to ensure that the
462 size of the value being set is compatible with the Token's existing definition.
463 If it is not, an error will be returned.
464
465 @param[in] TokenNumber The PCD token number.
466 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
467 On input, if the SizeOfValue is greater than the maximum size supported
468 for this TokenNumber then the output value of SizeOfValue will reflect
469 the maximum size supported for this TokenNumber.
470 @param[in] Buffer The buffer to set for the PCD token.
471
472 @retval EFI_SUCCESS The procedure returned successfully.
473 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
474 being set was incompatible with a call to this function.
475 Use GetSize() to retrieve the size of the target data.
476 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
477
478 **/
479 typedef
480 EFI_STATUS
481 (EFIAPI *PCD_PROTOCOL_SET_POINTER)(
482 IN UINTN TokenNumber,
483 IN OUT UINTN *SizeOfBuffer,
484 IN VOID *Buffer
485 );
486
487
488
489 /**
490 Sets a Boolean value for a given PCD token.
491
492 When the PCD service sets a value, it will check to ensure that the
493 size of the value being set is compatible with the Token's existing definition.
494 If it is not, an error will be returned.
495
496 @param[in] TokenNumber The PCD token number.
497 @param[in] Value The value to set for the PCD token.
498
499 @retval EFI_SUCCESS The procedure returned successfully.
500 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
501 being set was incompatible with a call to this function.
502 Use GetSize() to retrieve the size of the target data.
503 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
504
505 **/
506 typedef
507 EFI_STATUS
508 (EFIAPI *PCD_PROTOCOL_SET_BOOLEAN)(
509 IN UINTN TokenNumber,
510 IN BOOLEAN Value
511 );
512
513
514
515 /**
516 Sets an 8-bit value for a given PCD token.
517
518 When the PCD service sets a value, it will check to ensure that the
519 size of the value being set is compatible with the Token's existing definition.
520 If it is not, an error will be returned.
521
522 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
523 @param[in] TokenNumber The PCD token number.
524 @param[in] Value The value to set for the PCD token.
525
526 @retval EFI_SUCCESS The procedure returned successfully.
527 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
528 being set was incompatible with a call to this function.
529 Use GetSize() to retrieve the size of the target data.
530 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
531
532 **/
533 typedef
534 EFI_STATUS
535 (EFIAPI *PCD_PROTOCOL_SET_EX_8)(
536 IN CONST EFI_GUID *Guid,
537 IN UINTN TokenNumber,
538 IN UINT8 Value
539 );
540
541
542
543 /**
544 Sets an 16-bit value for a given PCD token.
545
546 When the PCD service sets a value, it will check to ensure that the
547 size of the value being set is compatible with the Token's existing definition.
548 If it is not, an error will be returned.
549
550 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
551 @param[in] TokenNumber The PCD token number.
552 @param[in] Value The value to set for the PCD token.
553
554 @retval EFI_SUCCESS The procedure returned successfully.
555 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
556 being set was incompatible with a call to this function.
557 Use GetSize() to retrieve the size of the target data.
558 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
559
560 **/
561 typedef
562 EFI_STATUS
563 (EFIAPI *PCD_PROTOCOL_SET_EX_16)(
564 IN CONST EFI_GUID *Guid,
565 IN UINTN TokenNumber,
566 IN UINT16 Value
567 );
568
569
570
571 /**
572 Sets a 32-bit value for a given PCD token.
573
574 When the PCD service sets a value, it will check to ensure that the
575 size of the value being set is compatible with the Token's existing definition.
576 If it is not, an error will be returned.
577
578 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
579 @param[in] TokenNumber The PCD token number.
580 @param[in] Value The value to set for the PCD token.
581
582 @retval EFI_SUCCESS The procedure returned successfully.
583 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
584 being set was incompatible with a call to this function.
585 Use GetSize() to retrieve the size of the target data.
586 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
587
588 **/
589 typedef
590 EFI_STATUS
591 (EFIAPI *PCD_PROTOCOL_SET_EX_32)(
592 IN CONST EFI_GUID *Guid,
593 IN UINTN TokenNumber,
594 IN UINT32 Value
595 );
596
597
598
599 /**
600 Sets a 64-bit value for a given PCD token.
601
602 When the PCD service sets a value, it will check to ensure that the
603 size of the value being set is compatible with the Token's existing definition.
604 If it is not, an error will be returned.
605
606 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
607 @param[in] TokenNumber The PCD token number.
608 @param[in] Value The value to set for the PCD token.
609
610 @retval EFI_SUCCESS The procedure returned successfully.
611 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
612 being set was incompatible with a call to this function.
613 Use GetSize() to retrieve the size of the target data.
614 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
615
616 **/
617 typedef
618 EFI_STATUS
619 (EFIAPI *PCD_PROTOCOL_SET_EX_64)(
620 IN CONST EFI_GUID *Guid,
621 IN UINTN TokenNumber,
622 IN UINT64 Value
623 );
624
625
626
627 /**
628 Sets a value of a specified size for a given PCD token.
629
630 When the PCD service sets a value, it will check to ensure that the
631 size of the value being set is compatible with the Token's existing definition.
632 If it is not, an error will be returned.
633
634 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
635 @param[in] TokenNumber The PCD token number.
636 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
637 On input, if the SizeOfValue is greater than the maximum size supported
638 for this TokenNumber then the output value of SizeOfValue will reflect
639 the maximum size supported for this TokenNumber.
640 @param[in] Buffer The buffer to set for the PCD token.
641
642 @retval EFI_SUCCESS The procedure returned successfully.
643 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
644 being set was incompatible with a call to this function.
645 Use GetSize() to retrieve the size of the target data.
646 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
647
648 **/
649 typedef
650 EFI_STATUS
651 (EFIAPI *PCD_PROTOCOL_SET_EX_POINTER)(
652 IN CONST EFI_GUID *Guid,
653 IN UINTN TokenNumber,
654 IN OUT UINTN *SizeOfBuffer,
655 IN VOID *Buffer
656 );
657
658
659
660 /**
661 Sets a Boolean value for a given PCD token.
662
663 When the PCD service sets a value, it will check to ensure that the
664 size of the value being set is compatible with the Token's existing definition.
665 If it is not, an error will be returned.
666
667 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
668 @param[in] TokenNumber The PCD token number.
669 @param[in] Value The value to set for the PCD token.
670
671 @retval EFI_SUCCESS The procedure returned successfully.
672 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
673 being set was incompatible with a call to this function.
674 Use GetSize() to retrieve the size of the target data.
675 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
676
677 **/
678 typedef
679 EFI_STATUS
680 (EFIAPI *PCD_PROTOCOL_SET_EX_BOOLEAN)(
681 IN CONST EFI_GUID *Guid,
682 IN UINTN TokenNumber,
683 IN BOOLEAN Value
684 );
685
686
687
688 /**
689 Callback on SET function prototype definition.
690
691 This notification function serves two purposes.
692 Firstly, it notifies the module which did the registration that the value
693 of this PCD token has been set. Secondly, it provides a mechanism for the
694 module that did the registration to intercept the set operation and override
695 the value that has been set, if necessary. After the invocation of the callback function,
696 TokenData will be used by PCD service DXE driver to modify the internal data in
697 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_PROTOCOL_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_PROTOCOL_CALLBACK_ONSET)(
733 IN CONST EFI_GUID *Guid, OPTIONAL
734 IN UINTN TokenNumber,
735 IN PCD_PROTOCOL_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_PROTOCOL_CANCEL_CALLBACK)(
755 IN CONST EFI_GUID *Guid, OPTIONAL
756 IN UINTN TokenNumber,
757 IN PCD_PROTOCOL_CALLBACK CallBackFunction
758 );
759
760
761
762 /**
763 Retrieves the next valid token number in a given namespace.
764
765 This is useful since the PCD infrastructure contains a sparse list of token numbers,
766 and one cannot a priori know what token numbers are valid in the database.
767
768 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
769 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
770 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
771 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
772 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
773 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
774 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
775 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
776
777
778 @param[in] Guid The 128-bit unique value that designates the namespace from which to retrieve the next token.
779 This is an optional parameter that may be NULL. If this parameter is NULL, then a request is
780 being made to retrieve tokens from the default token space.
781 @param[in,out] TokenNumber
782 A pointer to the PCD token number to use to find the subsequent token number.
783
784 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.
785 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
786
787 **/
788 typedef
789 EFI_STATUS
790 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN)(
791 IN CONST EFI_GUID *Guid, OPTIONAL
792 IN OUT UINTN *TokenNumber
793 );
794
795
796
797 /**
798 Retrieves the next valid PCD token namespace for a given namespace.
799
800 Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
801 token namespaces on a platform.
802
803 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token namespace
804 from which the search will start. On output, it designates the next valid token
805 namespace on the platform. If *Guid is NULL, then the GUID of the first token
806 space of the current platform is returned. If the search cannot locate the next valid
807 token namespace, an error is returned and the value of *Guid is undefined.
808
809 @retval EFI_SUCCESS The PCD service retrieved the value requested.
810 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
811
812 **/
813 typedef
814 EFI_STATUS
815 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKENSPACE)(
816 IN OUT CONST EFI_GUID **Guid
817 );
818
819 ///
820 /// This service abstracts the ability to set/get Platform Configuration Database (PCD).
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