update comments per review comments.
[edk2.git] / MdePkg / Include / Protocol / Pcd.h
blobdb3b2b1f0dba168c51fc5fd5a47c31548c300beb
1 /** @file
2 Platform Configuration Database (PCD) Protocol
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
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.
13 **/
15 #ifndef __PCD_H__
16 #define __PCD_H__
18 extern EFI_GUID gPcdProtocolGuid;
20 #define PCD_PROTOCOL_GUID \
21 { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }
23 #define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
26 /**
27 Sets the SKU value for subsequent calls to set or get PCD token values.
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.
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.
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.
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.
47 **/
48 typedef
49 VOID
50 (EFIAPI *PCD_PROTOCOL_SET_SKU)(
51 IN UINTN SkuId
56 /**
57 Retrieves an 8-bit value for a given PCD token.
59 Retrieves the current byte-sized value for a PCD token number.
60 If the TokenNumber is invalid, the results are unpredictable.
62 @param[in] TokenNumber The PCD token number.
64 @return The UINT8 value.
66 **/
67 typedef
68 UINT8
69 (EFIAPI *PCD_PROTOCOL_GET8)(
70 IN UINTN TokenNumber
75 /**
76 Retrieves a 16-bit value for a given PCD token.
78 Retrieves the current 16-bit value for a PCD token number.
79 If the TokenNumber is invalid, the results are unpredictable.
81 @param[in] TokenNumber The PCD token number.
83 @return The UINT16 value.
85 **/
86 typedef
87 UINT16
88 (EFIAPI *PCD_PROTOCOL_GET16)(
89 IN UINTN TokenNumber
94 /**
95 Retrieves a 32-bit value for a given PCD token.
97 Retrieves the current 32-bit value for a PCD token number.
98 If the TokenNumber is invalid, the results are unpredictable.
100 @param[in] TokenNumber The PCD token number.
102 @return The UINT32 value.
105 typedef
106 UINT32
107 (EFIAPI *PCD_PROTOCOL_GET32)(
108 IN UINTN TokenNumber
114 Retrieves a 64-bit value for a given PCD token.
116 Retrieves the current 64-bit value for a PCD token number.
117 If the TokenNumber is invalid, the results are unpredictable.
119 @param[in] TokenNumber The PCD token number.
121 @return The UINT64 value.
124 typedef
125 UINT64
126 (EFIAPI *PCD_PROTOCOL_GET64)(
127 IN UINTN TokenNumber
133 Retrieves a pointer to a value for a given PCD token.
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.
140 @param[in] TokenNumber The PCD token number.
142 @return The pointer to the buffer to be retrived.
145 typedef
146 VOID *
147 (EFIAPI *PCD_PROTOCOL_GET_POINTER)(
148 IN UINTN TokenNumber
154 Retrieves a Boolean value for a given PCD token.
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.
161 @param[in] TokenNumber The PCD token number.
163 @return The Boolean value.
166 typedef
167 BOOLEAN
168 (EFIAPI *PCD_PROTOCOL_GET_BOOLEAN)(
169 IN UINTN TokenNumber
175 Retrieves the size of the value for a given PCD token.
177 Retrieves the current size of a particular PCD token.
178 If the TokenNumber is invalid, the results are unpredictable.
180 @param[in] TokenNumber The PCD token number.
182 @return The size of the value for the PCD token.
185 typedef
186 UINTN
187 (EFIAPI *PCD_PROTOCOL_GET_SIZE)(
188 IN UINTN TokenNumber
194 Retrieves an 8-bit value for a given PCD token.
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.
201 @param[in] Guid The token space for the token number.
202 @param[in] TokenNumber The PCD token number.
204 @return The size 8-bit value for the PCD token.
207 typedef
208 UINT8
209 (EFIAPI *PCD_PROTOCOL_GET_EX_8)(
210 IN CONST EFI_GUID *Guid,
211 IN UINTN TokenNumber
217 Retrieves a 16-bit value for a given PCD token.
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.
224 @param[in] Guid The token space for the token number.
225 @param[in] TokenNumber The PCD token number.
227 @return The size 16-bit value for the PCD token.
230 typedef
231 UINT16
232 (EFIAPI *PCD_PROTOCOL_GET_EX_16)(
233 IN CONST EFI_GUID *Guid,
234 IN UINTN TokenNumber
240 Retrieves a 32-bit value for a given PCD token.
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.
247 @param[in] Guid The token space for the token number.
248 @param[in] TokenNumber The PCD token number.
250 @return The size 32-bit value for the PCD token.
253 typedef
254 UINT32
255 (EFIAPI *PCD_PROTOCOL_GET_EX_32)(
256 IN CONST EFI_GUID *Guid,
257 IN UINTN TokenNumber
263 Retrieves an 64-bit value for a given PCD token.
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.
270 @param[in] Guid The token space for the token number.
271 @param[in] TokenNumber The PCD token number.
273 @return The size 64-bit value for the PCD token.
276 typedef
277 UINT64
278 (EFIAPI *PCD_PROTOCOL_GET_EX_64)(
279 IN CONST EFI_GUID *Guid,
280 IN UINTN TokenNumber
286 Retrieves a pointer to a value for a given PCD token.
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.
293 @param[in] Guid The token space for the token number.
294 @param[in] TokenNumber The PCD token number.
296 @return The pointer to the buffer to be retrieved.
299 typedef
300 VOID *
301 (EFIAPI *PCD_PROTOCOL_GET_EX_POINTER)(
302 IN CONST EFI_GUID *Guid,
303 IN UINTN TokenNumber
309 Retrieves a Boolean value for a given PCD token.
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.
316 @param[in] Guid The token space for the token number.
317 @param[in] TokenNumber The PCD token number.
319 @return The size Boolean value for the PCD token.
322 typedef
323 BOOLEAN
324 (EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN)(
325 IN CONST EFI_GUID *Guid,
326 IN UINTN TokenNumber
332 Retrieves the size of the value for a given PCD token.
334 Retrieves the current size of a particular PCD token.
335 If the TokenNumber is invalid, the results are unpredictable.
337 @param[in] Guid The token space for the token number.
338 @param[in] TokenNumber The PCD token number.
340 @return The size of the value for the PCD token.
343 typedef
344 UINTN
345 (EFIAPI *PCD_PROTOCOL_GET_EX_SIZE)(
346 IN CONST EFI_GUID *Guid,
347 IN UINTN TokenNumber
353 Sets an 8-bit value for a given PCD token.
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.
359 @param[in] TokenNumber The PCD token number.
360 @param[in] Value The value to set for the PCD token.
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.
369 typedef
370 EFI_STATUS
371 (EFIAPI *PCD_PROTOCOL_SET8)(
372 IN UINTN TokenNumber,
373 IN UINT8 Value
379 Sets a 16-bit value for a given PCD token.
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.
385 @param[in] TokenNumber The PCD token number.
386 @param[in] Value The value to set for the PCD token.
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.
395 typedef
396 EFI_STATUS
397 (EFIAPI *PCD_PROTOCOL_SET16)(
398 IN UINTN TokenNumber,
399 IN UINT16 Value
405 Sets a 32-bit value for a given PCD token.
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.
411 @param[in] TokenNumber The PCD token number.
412 @param[in] Value The value to set for the PCD token.
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.
421 typedef
422 EFI_STATUS
423 (EFIAPI *PCD_PROTOCOL_SET32)(
424 IN UINTN TokenNumber,
425 IN UINT32 Value
431 Sets a 64-bit value for a given PCD token.
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.
437 @param[in] TokenNumber The PCD token number.
438 @param[in] Value The value to set for the PCD token.
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.
447 typedef
448 EFI_STATUS
449 (EFIAPI *PCD_PROTOCOL_SET64)(
450 IN UINTN TokenNumber,
451 IN UINT64 Value
457 Sets a value of a specified size for a given PCD token.
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.
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.
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.
477 typedef
478 EFI_STATUS
479 (EFIAPI *PCD_PROTOCOL_SET_POINTER)(
480 IN UINTN TokenNumber,
481 IN OUT UINTN *SizeOfBuffer,
482 IN VOID *Buffer
488 Sets a Boolean value for a given PCD token.
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.
494 @param[in] TokenNumber The PCD token number.
495 @param[in] Value The value to set for the PCD token.
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.
504 typedef
505 EFI_STATUS
506 (EFIAPI *PCD_PROTOCOL_SET_BOOLEAN)(
507 IN UINTN TokenNumber,
508 IN BOOLEAN Value
514 Sets an 8-bit value for a given PCD token.
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.
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.
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.
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
542 Sets an 16-bit value for a given PCD token.
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.
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.
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.
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
570 Sets a 32-bit value for a given PCD token.
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.
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.
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.
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
598 Sets a 64-bit value for a given PCD token.
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.
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.
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.
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
626 Sets a value of a specified size for a given PCD token.
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.
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.
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.
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
659 Sets a Boolean value for a given PCD token.
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.
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.
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.
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
687 Callback on SET function prototype definition.
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.
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.
702 @retval VOID
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
717 Specifies a function to be called anytime the value of a designated token is changed.
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.
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.
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
739 Cancels a previously set callback function for a particular PCD token number.
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.
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.
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
761 Retrieves the next valid token number in a given namespace.
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.
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.
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.
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.
788 typedef
789 EFI_STATUS
790 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN)(
791 IN CONST EFI_GUID *Guid, OPTIONAL
792 IN OUT UINTN *TokenNumber
798 Retrieves the next valid PCD token namespace for a given namespace.
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.
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.
818 typedef
819 EFI_STATUS
820 (EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKENSPACE)(
821 IN OUT CONST EFI_GUID **Guid
825 /// This service abstracts the ability to set/get Platform Configuration Database (PCD).
827 typedef struct {
828 PCD_PROTOCOL_SET_SKU SetSku;
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;
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;
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;
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;
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;
866 #endif