]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Pcd.h
Add [in,out] in the @param for PCD header and c file.
[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 Module Name: Pcd.h
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 @retval VOID
49
50 **/
51 typedef
52 VOID
53 (EFIAPI *PCD_PROTOCOL_SET_SKU) (
54 IN UINTN SkuId
55 );
56
57
58
59 /**
60 Retrieves an 8-bit value for a given PCD token.
61
62 Retrieves the current byte-sized value for a PCD token number.
63 If the TokenNumber is invalid, the results are unpredictable.
64
65 @param[in] TokenNumber The PCD token number.
66
67 @return The UINT8 value.
68
69 **/
70 typedef
71 UINT8
72 (EFIAPI *PCD_PROTOCOL_GET8) (
73 IN UINTN TokenNumber
74 );
75
76
77
78 /**
79 Retrieves an 16-bit value for a given PCD token.
80
81 Retrieves the current 16-bits value for a PCD token number.
82 If the TokenNumber is invalid, the results are unpredictable.
83
84 @param[in] TokenNumber The PCD token number.
85
86 @return The UINT16 value.
87
88 **/
89 typedef
90 UINT16
91 (EFIAPI *PCD_PROTOCOL_GET16) (
92 IN UINTN TokenNumber
93 );
94
95
96
97 /**
98 Retrieves an 32-bit value for a given PCD token.
99
100 Retrieves the current 32-bits value for a PCD token number.
101 If the TokenNumber is invalid, the results are unpredictable.
102
103 @param[in] TokenNumber The PCD token number.
104
105 @return The UINT32 value.
106
107 **/
108 typedef
109 UINT32
110 (EFIAPI *PCD_PROTOCOL_GET32) (
111 IN UINTN TokenNumber
112 );
113
114
115
116 /**
117 Retrieves an 64-bit value for a given PCD token.
118
119 Retrieves the current 64-bits value for a PCD token number.
120 If the TokenNumber is invalid, the results are unpredictable.
121
122 @param[in] TokenNumber The PCD token number.
123
124 @return The UINT64 value.
125
126 **/
127 typedef
128 UINT64
129 (EFIAPI *PCD_PROTOCOL_GET64) (
130 IN UINTN TokenNumber
131 );
132
133
134
135 /**
136 Retrieves a pointer to a value for a given PCD token.
137
138 Retrieves the current pointer to the buffer for a PCD token number.
139 Do not make any assumptions about the alignment of the pointer that
140 is returned by this function call. If the TokenNumber is invalid,
141 the results are unpredictable.
142
143 @param[in] TokenNumber The PCD token number.
144
145 @return The pointer to the buffer to be retrived.
146
147 **/
148 typedef
149 VOID *
150 (EFIAPI *PCD_PROTOCOL_GET_POINTER) (
151 IN UINTN TokenNumber
152 );
153
154
155
156 /**
157 Retrieves a Boolean value for a given PCD token.
158
159 Retrieves the current boolean value for a PCD token number.
160 Do not make any assumptions about the alignment of the pointer that
161 is returned by this function call. If the TokenNumber is invalid,
162 the results are unpredictable.
163
164 @param[in] TokenNumber The PCD token number.
165
166 @return The Boolean value.
167
168 **/
169 typedef
170 BOOLEAN
171 (EFIAPI *PCD_PROTOCOL_GET_BOOLEAN) (
172 IN UINTN TokenNumber
173 );
174
175
176
177 /**
178 Retrieves the size of the value for a given PCD token.
179
180 Retrieves the current size of a particular PCD token.
181 If the TokenNumber is invalid, the results are unpredictable.
182
183 @param[in] TokenNumber The PCD token number.
184
185 @return The size of the value for the PCD token.
186
187 **/
188 typedef
189 UINTN
190 (EFIAPI *PCD_PROTOCOL_GET_SIZE) (
191 IN UINTN TokenNumber
192 );
193
194
195
196 /**
197 Retrieves an 8-bit value for a given PCD token.
198
199 Retrieves the 8-bit value of a particular PCD token.
200 If the TokenNumber is invalid or the token space
201 specified by Guid does not exist, the results are
202 unpredictable.
203
204 @param[in] Guid The token space for the token number.
205 @param[in] TokenNumber The PCD token number.
206
207 @return The size 8-bit value for the PCD token.
208
209 **/
210 typedef
211 UINT8
212 (EFIAPI *PCD_PROTOCOL_GET_EX_8) (
213 IN CONST EFI_GUID *Guid,
214 IN UINTN TokenNumber
215 );
216
217
218
219 /**
220 Retrieves an 16-bit value for a given PCD token.
221
222 Retrieves the 16-bit value of a particular PCD token.
223 If the TokenNumber is invalid or the token space
224 specified by Guid does not exist, the results are
225 unpredictable.
226
227 @param[in] Guid The token space for the token number.
228 @param[in] TokenNumber The PCD token number.
229
230 @return The size 16-bit value for the PCD token.
231
232 **/
233 typedef
234 UINT16
235 (EFIAPI *PCD_PROTOCOL_GET_EX_16) (
236 IN CONST EFI_GUID *Guid,
237 IN UINTN TokenNumber
238 );
239
240
241
242 /**
243 Retrieves an 32-bit value for a given PCD token.
244
245 Retrieves the 32-bit value of a particular PCD token.
246 If the TokenNumber is invalid or the token space
247 specified by Guid does not exist, the results are
248 unpredictable.
249
250 @param[in] Guid The token space for the token number.
251 @param[in] TokenNumber The PCD token number.
252
253 @return The size 32-bit value for the PCD token.
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 retrived.
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 an 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 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 an 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 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 an 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 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 an 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 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 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 an 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 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 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 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 an 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 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 an 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 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 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 an 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 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 which did the registration to intercept the set operation and override
695 the value 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 PCD token for a given namespace.
764
765 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
766 @param[in,out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
767 If the input token namespace or token number does not exist on the platform,
768 an error is returned and the value of *TokenNumber is undefined. To retrieve the ¡°first¡± token,
769 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and
770 there is no valid token number for this token namespace, *TokenNumber will be assigned to
771 0 and the function return EFI_SUCCESS. If the token number is the last valid token number,
772 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.
773
774 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number
775 is already the last valid token number in the PCD database.
776 In the later case, *TokenNumber is updated with the value of 0.
777 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
778
779 **/
780 typedef
781 EFI_STATUS
782 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN) (
783 IN CONST EFI_GUID *Guid, OPTIONAL
784 IN OUT UINTN *TokenNumber
785 );
786
787
788
789 /**
790 Retrieves the next valid PCD token namespace for a given namespace.
791
792 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates
793 a known token namespace from which the search will start. On output,
794 it designates the next valid token namespace on the platform. If the input
795 token namespace does not exist on the platform, an error is returned and
796 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
797 first token space of the current platform is assigned to *Guid the function
798 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in
799 the platform other than the default (NULL) tokennamespace, *Guid is unchanged
800 and the function return EFI_SUCCESS. If this input token namespace is the last
801 namespace on the platform, *Guid will be assigned to NULL and the function return
802 EFI_SUCCESS.
803
804 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid.
805 Or the input token space Guid is already the last valid token space Guid
806 in the PCD database. In the later case, *Guid is updated with the value of NULL.
807 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
808
809 **/
810 typedef
811 EFI_STATUS
812 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKENSPACE) (
813 IN OUT CONST EFI_GUID **Guid
814 );
815
816
817
818 //
819 // Interface structure for the PCD Protocol
820 //
821 typedef struct {
822 PCD_PROTOCOL_SET_SKU SetSku;
823
824 PCD_PROTOCOL_GET8 Get8;
825 PCD_PROTOCOL_GET16 Get16;
826 PCD_PROTOCOL_GET32 Get32;
827 PCD_PROTOCOL_GET64 Get64;
828 PCD_PROTOCOL_GET_POINTER GetPtr;
829 PCD_PROTOCOL_GET_BOOLEAN GetBool;
830 PCD_PROTOCOL_GET_SIZE GetSize;
831
832 PCD_PROTOCOL_GET_EX_8 Get8Ex;
833 PCD_PROTOCOL_GET_EX_16 Get16Ex;
834 PCD_PROTOCOL_GET_EX_32 Get32Ex;
835 PCD_PROTOCOL_GET_EX_64 Get64Ex;
836 PCD_PROTOCOL_GET_EX_POINTER GetPtrEx;
837 PCD_PROTOCOL_GET_EX_BOOLEAN GetBoolEx;
838 PCD_PROTOCOL_GET_EX_SIZE GetSizeEx;
839
840 PCD_PROTOCOL_SET8 Set8;
841 PCD_PROTOCOL_SET16 Set16;
842 PCD_PROTOCOL_SET32 Set32;
843 PCD_PROTOCOL_SET64 Set64;
844 PCD_PROTOCOL_SET_POINTER SetPtr;
845 PCD_PROTOCOL_SET_BOOLEAN SetBool;
846
847 PCD_PROTOCOL_SET_EX_8 Set8Ex;
848 PCD_PROTOCOL_SET_EX_16 Set16Ex;
849 PCD_PROTOCOL_SET_EX_32 Set32Ex;
850 PCD_PROTOCOL_SET_EX_64 Set64Ex;
851 PCD_PROTOCOL_SET_EX_POINTER SetPtrEx;
852 PCD_PROTOCOL_SET_EX_BOOLEAN SetBoolEx;
853
854 PCD_PROTOCOL_CALLBACK_ONSET CallbackOnSet;
855 PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback;
856 PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken;
857 PCD_PROTOCOL_GET_NEXT_TOKENSPACE GetNextTokenSpace;
858 } PCD_PROTOCOL;
859
860 #endif