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