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