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