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