Corrected a small bugs:
[mirror_edk2.git] / EdkModulePkg / Universal / PCD / Pei / Service.h
CommitLineData
878ddf1f 1/** @file\r
2Private functions used by PCD PEIM.\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
4acf8ce7 21//\r
22// Please make sure the PCD Serivce PEIM Version is consistent with\r
23// the version of PCD Database generation tool\r
24//\r
2b34c3fe 25#define PCD_SERVICE_PEIM_VERSION 2\r
4acf8ce7 26\r
27//\r
28// PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h\r
29// and generated by PCD Database generation tool.\r
30//\r
2b34c3fe 31#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )\r
4acf8ce7 32 #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"\r
33#endif\r
34\r
878ddf1f 35//\r
36// PPI Interface Implementation Declaration.\r
37//\r
00b7af13 38VOID\r
878ddf1f 39EFIAPI\r
40PeiPcdSetSku (\r
8a43e8dd 41 IN UINTN SkuId\r
878ddf1f 42 )\r
43;\r
44\r
45\r
46UINT8\r
47EFIAPI\r
48PeiPcdGet8 (\r
8a43e8dd 49 IN UINTN TokenNumber\r
878ddf1f 50 )\r
51;\r
52\r
53\r
54UINT16\r
55EFIAPI\r
56PeiPcdGet16 (\r
8a43e8dd 57 IN UINTN TokenNumber\r
878ddf1f 58 )\r
59;\r
60\r
61\r
62UINT32\r
63EFIAPI\r
64PeiPcdGet32 (\r
8a43e8dd 65 IN UINTN TokenNumber\r
878ddf1f 66 )\r
67;\r
68\r
69\r
70UINT64\r
71EFIAPI\r
72PeiPcdGet64 (\r
8a43e8dd 73 IN UINTN TokenNumber\r
878ddf1f 74 )\r
75;\r
76\r
77\r
78VOID *\r
79EFIAPI\r
80PeiPcdGetPtr (\r
8a43e8dd 81 IN UINTN TokenNumber\r
878ddf1f 82 )\r
83;\r
84\r
85\r
86BOOLEAN\r
87EFIAPI\r
88PeiPcdGetBool (\r
8a43e8dd 89 IN UINTN TokenNumber\r
878ddf1f 90 )\r
91;\r
92\r
93\r
94UINTN\r
95EFIAPI\r
96PeiPcdGetSize (\r
8a43e8dd 97 IN UINTN TokenNumber\r
878ddf1f 98 )\r
99;\r
100\r
101\r
102UINT8\r
103EFIAPI\r
104PeiPcdGet8Ex (\r
00b7af13 105 IN CONST EFI_GUID *Guid,\r
8a43e8dd 106 IN UINTN TokenNumber\r
878ddf1f 107 )\r
108;\r
109\r
110\r
111UINT16\r
112EFIAPI\r
113PeiPcdGet16Ex (\r
00b7af13 114 IN CONST EFI_GUID *Guid,\r
8a43e8dd 115 IN UINTN TokenNumber\r
878ddf1f 116 )\r
117;\r
118\r
119UINT32\r
120EFIAPI\r
121PeiPcdGet32Ex (\r
00b7af13 122 IN CONST EFI_GUID *Guid,\r
8a43e8dd 123 IN UINTN TokenNumber\r
878ddf1f 124 )\r
125;\r
126\r
127\r
128UINT64\r
129EFIAPI\r
130PeiPcdGet64Ex (\r
00b7af13 131 IN CONST EFI_GUID *Guid,\r
8a43e8dd 132 IN UINTN TokenNumber\r
878ddf1f 133 )\r
134;\r
135\r
136\r
137VOID *\r
138EFIAPI\r
139PeiPcdGetPtrEx (\r
00b7af13 140 IN CONST EFI_GUID *Guid,\r
8a43e8dd 141 IN UINTN TokenNumber\r
878ddf1f 142 )\r
143;\r
144\r
145\r
146BOOLEAN\r
147EFIAPI\r
148PeiPcdGetBoolEx (\r
00b7af13 149 IN CONST EFI_GUID *Guid,\r
8a43e8dd 150 IN UINTN TokenNumber\r
878ddf1f 151 )\r
152;\r
153\r
154\r
155UINTN\r
156EFIAPI\r
157PeiPcdGetSizeEx (\r
00b7af13 158 IN CONST EFI_GUID *Guid,\r
8a43e8dd 159 IN UINTN TokenNumber\r
878ddf1f 160 )\r
161;\r
162\r
163\r
164EFI_STATUS\r
165EFIAPI\r
166PeiPcdSet8 (\r
8a43e8dd 167 IN UINTN TokenNumber,\r
878ddf1f 168 IN UINT8 Value\r
169 )\r
170;\r
171\r
172\r
173EFI_STATUS\r
174EFIAPI\r
175PeiPcdSet16 (\r
8a43e8dd 176 IN UINTN TokenNumber,\r
878ddf1f 177 IN UINT16 Value\r
178 )\r
179;\r
180\r
181\r
182EFI_STATUS\r
183EFIAPI\r
184PeiPcdSet32 (\r
8a43e8dd 185 IN UINTN TokenNumber,\r
878ddf1f 186 IN UINT32 Value\r
187 )\r
188;\r
189\r
190\r
191EFI_STATUS\r
192EFIAPI\r
193PeiPcdSet64 (\r
8a43e8dd 194 IN UINTN TokenNumber,\r
878ddf1f 195 IN UINT64 Value\r
196 )\r
197;\r
198\r
199EFI_STATUS\r
200EFIAPI\r
201PeiPcdSetPtr (\r
1de04b4f 202 IN UINTN TokenNumber,\r
203 IN OUT UINTN *SizeOfBuffer,\r
204 IN VOID *Buffer\r
878ddf1f 205 )\r
206;\r
207\r
208\r
209EFI_STATUS\r
210EFIAPI\r
211PeiPcdSetBool (\r
8a43e8dd 212 IN UINTN TokenNumber,\r
878ddf1f 213 IN BOOLEAN Value\r
214 )\r
215;\r
216\r
217\r
218EFI_STATUS\r
219EFIAPI\r
220PeiPcdSet8Ex (\r
00b7af13 221 IN CONST EFI_GUID *Guid,\r
8a43e8dd 222 IN UINTN TokenNumber,\r
878ddf1f 223 IN UINT8 Value\r
224 )\r
225;\r
226\r
227EFI_STATUS\r
228EFIAPI\r
229PeiPcdSet16Ex (\r
00b7af13 230 IN CONST EFI_GUID *Guid,\r
8a43e8dd 231 IN UINTN TokenNumber,\r
878ddf1f 232 IN UINT16 Value\r
233 )\r
234;\r
235\r
236\r
237EFI_STATUS\r
238EFIAPI\r
239PeiPcdSet32Ex (\r
00b7af13 240 IN CONST EFI_GUID *Guid,\r
8a43e8dd 241 IN UINTN TokenNumber,\r
878ddf1f 242 IN UINT32 Value\r
243 )\r
244;\r
245\r
246\r
247EFI_STATUS\r
248EFIAPI\r
249PeiPcdSet64Ex (\r
00b7af13 250 IN CONST EFI_GUID *Guid,\r
8a43e8dd 251 IN UINTN TokenNumber,\r
878ddf1f 252 IN UINT64 Value\r
253 )\r
254;\r
255\r
256\r
257EFI_STATUS\r
258EFIAPI\r
259PeiPcdSetPtrEx (\r
1de04b4f 260 IN CONST EFI_GUID *Guid,\r
261 IN UINTN TokenNumber,\r
262 IN OUT UINTN *SizeOfBuffer,\r
263 IN VOID *Buffer\r
878ddf1f 264 )\r
265;\r
266\r
267\r
268EFI_STATUS\r
269EFIAPI\r
270PeiPcdSetBoolEx (\r
00b7af13 271 IN CONST EFI_GUID *Guid,\r
8a43e8dd 272 IN UINTN TokenNumber,\r
878ddf1f 273 IN BOOLEAN Value\r
274 )\r
275;\r
276\r
277\r
278\r
279EFI_STATUS\r
280EFIAPI\r
4c114006 281PeiRegisterCallBackOnSet (\r
00b7af13 282 IN CONST EFI_GUID *Guid, OPTIONAL\r
2a870f53 283 IN UINTN TokenNumber,\r
00b7af13 284 IN PCD_PPI_CALLBACK CallBackFunction\r
878ddf1f 285 )\r
286;\r
287\r
288\r
289EFI_STATUS\r
290EFIAPI\r
291PcdUnRegisterCallBackOnSet (\r
00b7af13 292 IN CONST EFI_GUID *Guid, OPTIONAL\r
2a870f53 293 IN UINTN TokenNumber,\r
00b7af13 294 IN PCD_PPI_CALLBACK CallBackFunction\r
878ddf1f 295 )\r
296;\r
297\r
298\r
299EFI_STATUS\r
300EFIAPI\r
301PeiPcdGetNextToken (\r
00b7af13 302 IN CONST EFI_GUID *Guid, OPTIONAL\r
8a43e8dd 303 IN OUT UINTN *TokenNumber\r
878ddf1f 304 )\r
305;\r
52e1905d 306\r
4276d5da 307\r
308EFI_STATUS\r
309EFIAPI\r
310PeiPcdGetNextTokenSpace (\r
311 IN CONST EFI_GUID **Guid\r
312 )\r
313;\r
314\r
c24ba2f6 315\r
316/* Internal Function definitions */\r
317\r
318PEI_PCD_DATABASE *\r
319GetPcdDatabase (\r
320 VOID\r
321 )\r
322;\r
323\r
324\r
325EFI_STATUS\r
326SetValueWorker (\r
327 IN UINTN TokenNumber,\r
328 IN VOID *Data,\r
329 IN UINTN Size\r
330 )\r
331;\r
332\r
333\r
334EFI_STATUS\r
335SetWorker (\r
336 IN UINTN TokenNumber,\r
337 IN VOID *Data,\r
338 IN OUT UINTN *Size,\r
339 IN BOOLEAN PtrType\r
340 )\r
341;\r
342\r
343\r
344EFI_STATUS\r
345ExSetValueWorker (\r
346 IN UINTN ExTokenNumber,\r
347 IN CONST EFI_GUID *Guid,\r
348 IN VOID *Data,\r
349 IN UINTN Size\r
350 )\r
351;\r
352\r
353\r
354\r
355EFI_STATUS\r
356ExSetWorker (\r
357 IN UINTN ExTokenNumber,\r
358 IN CONST EFI_GUID *Guid,\r
359 IN VOID *Data,\r
360 IN OUT UINTN *Size,\r
361 IN BOOLEAN PtrType\r
362 )\r
363;\r
364\r
365\r
366\r
367VOID *\r
368GetWorker (\r
369 IN UINTN TokenNumber,\r
370 IN UINTN GetSize\r
371 )\r
372;\r
373\r
374\r
375\r
376VOID *\r
377ExGetWorker (\r
378 IN CONST EFI_GUID *Guid,\r
379 IN UINTN ExTokenNumber,\r
380 IN UINTN GetSize\r
381 )\r
382;\r
383\r
384typedef struct {\r
385 UINTN TokenNumber;\r
386 UINTN Size;\r
387 UINT32 LocalTokenNumberAlias;\r
388} EX_PCD_ENTRY_ATTRIBUTE;\r
389\r
390\r
391UINTN \r
392GetExPcdTokenNumber (\r
393 IN CONST EFI_GUID *Guid,\r
394 IN UINTN ExTokenNumber\r
395 )\r
396;\r
397\r
398\r
399\r
400\r
401EFI_STATUS\r
402PeiRegisterCallBackWorker (\r
403 IN UINTN TokenNumber,\r
404 IN CONST GUID *Guid, OPTIONAL\r
405 IN PCD_PPI_CALLBACK CallBackFunction,\r
406 IN BOOLEAN Register\r
407);\r
408\r
409\r
410\r
411\r
412VOID\r
413BuildPcdDatabase (\r
414 VOID\r
415 )\r
416;\r
417\r
418\r
419\r
420\r
421UINTN\r
422GetPtrTypeSize (\r
423 IN UINTN LocalTokenNumberTableIdx,\r
424 OUT UINTN *MaxSize,\r
425 IN PEI_PCD_DATABASE *Database\r
426 )\r
427;\r
428\r
429\r
430\r
431BOOLEAN\r
432SetPtrTypeSize (\r
433 IN UINTN LocalTokenNumberTableIdx,\r
434 IN OUT UINTN *CurrentSize,\r
435 IN PEI_PCD_DATABASE *Database\r
436 )\r
437;\r
438\r
439\r
52e1905d 440extern EFI_GUID gPcdDataBaseHobGuid;\r
441\r
442extern EFI_GUID gPcdPeiCallbackFnTableHobGuid;\r
443\r
444extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit;\r
445\r
878ddf1f 446#endif\r