Import PCD dxe and PCD pei modules.
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Dxe / Service.h
1 /** @file
2 Private functions used by PCD DXE driver.
3
4 Copyright (c) 2006 - 2007, 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_DXE_DRIVER_VERSION 2
31
32 //
33 // PCD_DXE_DATABASE_GENTOOL_VERSION is defined in Autogen.h
34 // and generated by PCD Database generation tool.
35 //
36 #if (PCD_SERVICE_DXE_DRIVER_VERSION != PCD_DXE_SERVICE_DRIVER_AUTOGEN_VERSION)
37 #error "Please make sure the version of PCD Service DXE Driver and PCD DXE Database Generation Tool matches"
38 #endif
39
40 //
41 // Protocol Interface function declaration.
42 //
43 VOID
44 EFIAPI
45 DxePcdSetSku (
46 IN UINTN SkuId
47 )
48 ;
49
50
51 UINT8
52 EFIAPI
53 DxePcdGet8 (
54 IN UINTN TokenNumber
55 )
56 ;
57
58
59 UINT16
60 EFIAPI
61 DxePcdGet16 (
62 IN UINTN TokenNumber
63 )
64 ;
65
66
67 UINT32
68 EFIAPI
69 DxePcdGet32 (
70 IN UINTN TokenNumber
71 )
72 ;
73
74
75 UINT64
76 EFIAPI
77 DxePcdGet64 (
78 IN UINTN TokenNumber
79 )
80 ;
81
82
83 VOID *
84 EFIAPI
85 DxePcdGetPtr (
86 IN UINTN TokenNumber
87 )
88 ;
89
90
91 BOOLEAN
92 EFIAPI
93 DxePcdGetBool (
94 IN UINTN TokenNumber
95 )
96 ;
97
98
99 UINTN
100 EFIAPI
101 DxePcdGetSize (
102 IN UINTN TokenNumber
103 )
104 ;
105
106
107 UINT8
108 EFIAPI
109 DxePcdGet8Ex (
110 IN CONST EFI_GUID *Guid,
111 IN UINTN TokenNumber
112 )
113 ;
114
115
116 UINT16
117 EFIAPI
118 DxePcdGet16Ex (
119 IN CONST EFI_GUID *Guid,
120 IN UINTN TokenNumber
121 )
122 ;
123
124
125 UINT32
126 EFIAPI
127 DxePcdGet32Ex (
128 IN CONST EFI_GUID *Guid,
129 IN UINTN TokenNumber
130 )
131 ;
132
133
134
135 UINT64
136 EFIAPI
137 DxePcdGet64Ex (
138 IN CONST EFI_GUID *Guid,
139 IN UINTN TokenNumber
140 )
141 ;
142
143
144
145 VOID *
146 EFIAPI
147 DxePcdGetPtrEx (
148 IN CONST EFI_GUID *Guid,
149 IN UINTN TokenNumber
150 )
151 ;
152
153
154 BOOLEAN
155 EFIAPI
156 DxePcdGetBoolEx (
157 IN CONST EFI_GUID *Guid,
158 IN UINTN TokenNumber
159 )
160 ;
161
162
163 UINTN
164 EFIAPI
165 DxePcdGetSizeEx (
166 IN CONST EFI_GUID *Guid,
167 IN UINTN TokenNumber
168 )
169 ;
170
171
172 EFI_STATUS
173 EFIAPI
174 DxePcdSet8 (
175 IN UINTN TokenNumber,
176 IN UINT8 Value
177 )
178 ;
179
180
181 EFI_STATUS
182 EFIAPI
183 DxePcdSet16 (
184 IN UINTN TokenNumber,
185 IN UINT16 Value
186 )
187 ;
188
189
190 EFI_STATUS
191 EFIAPI
192 DxePcdSet32 (
193 IN UINTN TokenNumber,
194 IN UINT32 Value
195 )
196 ;
197
198
199 EFI_STATUS
200 EFIAPI
201 DxePcdSet64 (
202 IN UINTN TokenNumber,
203 IN UINT64 Value
204 )
205 ;
206
207
208 EFI_STATUS
209 EFIAPI
210 DxePcdSetPtr (
211 IN UINTN TokenNumber,
212 IN UINTN *SizeOfBuffer,
213 IN VOID *Buffer
214 )
215 ;
216
217
218 EFI_STATUS
219 EFIAPI
220 DxePcdSetBool (
221 IN UINTN TokenNumber,
222 IN BOOLEAN Value
223 )
224 ;
225
226
227 EFI_STATUS
228 EFIAPI
229 DxePcdSet8Ex (
230 IN CONST EFI_GUID *Guid,
231 IN UINTN TokenNumber,
232 IN UINT8 Value
233 )
234 ;
235
236
237 EFI_STATUS
238 EFIAPI
239 DxePcdSet16Ex (
240 IN CONST EFI_GUID *Guid,
241 IN UINTN TokenNumber,
242 IN UINT16 Value
243 )
244 ;
245
246
247 EFI_STATUS
248 EFIAPI
249 DxePcdSet32Ex (
250 IN CONST EFI_GUID *Guid,
251 IN UINTN TokenNumber,
252 IN UINT32 Value
253 )
254 ;
255
256
257 EFI_STATUS
258 EFIAPI
259 DxePcdSet64Ex (
260 IN CONST EFI_GUID *Guid,
261 IN UINTN TokenNumber,
262 IN UINT64 Value
263 )
264 ;
265
266
267 EFI_STATUS
268 EFIAPI
269 DxePcdSetPtrEx (
270 IN CONST EFI_GUID *Guid,
271 IN UINTN TokenNumber,
272 IN OUT UINTN *SizeOfBuffer,
273 IN VOID *Buffer
274 )
275 ;
276
277
278 EFI_STATUS
279 EFIAPI
280 DxePcdSetBoolEx (
281 IN CONST EFI_GUID *Guid,
282 IN UINTN TokenNumber,
283 IN BOOLEAN Value
284 )
285 ;
286
287
288
289 EFI_STATUS
290 EFIAPI
291 DxeRegisterCallBackOnSet (
292 IN CONST EFI_GUID *Guid, OPTIONAL
293 IN UINTN TokenNumber,
294 IN PCD_PROTOCOL_CALLBACK CallBackFunction
295 )
296 ;
297
298
299 EFI_STATUS
300 EFIAPI
301 DxeUnRegisterCallBackOnSet (
302 IN CONST EFI_GUID *Guid, OPTIONAL
303 IN UINTN TokenNumber,
304 IN PCD_PROTOCOL_CALLBACK CallBackFunction
305 )
306 ;
307
308
309 EFI_STATUS
310 EFIAPI
311 DxePcdGetNextToken (
312 IN CONST EFI_GUID *Guid, OPTIONAL
313 IN OUT UINTN *TokenNumber
314 )
315 ;
316
317
318
319 EFI_STATUS
320 EFIAPI
321 DxePcdGetNextTokenSpace (
322 IN OUT CONST EFI_GUID **Guid
323 )
324 ;
325
326
327 typedef struct {
328 LIST_ENTRY Node;
329 PCD_PROTOCOL_CALLBACK CallbackFn;
330 } CALLBACK_FN_ENTRY;
331
332 #define CR_FNENTRY_FROM_LISTNODE(Record, Type, Field) _CR(Record, Type, Field)
333
334 //
335 // Internal Functions
336 //
337
338 EFI_STATUS
339 SetValueWorker (
340 IN UINTN TokenNumber,
341 IN VOID *Data,
342 IN UINTN Size
343 )
344 ;
345
346 EFI_STATUS
347 SetWorker (
348 IN UINTN TokenNumber,
349 IN VOID *Data,
350 IN OUT UINTN *Size,
351 IN BOOLEAN PtrType
352 )
353 ;
354
355
356 EFI_STATUS
357 ExSetValueWorker (
358 IN UINTN ExTokenNumber,
359 IN CONST EFI_GUID *Guid,
360 IN VOID *Data,
361 IN UINTN SetSize
362 )
363 ;
364
365
366
367 EFI_STATUS
368 ExSetWorker (
369 IN UINTN ExTokenNumber,
370 IN CONST EFI_GUID *Guid,
371 IN VOID *Data,
372 IN OUT UINTN *Size,
373 IN BOOLEAN PtrType
374 )
375 ;
376
377
378 VOID *
379 GetWorker (
380 IN UINTN TokenNumber,
381 IN UINTN GetSize
382 )
383 ;
384
385 VOID *
386 ExGetWorker (
387 IN CONST EFI_GUID *Guid,
388 IN UINTN ExTokenNumber,
389 IN UINTN GetSize
390 )
391 ;
392
393 UINT32
394 GetSkuEnabledTokenNumber (
395 UINT32 LocalTokenNumber,
396 UINTN Size,
397 BOOLEAN IsPeiDb
398 )
399 ;
400
401 EFI_STATUS
402 GetHiiVariable (
403 IN EFI_GUID *VariableGuid,
404 IN UINT16 *VariableName,
405 OUT UINT8 **VariableData,
406 OUT UINTN *VariableSize
407 )
408 ;
409
410 EFI_STATUS
411 SetHiiVariable (
412 IN EFI_GUID *VariableGuid,
413 IN UINT16 *VariableName,
414 IN CONST VOID *Data,
415 IN UINTN DataSize,
416 IN UINTN Offset
417 )
418 ;
419
420 EFI_STATUS
421 DxeRegisterCallBackWorker (
422 IN UINTN TokenNumber,
423 IN CONST EFI_GUID *Guid, OPTIONAL
424 IN PCD_PROTOCOL_CALLBACK CallBackFunction
425 );
426
427 EFI_STATUS
428 DxeUnRegisterCallBackWorker (
429 IN UINTN TokenNumber,
430 IN CONST EFI_GUID *Guid, OPTIONAL
431 IN PCD_PROTOCOL_CALLBACK CallBackFunction
432 );
433
434 VOID
435 BuildPcdDxeDataBase (
436 VOID
437 );
438
439
440 UINTN
441 GetExPcdTokenNumber (
442 IN CONST EFI_GUID *Guid,
443 IN UINT32 ExTokenNumber
444 )
445 ;
446
447
448
449 EFI_STATUS
450 ExGetNextTokeNumber (
451 IN CONST EFI_GUID *Guid,
452 IN OUT UINTN *TokenNumber,
453 IN EFI_GUID *GuidTable,
454 IN UINTN SizeOfGuidTable,
455 IN DYNAMICEX_MAPPING *ExMapTable,
456 IN UINTN SizeOfExMapTable
457 )
458 ;
459
460
461 UINTN
462 GetPtrTypeSize (
463 IN UINTN LocalTokenNumberTableIdx,
464 OUT UINTN *MaxSize
465 )
466 ;
467
468
469
470 BOOLEAN
471 SetPtrTypeSize (
472 IN UINTN LocalTokenNumberTableIdx,
473 IN OUT UINTN *CurrentSize
474 )
475 ;
476
477 extern EFI_GUID gPcdDataBaseHobGuid;
478
479 extern PCD_DATABASE * mPcdDatabase;
480
481 extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit;
482
483 extern EFI_LOCK mPcdDatabaseLock;
484
485 #endif