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