1 /** @file
2   Native Platform Configuration Database (PCD) INFO PROTOCOL.
3 
4   The protocol that provides additional information about items that reside in the PCD database.
5 
6   Different with the EFI_GET_PCD_INFO_PROTOCOL defined in PI 1.2.1 specification,
7   the native PCD INFO PROTOCOL provide interfaces for dynamic and dynamic-ex type PCD.
8   The interfaces for dynamic type PCD do not require the token space guid as parameter,
9   but interfaces for dynamic-ex type PCD require token space guid as parameter.
10 
11   Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
12   This program and the accompanying materials
13   are licensed and made available under the terms and conditions of the BSD License
14   which accompanies this distribution.  The full text of the license may be found at
15   http://opensource.org/licenses/bsd-license.php
16 
17   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
18   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 
20 **/
21 
22 #ifndef __PCD_INFO_H__
23 #define __PCD_INFO_H__
24 
25 extern EFI_GUID gGetPcdInfoProtocolGuid;
26 
27 #define GET_PCD_INFO_PROTOCOL_GUID \
28   { 0x5be40f57, 0xfa68, 0x4610, { 0xbb, 0xbf, 0xe9, 0xc5, 0xfc, 0xda, 0xd3, 0x65 } }
29 
30 ///
31 /// The forward declaration for GET_PCD_INFO_PROTOCOL.
32 ///
33 typedef struct _GET_PCD_INFO_PROTOCOL  GET_PCD_INFO_PROTOCOL;
34 
35 /**
36   Retrieve additional information associated with a PCD token.
37 
38   This includes information such as the type of value the TokenNumber is associated with as well as possible
39   human readable name that is associated with the token.
40 
41   @param[in]    TokenNumber The PCD token number.
42   @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
43 
44   @retval  EFI_SUCCESS      The PCD information was returned successfully
45   @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.
46 **/
47 typedef
48 EFI_STATUS
49 (EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO) (
50   IN        UINTN           TokenNumber,
51   OUT       EFI_PCD_INFO    *PcdInfo
52 );
53 
54 /**
55   Retrieve additional information associated with a PCD token.
56 
57   This includes information such as the type of value the TokenNumber is associated with as well as possible
58   human readable name that is associated with the token.
59 
60   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.
61   @param[in]    TokenNumber The PCD token number.
62   @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
63 
64   @retval  EFI_SUCCESS      The PCD information was returned successfully
65   @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.
66 **/
67 typedef
68 EFI_STATUS
69 (EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO_EX) (
70   IN CONST  EFI_GUID        *Guid,
71   IN        UINTN           TokenNumber,
72   OUT       EFI_PCD_INFO    *PcdInfo
73 );
74 
75 /**
76   Retrieve the currently set SKU Id.
77 
78   @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the
79             default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
80             Id is returned.
81 **/
82 typedef
83 UINTN
84 (EFIAPI *GET_PCD_INFO_PROTOCOL_GET_SKU) (
85   VOID
86 );
87 
88 ///
89 /// This is the PCD service to use when querying for some additional data that can be contained in the
90 /// PCD database.
91 ///
92 struct _GET_PCD_INFO_PROTOCOL {
93   ///
94   /// Retrieve additional information associated with a PCD.
95   ///
96   GET_PCD_INFO_PROTOCOL_GET_INFO             GetInfo;
97   GET_PCD_INFO_PROTOCOL_GET_INFO_EX          GetInfoEx;
98   ///
99   /// Retrieve the currently set SKU Id.
100   ///
101   GET_PCD_INFO_PROTOCOL_GET_SKU              GetSku;
102 };
103 
104 #endif
105 
106