Add in GetNextToken and Register Callback Function funtionality for DXE Driver.
[mirror_edk2.git] / EdkModulePkg / Universal / PCD / Dxe / Service.h
CommitLineData
878ddf1f 1/** @file\r
2Private functions used by PCD DXE driver.\r
3\r
4Copyright (c) 2006, Intel Corporation \r
5All rights reserved. This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13\r
14Module Name: Service.h\r
15\r
16**/\r
17\r
18#ifndef _SERVICE_H\r
19#define _SERVICE_H\r
20\r
52e1905d 21//\r
4acf8ce7 22// Please make sure the PCD Serivce PEIM Version is consistent with\r
23// the version of PCD Database generation tool\r
52e1905d 24//\r
4acf8ce7 25#define PCD_DXE_SERVICE_DRIVER_VERSION 1\r
52e1905d 26\r
27//\r
4acf8ce7 28// PCD_DXE_DATABASE_GENTOOL_VERSION is defined in Autogen.h\r
29// and generated by PCD Database generation tool.\r
52e1905d 30//\r
4acf8ce7 31#if (PCD_DXE_SERVICE_PEIM_VERSION != PCD_DXE_DATABASE_GENTOOL_VERSION)\r
32 #error "Please make sure the version of PCD Service DXE Driver and PCD DXE Database Generation Tool matches"\r
52e1905d 33#endif\r
34\r
4c114006 35\r
36typedef struct {\r
37 LIST_ENTRY Node;\r
38 PCD_PROTOCOL_CALLBACK CallbackFn;\r
39} CALLBACK_FN_ENTRY;\r
40\r
41#define CR_FNENTRY_FROM_LISTNODE(Record, Type, Field) _CR(Record, Type, Field)\r
42\r
52e1905d 43//\r
44// Internal Functions\r
45//\r
46\r
47EFI_STATUS\r
48SetWorker (\r
49 UINTN TokenNumber,\r
50 VOID *Data,\r
51 UINTN Size,\r
52 BOOLEAN PtrType\r
53 )\r
54;\r
55\r
56EFI_STATUS\r
57ExSetWorker (\r
58 IN UINT32 ExTokenNumber,\r
59 IN CONST EFI_GUID *Guid,\r
60 VOID *Data,\r
61 UINTN Size,\r
62 BOOLEAN PtrType\r
63 )\r
64;\r
65\r
66\r
67VOID *\r
68GetWorker (\r
69 UINTN TokenNumber\r
70 )\r
71;\r
72\r
73VOID *\r
74ExGetWorker (\r
75 IN CONST EFI_GUID *Guid,\r
76 IN UINTN ExTokenNumber,\r
77 IN UINTN GetSize\r
78 ) \r
79;\r
80\r
81UINT32\r
82GetSkuEnabledTokenNumber (\r
83 UINT32 LocalTokenNumber,\r
84 UINTN Size,\r
85 BOOLEAN IsPeiDb\r
86 ) \r
87;\r
88\r
89EFI_STATUS\r
90GetHiiVariable (\r
91 IN EFI_GUID *VariableGuid,\r
92 IN UINT16 *VariableName,\r
93 OUT VOID ** VariableData,\r
94 OUT UINTN *VariableSize\r
95 )\r
96;\r
878ddf1f 97\r
98EFI_STATUS\r
99DxeRegisterCallBackWorker (\r
4c114006 100 IN UINTN TokenNumber,\r
101 IN CONST EFI_GUID *Guid, OPTIONAL\r
102 IN PCD_PROTOCOL_CALLBACK CallBackFunction\r
878ddf1f 103);\r
104\r
878ddf1f 105EFI_STATUS\r
4c114006 106DxeUnRegisterCallBackWorker (\r
107 IN UINTN TokenNumber,\r
108 IN CONST EFI_GUID *Guid, OPTIONAL\r
109 IN PCD_PROTOCOL_CALLBACK CallBackFunction\r
110);\r
878ddf1f 111\r
112VOID\r
52e1905d 113BuildPcdDxeDataBase (\r
878ddf1f 114 VOID\r
115);\r
116\r
52e1905d 117\r
118typedef struct {\r
119 UINTN TokenNumber;\r
120 UINTN Size;\r
121 UINT32 LocalTokenNumberAlias;\r
122 BOOLEAN IsPeiDb;\r
123} EX_PCD_ENTRY_ATTRIBUTE;\r
124\r
125VOID\r
126GetExPcdTokenAttributes (\r
127 IN CONST EFI_GUID *Guid,\r
128 IN UINT32 ExTokenNumber,\r
129 OUT EX_PCD_ENTRY_ATTRIBUTE *ExAttr\r
130 )\r
131;\r
132\r
878ddf1f 133//\r
134// Protocol Interface function declaration.\r
135//\r
00b7af13 136VOID\r
878ddf1f 137EFIAPI\r
138DxePcdSetSku (\r
00b7af13 139 IN SKU_ID SkuId\r
878ddf1f 140 )\r
141;\r
142\r
143\r
144UINT8\r
145EFIAPI\r
146DxePcdGet8 (\r
00b7af13 147 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 148 )\r
149;\r
150\r
151\r
152UINT16\r
153EFIAPI\r
154DxePcdGet16 (\r
00b7af13 155 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 156 )\r
157;\r
158\r
159\r
160UINT32\r
161EFIAPI\r
162DxePcdGet32 (\r
00b7af13 163 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 164 )\r
165;\r
166\r
167\r
168UINT64\r
169EFIAPI\r
170DxePcdGet64 (\r
00b7af13 171 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 172 )\r
173;\r
174\r
175\r
176VOID *\r
177EFIAPI\r
178DxePcdGetPtr (\r
00b7af13 179 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 180 )\r
181;\r
182\r
183\r
184BOOLEAN\r
185EFIAPI\r
186DxePcdGetBool (\r
00b7af13 187 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 188 )\r
189;\r
190\r
191\r
192UINTN\r
193EFIAPI\r
194DxePcdGetSize (\r
00b7af13 195 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 196 )\r
197;\r
198\r
199\r
200UINT8\r
201EFIAPI\r
202DxePcdGet8Ex (\r
203 IN CONST EFI_GUID *Guid,\r
00b7af13 204 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 205 )\r
206;\r
207\r
208\r
209UINT16\r
210EFIAPI\r
211DxePcdGet16Ex (\r
212 IN CONST EFI_GUID *Guid,\r
00b7af13 213 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 214 )\r
215;\r
216\r
217\r
218UINT32\r
219EFIAPI\r
220DxePcdGet32Ex (\r
221 IN CONST EFI_GUID *Guid,\r
00b7af13 222 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 223 )\r
224;\r
225\r
226\r
227\r
228UINT64\r
229EFIAPI\r
230DxePcdGet64Ex (\r
231 IN CONST EFI_GUID *Guid,\r
00b7af13 232 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 233 )\r
234;\r
235\r
236\r
237\r
238VOID *\r
239EFIAPI\r
240DxePcdGetPtrEx (\r
241 IN CONST EFI_GUID *Guid,\r
00b7af13 242 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 243 )\r
244;\r
245\r
246\r
247BOOLEAN\r
248EFIAPI\r
249DxePcdGetBoolEx (\r
250 IN CONST EFI_GUID *Guid,\r
00b7af13 251 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 252 )\r
253;\r
254\r
255\r
256UINTN\r
257EFIAPI\r
258DxePcdGetSizeEx (\r
259 IN CONST EFI_GUID *Guid,\r
00b7af13 260 IN PCD_TOKEN_NUMBER TokenNumber\r
878ddf1f 261 )\r
262;\r
263\r
264\r
265EFI_STATUS\r
266EFIAPI\r
267DxePcdSet8 (\r
00b7af13 268 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 269 IN UINT8 Value\r
270 )\r
271;\r
272\r
273\r
274EFI_STATUS\r
275EFIAPI\r
276DxePcdSet16 (\r
00b7af13 277 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 278 IN UINT16 Value\r
279 )\r
280;\r
281\r
282\r
283EFI_STATUS\r
284EFIAPI\r
285DxePcdSet32 (\r
00b7af13 286 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 287 IN UINT32 Value\r
288 )\r
289;\r
290\r
291\r
292EFI_STATUS\r
293EFIAPI\r
294DxePcdSet64 (\r
00b7af13 295 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 296 IN UINT64 Value\r
297 )\r
298;\r
299\r
300\r
301EFI_STATUS\r
302EFIAPI\r
303DxePcdSetPtr (\r
00b7af13 304 IN PCD_TOKEN_NUMBER TokenNumber,\r
305 IN UINTN SizeOfBuffer,\r
306 IN VOID *Buffer\r
878ddf1f 307 )\r
308;\r
309\r
310\r
311EFI_STATUS\r
312EFIAPI\r
313DxePcdSetBool (\r
00b7af13 314 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 315 IN BOOLEAN Value\r
316 )\r
317;\r
318\r
319\r
320EFI_STATUS\r
321EFIAPI\r
322DxePcdSet8Ex (\r
323 IN CONST EFI_GUID *Guid,\r
00b7af13 324 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 325 IN UINT8 Value\r
326 )\r
327;\r
328\r
329\r
330EFI_STATUS\r
331EFIAPI\r
332DxePcdSet16Ex (\r
333 IN CONST EFI_GUID *Guid,\r
00b7af13 334 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 335 IN UINT16 Value\r
336 )\r
337;\r
338\r
339\r
340EFI_STATUS\r
341EFIAPI\r
342DxePcdSet32Ex (\r
343 IN CONST EFI_GUID *Guid,\r
00b7af13 344 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 345 IN UINT32 Value\r
346 )\r
347;\r
348\r
349\r
350EFI_STATUS\r
351EFIAPI\r
352DxePcdSet64Ex (\r
353 IN CONST EFI_GUID *Guid,\r
00b7af13 354 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 355 IN UINT64 Value\r
356 )\r
357;\r
358\r
359\r
360EFI_STATUS\r
361EFIAPI\r
362DxePcdSetPtrEx (\r
00b7af13 363 IN CONST EFI_GUID *Guid,\r
364 IN PCD_TOKEN_NUMBER TokenNumber,\r
365 IN UINTN SizeOfBuffer,\r
366 IN VOID *Buffer\r
878ddf1f 367 )\r
368;\r
369\r
370\r
371EFI_STATUS\r
372EFIAPI\r
373DxePcdSetBoolEx (\r
4c114006 374 IN CONST EFI_GUID *Guid,\r
00b7af13 375 IN PCD_TOKEN_NUMBER TokenNumber,\r
878ddf1f 376 IN BOOLEAN Value\r
377 )\r
378;\r
379\r
380\r
381\r
382EFI_STATUS\r
383EFIAPI\r
4c114006 384DxeRegisterCallBackOnSet (\r
00b7af13 385 IN PCD_TOKEN_NUMBER TokenNumber,\r
4c114006 386 IN CONST EFI_GUID *Guid, OPTIONAL\r
878ddf1f 387 IN PCD_PROTOCOL_CALLBACK CallBackFunction\r
388 )\r
389;\r
390\r
391\r
392EFI_STATUS\r
393EFIAPI\r
4c114006 394DxeUnRegisterCallBackOnSet (\r
00b7af13 395 IN PCD_TOKEN_NUMBER TokenNumber,\r
396 IN CONST EFI_GUID *Guid, OPTIONAL\r
878ddf1f 397 IN PCD_PROTOCOL_CALLBACK CallBackFunction\r
398 )\r
399;\r
400\r
401\r
402EFI_STATUS\r
403EFIAPI\r
404DxePcdGetNextToken (\r
405 IN CONST EFI_GUID *Guid, OPTIONAL\r
00b7af13 406 IN OUT PCD_TOKEN_NUMBER *TokenNumber\r
878ddf1f 407 )\r
408;\r
409\r
52e1905d 410EFI_STATUS\r
411SetWorkerByLocalTokenNumber (\r
412 UINT32 LocalTokenNumber,\r
413 VOID *Data,\r
414 UINTN Size,\r
415 BOOLEAN PtrType,\r
416 BOOLEAN IsPeiDb\r
417 )\r
418;\r
878ddf1f 419\r
4c114006 420PCD_TOKEN_NUMBER\r
421ExGetNextTokeNumber (\r
422 IN CONST EFI_GUID *Guid,\r
423 IN PCD_TOKEN_NUMBER TokenNumber,\r
424 IN EFI_GUID *GuidTable,\r
425 IN UINTN SizeOfGuidTable,\r
426 IN DYNAMICEX_MAPPING *ExMapTable,\r
427 IN UINTN SizeOfExMapTable\r
428 )\r
429;\r
430\r
52e1905d 431extern EFI_GUID gPcdDataBaseHobGuid;\r
878ddf1f 432\r
4c114006 433extern PCD_DATABASE * mPcdDatabase;\r
878ddf1f 434\r
52e1905d 435extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit;\r
878ddf1f 436\r
437#endif\r