Add in GetNextToken and Register Callback Function funtionality for DXE Driver.
[mirror_edk2.git] / EdkModulePkg / Universal / PCD / Pei / Service.h
1 /** @file
2 Private functions used by PCD PEIM.
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
14 Module Name: Service.h
15
16 **/
17
18 #ifndef _SERVICE_H
19 #define _SERVICE_H
20
21 //
22 // Please make sure the PCD Serivce PEIM Version is consistent with
23 // the version of PCD Database generation tool
24 //
25 #define PCD_PEI_SERVICE_DRIVER_VERSION 1
26
27 //
28 // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h
29 // and generated by PCD Database generation tool.
30 //
31 #if (PCD_PEI_SERVICE_PEIM_VERSION != PCD_PEI_DATABASE_GENTOOL_VERSION)
32 #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"
33 #endif
34
35 /* Internal Function definitions */
36
37 PEI_PCD_DATABASE *
38 GetPcdDatabase (
39 VOID
40 )
41 ;
42
43 EFI_STATUS
44 SetWorker (
45 IN UINTN TokenNumber,
46 IN VOID *Data,
47 IN UINTN Size,
48 IN BOOLEAN PtrType
49 )
50 ;
51
52 EFI_STATUS
53 SetWorkerByLocalTokenNumber (
54 UINT32 LocalTokenNumber,
55 VOID *Data,
56 UINTN Size,
57 BOOLEAN PtrType
58 )
59 ;
60
61 EFI_STATUS
62 ExSetWorker (
63 IN UINT32 ExTokenNumber,
64 IN CONST EFI_GUID *Guid,
65 VOID *Data,
66 UINTN Size,
67 BOOLEAN PtrType
68 )
69 ;
70
71 VOID *
72 GetWorker (
73 UINTN TokenNumber,
74 UINTN GetSize
75 )
76 ;
77
78 VOID *
79 ExGetWorker (
80 IN CONST EFI_GUID *Guid,
81 IN UINT32 ExTokenNumber,
82 IN UINTN GetSize
83 )
84 ;
85
86 typedef struct {
87 UINTN TokenNumber;
88 UINTN Size;
89 UINT32 LocalTokenNumberAlias;
90 } EX_PCD_ENTRY_ATTRIBUTE;
91
92 VOID
93 GetExPcdTokenAttributes (
94 IN CONST EFI_GUID *Guid,
95 IN UINT32 ExTokenNumber,
96 OUT EX_PCD_ENTRY_ATTRIBUTE *ExAttr
97 )
98 ;
99
100 EFI_STATUS
101 PeiRegisterCallBackWorker (
102 IN UINTN TokenNumber,
103 IN CONST GUID *Guid, OPTIONAL
104 IN PCD_PPI_CALLBACK CallBackFunction,
105 IN BOOLEAN Register
106 );
107
108 VOID
109 BuildPcdDatabase (
110 VOID
111 )
112 ;
113
114
115 //
116 // PPI Interface Implementation Declaration.
117 //
118 VOID
119 EFIAPI
120 PeiPcdSetSku (
121 IN SKU_ID SkuId
122 )
123 ;
124
125
126 UINT8
127 EFIAPI
128 PeiPcdGet8 (
129 IN PCD_TOKEN_NUMBER TokenNumber
130 )
131 ;
132
133
134 UINT16
135 EFIAPI
136 PeiPcdGet16 (
137 IN PCD_TOKEN_NUMBER TokenNumber
138 )
139 ;
140
141
142 UINT32
143 EFIAPI
144 PeiPcdGet32 (
145 IN PCD_TOKEN_NUMBER TokenNumber
146 )
147 ;
148
149
150 UINT64
151 EFIAPI
152 PeiPcdGet64 (
153 IN PCD_TOKEN_NUMBER TokenNumber
154 )
155 ;
156
157
158 VOID *
159 EFIAPI
160 PeiPcdGetPtr (
161 IN PCD_TOKEN_NUMBER TokenNumber
162 )
163 ;
164
165
166 BOOLEAN
167 EFIAPI
168 PeiPcdGetBool (
169 IN PCD_TOKEN_NUMBER TokenNumber
170 )
171 ;
172
173
174 UINTN
175 EFIAPI
176 PeiPcdGetSize (
177 IN PCD_TOKEN_NUMBER TokenNumber
178 )
179 ;
180
181
182 UINT8
183 EFIAPI
184 PeiPcdGet8Ex (
185 IN CONST EFI_GUID *Guid,
186 IN PCD_TOKEN_NUMBER TokenNumber
187 )
188 ;
189
190
191 UINT16
192 EFIAPI
193 PeiPcdGet16Ex (
194 IN CONST EFI_GUID *Guid,
195 IN PCD_TOKEN_NUMBER TokenNumber
196 )
197 ;
198
199 UINT32
200 EFIAPI
201 PeiPcdGet32Ex (
202 IN CONST EFI_GUID *Guid,
203 IN PCD_TOKEN_NUMBER TokenNumber
204 )
205 ;
206
207
208 UINT64
209 EFIAPI
210 PeiPcdGet64Ex (
211 IN CONST EFI_GUID *Guid,
212 IN PCD_TOKEN_NUMBER TokenNumber
213 )
214 ;
215
216
217 VOID *
218 EFIAPI
219 PeiPcdGetPtrEx (
220 IN CONST EFI_GUID *Guid,
221 IN PCD_TOKEN_NUMBER TokenNumber
222 )
223 ;
224
225
226 BOOLEAN
227 EFIAPI
228 PeiPcdGetBoolEx (
229 IN CONST EFI_GUID *Guid,
230 IN PCD_TOKEN_NUMBER TokenNumber
231 )
232 ;
233
234
235 UINTN
236 EFIAPI
237 PeiPcdGetSizeEx (
238 IN CONST EFI_GUID *Guid,
239 IN PCD_TOKEN_NUMBER TokenNumber
240 )
241 ;
242
243
244 EFI_STATUS
245 EFIAPI
246 PeiPcdSet8 (
247 IN PCD_TOKEN_NUMBER TokenNumber,
248 IN UINT8 Value
249 )
250 ;
251
252
253 EFI_STATUS
254 EFIAPI
255 PeiPcdSet16 (
256 IN PCD_TOKEN_NUMBER TokenNumber,
257 IN UINT16 Value
258 )
259 ;
260
261
262 EFI_STATUS
263 EFIAPI
264 PeiPcdSet32 (
265 IN PCD_TOKEN_NUMBER TokenNumber,
266 IN UINT32 Value
267 )
268 ;
269
270
271 EFI_STATUS
272 EFIAPI
273 PeiPcdSet64 (
274 IN PCD_TOKEN_NUMBER TokenNumber,
275 IN UINT64 Value
276 )
277 ;
278
279 EFI_STATUS
280 EFIAPI
281 PeiPcdSetPtr (
282 IN PCD_TOKEN_NUMBER TokenNumber,
283 IN UINTN SizeOfBuffer,
284 IN VOID *Buffer
285 )
286 ;
287
288
289 EFI_STATUS
290 EFIAPI
291 PeiPcdSetBool (
292 IN PCD_TOKEN_NUMBER TokenNumber,
293 IN BOOLEAN Value
294 )
295 ;
296
297
298 EFI_STATUS
299 EFIAPI
300 PeiPcdSet8Ex (
301 IN CONST EFI_GUID *Guid,
302 IN PCD_TOKEN_NUMBER TokenNumber,
303 IN UINT8 Value
304 )
305 ;
306
307 EFI_STATUS
308 EFIAPI
309 PeiPcdSet16Ex (
310 IN CONST EFI_GUID *Guid,
311 IN PCD_TOKEN_NUMBER TokenNumber,
312 IN UINT16 Value
313 )
314 ;
315
316
317 EFI_STATUS
318 EFIAPI
319 PeiPcdSet32Ex (
320 IN CONST EFI_GUID *Guid,
321 IN PCD_TOKEN_NUMBER TokenNumber,
322 IN UINT32 Value
323 )
324 ;
325
326
327 EFI_STATUS
328 EFIAPI
329 PeiPcdSet64Ex (
330 IN CONST EFI_GUID *Guid,
331 IN PCD_TOKEN_NUMBER TokenNumber,
332 IN UINT64 Value
333 )
334 ;
335
336
337 EFI_STATUS
338 EFIAPI
339 PeiPcdSetPtrEx (
340 IN CONST EFI_GUID *Guid,
341 IN PCD_TOKEN_NUMBER TokenNumber,
342 IN UINTN SizeOfBuffer,
343 IN VOID *Buffer
344 )
345 ;
346
347
348 EFI_STATUS
349 EFIAPI
350 PeiPcdSetBoolEx (
351 IN CONST EFI_GUID *Guid,
352 IN PCD_TOKEN_NUMBER TokenNumber,
353 IN BOOLEAN Value
354 )
355 ;
356
357
358
359 EFI_STATUS
360 EFIAPI
361 PeiRegisterCallBackOnSet (
362 IN PCD_TOKEN_NUMBER TokenNumber,
363 IN CONST EFI_GUID *Guid, OPTIONAL
364 IN PCD_PPI_CALLBACK CallBackFunction
365 )
366 ;
367
368
369 EFI_STATUS
370 EFIAPI
371 PcdUnRegisterCallBackOnSet (
372 IN PCD_TOKEN_NUMBER TokenNumber,
373 IN CONST EFI_GUID *Guid, OPTIONAL
374 IN PCD_PPI_CALLBACK CallBackFunction
375 )
376 ;
377
378
379 EFI_STATUS
380 EFIAPI
381 PeiPcdGetNextToken (
382 IN CONST EFI_GUID *Guid, OPTIONAL
383 IN OUT PCD_TOKEN_NUMBER *TokenNumber
384 )
385 ;
386
387 extern EFI_GUID gPcdDataBaseHobGuid;
388
389 extern EFI_GUID gPcdPeiCallbackFnTableHobGuid;
390
391 extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit;
392
393 #endif