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