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