]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Pcd.h
add a error macro to prevent this file from included for now #error "UEFI 2.1 HII...
[mirror_edk2.git] / MdePkg / Include / Protocol / Pcd.h
1 /** @file
2 Platform Configuration Database (PCD) Protocol
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __PCD_H__
16 #define __PCD_H__
17
18 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 **/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 retrived.
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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 which did the registration to intercept the set operation and override
693 the value 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 PCD token for a given namespace.
762
763 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
764 @param[in,out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
765 If the input token namespace or token number does not exist on the platform,
766 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token,
767 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
768 there is no valid token number for this token namespace, *TokenNumber will be assigned to
769 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
770 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
771
772 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
773 is already the last valid token number in the PCD database.
774 In the later case, *TokenNumber is updated with the value of 0.
775 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
776
777 **/
778 typedef
779 EFI_STATUS
780 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN) (
781 IN CONST EFI_GUID *Guid, OPTIONAL
782 IN OUT UINTN *TokenNumber
783 );
784
785
786
787 /**
788 Retrieves the next valid PCD token namespace for a given namespace.
789
790 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
791 a known token namespace from which the search will start. On output,
792 it designates the next valid token namespace on the platform. If the input
793 token namespace does not exist on the platform, an error is returned and
794 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
795 first token space of the current platform is assigned to *Guid the function
796 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
797 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
798 and the function return EFI_SUCCESS. If this input token namespace is the last
799 namespace on the platform, *Guid will be assigned to NULL and the function return
800 EFI_SUCCESS.
801
802 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
803 Or the input token space Guid is already the last valid token space Guid
804 in the PCD database. In the later case, *Guid is updated with the value of NULL.
805 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
806
807 **/
808 typedef
809 EFI_STATUS
810 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKENSPACE) (
811 IN OUT CONST EFI_GUID **Guid
812 );
813
814
815
816 //
817 // Interface structure for the PCD Protocol
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