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