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