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