2b968f0d80335e872e8accb54a703f16ff494326
[mirror_edk2.git] / MdePkg / Include / Ppi / 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 gPcdPpiGuid;
21
22 #define PCD_PPI_GUID \
23 { 0x632df884, 0x8023, 0x4872, { 0xb6, 0x70, 0xb7, 0x4a, 0x30, 0x19, 0x16, 0xe9 } }
24
25 typedef
26 EFI_STATUS
27 (EFIAPI *PCD_PPI_SET_SKU) (
28 IN UINTN SkuId
29 );
30
31 typedef
32 UINT8
33 (EFIAPI *PCD_PPI_GET8) (
34 IN UINTN TokenNumber
35 );
36
37 typedef
38 UINT16
39 (EFIAPI *PCD_PPI_GET16) (
40 IN UINTN TokenNumber
41 );
42
43 typedef
44 UINT32
45 (EFIAPI *PCD_PPI_GET32) (
46 IN UINTN TokenNumber
47 );
48
49 typedef
50 UINT64
51 (EFIAPI *PCD_PPI_GET64) (
52 IN UINTN TokenNumber
53 );
54
55 typedef
56 VOID *
57 (EFIAPI *PCD_PPI_GET_POINTER) (
58 IN UINTN TokenNumber
59 );
60
61 typedef
62 BOOLEAN
63 (EFIAPI *PCD_PPI_GET_BOOLEAN) (
64 IN UINTN TokenNumber
65 );
66
67 typedef
68 UINTN
69 (EFIAPI *PCD_PPI_GET_SIZE) (
70 IN UINTN TokenNumber
71 );
72
73 typedef
74 UINT8
75 (EFIAPI *PCD_PPI_GET_EX_8) (
76 IN CONST EFI_GUID *Guid,
77 IN UINTN TokenNumber
78 );
79
80 typedef
81 UINT16
82 (EFIAPI *PCD_PPI_GET_EX_16) (
83 IN CONST EFI_GUID *Guid,
84 IN UINTN TokenNumber
85 );
86
87 typedef
88 UINT32
89 (EFIAPI *PCD_PPI_GET_EX_32) (
90 IN CONST EFI_GUID *Guid,
91 IN UINTN TokenNumber
92 );
93
94 typedef
95 UINT64
96 (EFIAPI *PCD_PPI_GET_EX_64) (
97 IN CONST EFI_GUID *Guid,
98 IN UINTN TokenNumber
99 );
100
101 typedef
102 VOID *
103 (EFIAPI *PCD_PPI_GET_EX_POINTER) (
104 IN CONST EFI_GUID *Guid,
105 IN UINTN TokenNumber
106 );
107
108 typedef
109 BOOLEAN
110 (EFIAPI *PCD_PPI_GET_EX_BOOLEAN) (
111 IN CONST EFI_GUID *Guid,
112 IN UINTN TokenNumber
113 );
114
115 typedef
116 UINTN
117 (EFIAPI *PCD_PPI_GET_EX_SIZE) (
118 IN CONST EFI_GUID *Guid,
119 IN UINTN TokenNumber
120 );
121
122 typedef
123 EFI_STATUS
124 (EFIAPI *PCD_PPI_SET8) (
125 IN UINTN TokenNumber,
126 IN UINT8 Value
127 );
128
129 typedef
130 EFI_STATUS
131 (EFIAPI *PCD_PPI_SET16) (
132 IN UINTN TokenNumber,
133 IN UINT16 Value
134 );
135
136 typedef
137 EFI_STATUS
138 (EFIAPI *PCD_PPI_SET32) (
139 IN UINTN TokenNumber,
140 IN UINT32 Value
141 );
142
143 typedef
144 EFI_STATUS
145 (EFIAPI *PCD_PPI_SET64) (
146 IN UINTN TokenNumber,
147 IN UINT64 Value
148 );
149
150 typedef
151 EFI_STATUS
152 (EFIAPI *PCD_PPI_SET_POINTER) (
153 IN UINTN TokenNumber,
154 IN CONST VOID *Value
155 );
156
157 typedef
158 EFI_STATUS
159 (EFIAPI *PCD_PPI_SET_BOOLEAN) (
160 IN UINTN TokenNumber,
161 IN BOOLEAN Value
162 );
163
164 typedef
165 EFI_STATUS
166 (EFIAPI *PCD_PPI_SET_EX_8) (
167 IN CONST EFI_GUID *Guid,
168 IN UINTN TokenNumber,
169 IN UINT8 Value
170 );
171
172 typedef
173 EFI_STATUS
174 (EFIAPI *PCD_PPI_SET_EX_16) (
175 IN CONST EFI_GUID *Guid,
176 IN UINTN TokenNumber,
177 IN UINT16 Value
178 );
179
180 typedef
181 EFI_STATUS
182 (EFIAPI *PCD_PPI_SET_EX_32) (
183 IN CONST EFI_GUID *Guid,
184 IN UINTN TokenNumber,
185 IN UINT32 Value
186 );
187
188 typedef
189 EFI_STATUS
190 (EFIAPI *PCD_PPI_SET_EX_64) (
191 IN CONST EFI_GUID *Guid,
192 IN UINTN TokenNumber,
193 IN UINT64 Value
194 );
195
196 typedef
197 EFI_STATUS
198 (EFIAPI *PCD_PPI_SET_EX_POINTER) (
199 IN CONST EFI_GUID *Guid,
200 IN UINTN TokenNumber,
201 IN CONST VOID *Value
202 );
203
204 typedef
205 EFI_STATUS
206 (EFIAPI *PCD_PPI_SET_EX_BOOLEAN) (
207 IN CONST EFI_GUID *Guid,
208 IN UINTN TokenNumber,
209 IN BOOLEAN Value
210 );
211
212 /**
213 Callback on SET function prototype definition.
214
215 @param[in] CallBackGuid The PCD token GUID being set.
216 @param[in] CallBackToken The PCD token number being set.
217 @param[in] TokenData A pointer to the token data being set.
218 @param[in] TokenDataSize The size, in bytes, of the data being set.
219
220 @retval VOID
221
222 --*/
223 typedef
224 VOID
225 (EFIAPI *PCD_PPI_CALLBACK) (
226 IN CONST EFI_GUID *CallBackGuid, OPTIONAL
227 IN UINTN CallBackToken,
228 IN VOID *TokenData,
229 IN UINTN TokenDataSize
230 );
231
232 typedef
233 EFI_STATUS
234 (EFIAPI *PCD_PPI_CALLBACK_ONSET) (
235 IN UINTN TokenNumber,
236 IN CONST EFI_GUID *Guid, OPTIONAL
237 IN PCD_PPI_CALLBACK CallBackFunction
238 );
239
240 typedef
241 EFI_STATUS
242 (EFIAPI *PCD_PPI_CANCEL_CALLBACK) (
243 IN UINTN TokenNumber,
244 IN CONST EFI_GUID *Guid, OPTIONAL
245 IN PCD_PPI_CALLBACK CallBackFunction
246 );
247
248 typedef
249 EFI_STATUS
250 (EFIAPI *PCD_PPI_GET_NEXT_TOKEN) (
251 IN CONST EFI_GUID *Guid, OPTIONAL
252 IN OUT UINTN *TokenNumber
253 );
254
255 typedef struct {
256 PCD_PPI_SET_SKU SetSku;
257
258 PCD_PPI_GET8 Get8;
259 PCD_PPI_GET16 Get16;
260 PCD_PPI_GET32 Get32;
261 PCD_PPI_GET64 Get64;
262 PCD_PPI_GET_POINTER GetPtr;
263 PCD_PPI_GET_BOOLEAN GetBool;
264 PCD_PPI_GET_SIZE GetSize;
265
266 PCD_PPI_GET_EX_8 Get8Ex;
267 PCD_PPI_GET_EX_16 Get16Ex;
268 PCD_PPI_GET_EX_32 Get32Ex;
269 PCD_PPI_GET_EX_64 Get64Ex;
270 PCD_PPI_GET_EX_POINTER GetPtrEx;
271 PCD_PPI_GET_EX_BOOLEAN GetBoolEx;
272 PCD_PPI_GET_EX_SIZE GetSizeEx;
273
274 PCD_PPI_SET8 Set8;
275 PCD_PPI_SET16 Set16;
276 PCD_PPI_SET32 Set32;
277 PCD_PPI_SET64 Set64;
278 PCD_PPI_SET_POINTER SetPtr;
279 PCD_PPI_SET_BOOLEAN SetBool;
280
281 PCD_PPI_SET_EX_8 Set8Ex;
282 PCD_PPI_SET_EX_16 Set16Ex;
283 PCD_PPI_SET_EX_32 Set32Ex;
284 PCD_PPI_SET_EX_64 Set64Ex;
285 PCD_PPI_SET_EX_POINTER SetPtrEx;
286 PCD_PPI_SET_EX_BOOLEAN SetBoolEx;
287
288 PCD_PPI_CALLBACK_ONSET CallbackOnSet;
289 PCD_PPI_CANCEL_CALLBACK CancelCallback;
290 PCD_PPI_GET_NEXT_TOKEN GetNextToken;
291 } PCD_PPI;
292
293
294 #endif