d775a12a170612104757ba61a44af06ee76b75fc
[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 // Offset of StateByte
23 //
24 #define PCD_STATEBYTE_HIIENABLE 0x01
25 #define PCD_STATEBYTE_SKUENABLE 0x02
26 #define PCD_STATEBYTE_VPDENABLE 0x04
27 #define PCD_STATEBYTE_SKUDATAARRAYENABLE 0x08
28 #define PCD_STATEBYTE_DATUMTYPE 0x70
29 #define PCD_STATEBYTE_EXTENDEDGUIDPRESENT 0x80
30
31 #define PCD_DATUMTYPE_OFFSET 4
32
33 //
34 // The definitions for interpreting DatumType
35 //
36 #define PCD_BYTE8 (0x00 << PCD_DATUMTYPE_OFFSET)
37 #define PCD_BYTE16 (0x01 << PCD_DATUMTYPE_OFFSET)
38 #define PCD_BYTE32 (0x02 << PCD_DATUMTYPE_OFFSET)
39 #define PCD_BYTE64 (0x03 << PCD_DATUMTYPE_OFFSET)
40 #define PCD_POINTER (0x04 << PCD_DATUMTYPE_OFFSET)
41 #define PCD_BOOLEAN (0x05 << PCD_DATUMTYPE_OFFSET)
42
43 extern GUID gEfiPcdImageHobGuid;
44
45 /* Internal Function definitions */
46
47 VOID
48 PeiGetPcdEntryWorker (
49 IN UINTN Token,
50 IN CONST GUID *Guid, OPTIONAL
51 IN PCD_DATA_TYPE Type,
52 OUT VOID *Data
53 );
54
55 EFI_STATUS
56 PeiSetPcdEntryWorker (
57 IN UINTN Token,
58 IN CONST GUID *Guid, OPTIONAL
59 IN PCD_DATA_TYPE Type,
60 IN VOID *Data
61 );
62
63 UINTN
64 PeiGetPcdEntrySizeWorker (
65 IN UINTN Token,
66 IN CONST GUID *Guid OPTIONAL
67 );
68
69 EFI_STATUS
70 PeiRegisterCallBackWorker (
71 IN UINTN TokenNumber,
72 IN CONST GUID *Guid, OPTIONAL
73 IN PCD_PPI_CALLBACK CallBackFunction,
74 IN BOOLEAN Register
75 );
76
77 EFI_STATUS
78 PeiSetSku (
79 UINTN Id
80 );
81
82 EFI_STATUS
83 PeiGetNextTokenWorker (
84 IN OUT UINTN *Token,
85 IN CONST GUID *Guid OPTIONAL
86 );
87
88 UINT8 *
89 LocatePcdImage (
90 VOID
91 );
92
93 VOID
94 BuildPcdDatabase (
95 UINT8 *PcdImageOnFlash
96 )
97 ;
98
99
100 extern EFI_GUID gPcdImageFileGuid;
101
102 //
103 // PPI Interface Implementation Declaration.
104 //
105 EFI_STATUS
106 EFIAPI
107 PeiPcdSetSku (
108 IN UINTN SkuId
109 )
110 ;
111
112
113 UINT8
114 EFIAPI
115 PeiPcdGet8 (
116 IN UINTN TokenNumber
117 )
118 ;
119
120
121 UINT16
122 EFIAPI
123 PeiPcdGet16 (
124 IN UINTN TokenNumber
125 )
126 ;
127
128
129 UINT32
130 EFIAPI
131 PeiPcdGet32 (
132 IN UINTN TokenNumber
133 )
134 ;
135
136
137 UINT64
138 EFIAPI
139 PeiPcdGet64 (
140 IN UINTN TokenNumber
141 )
142 ;
143
144
145 VOID *
146 EFIAPI
147 PeiPcdGetPtr (
148 IN UINTN TokenNumber
149 )
150 ;
151
152
153 BOOLEAN
154 EFIAPI
155 PeiPcdGetBool (
156 IN UINTN TokenNumber
157 )
158 ;
159
160
161 UINTN
162 EFIAPI
163 PeiPcdGetSize (
164 IN UINTN TokenNumber
165 )
166 ;
167
168
169 UINT8
170 EFIAPI
171 PeiPcdGet8Ex (
172 IN CONST EFI_GUID *Guid,
173 IN UINTN TokenNumber
174 )
175 ;
176
177
178 UINT16
179 EFIAPI
180 PeiPcdGet16Ex (
181 IN CONST EFI_GUID *Guid,
182 IN UINTN TokenNumber
183 )
184 ;
185
186 UINT32
187 EFIAPI
188 PeiPcdGet32Ex (
189 IN CONST EFI_GUID *Guid,
190 IN UINTN TokenNumber
191 )
192 ;
193
194
195 UINT64
196 EFIAPI
197 PeiPcdGet64Ex (
198 IN CONST EFI_GUID *Guid,
199 IN UINTN TokenNumber
200 )
201 ;
202
203
204 VOID *
205 EFIAPI
206 PeiPcdGetPtrEx (
207 IN CONST EFI_GUID *Guid,
208 IN UINTN TokenNumber
209 )
210 ;
211
212
213 BOOLEAN
214 EFIAPI
215 PeiPcdGetBoolEx (
216 IN CONST EFI_GUID *Guid,
217 IN UINTN TokenNumber
218 )
219 ;
220
221
222 UINTN
223 EFIAPI
224 PeiPcdGetSizeEx (
225 IN CONST EFI_GUID *Guid,
226 IN UINTN TokenNumber
227 )
228 ;
229
230
231 EFI_STATUS
232 EFIAPI
233 PeiPcdSet8 (
234 IN UINTN TokenNumber,
235 IN UINT8 Value
236 )
237 ;
238
239
240 EFI_STATUS
241 EFIAPI
242 PeiPcdSet16 (
243 IN UINTN TokenNumber,
244 IN UINT16 Value
245 )
246 ;
247
248
249 EFI_STATUS
250 EFIAPI
251 PeiPcdSet32 (
252 IN UINTN TokenNumber,
253 IN UINT32 Value
254 )
255 ;
256
257
258 EFI_STATUS
259 EFIAPI
260 PeiPcdSet64 (
261 IN UINTN TokenNumber,
262 IN UINT64 Value
263 )
264 ;
265
266 EFI_STATUS
267 EFIAPI
268 PeiPcdSetPtr (
269 IN UINTN TokenNumber,
270 IN CONST VOID *Value
271 )
272 ;
273
274
275 EFI_STATUS
276 EFIAPI
277 PeiPcdSetBool (
278 IN UINTN TokenNumber,
279 IN BOOLEAN Value
280 )
281 ;
282
283
284 EFI_STATUS
285 EFIAPI
286 PeiPcdSet8Ex (
287 IN CONST EFI_GUID *Guid,
288 IN UINTN TokenNumber,
289 IN UINT8 Value
290 )
291 ;
292
293 EFI_STATUS
294 EFIAPI
295 PeiPcdSet16Ex (
296 IN CONST EFI_GUID *Guid,
297 IN UINTN TokenNumber,
298 IN UINT16 Value
299 )
300 ;
301
302
303 EFI_STATUS
304 EFIAPI
305 PeiPcdSet32Ex (
306 IN CONST EFI_GUID *Guid,
307 IN UINTN TokenNumber,
308 IN UINT32 Value
309 )
310 ;
311
312
313 EFI_STATUS
314 EFIAPI
315 PeiPcdSet64Ex (
316 IN CONST EFI_GUID *Guid,
317 IN UINTN TokenNumber,
318 IN UINT64 Value
319 )
320 ;
321
322
323 EFI_STATUS
324 EFIAPI
325 PeiPcdSetPtrEx (
326 IN CONST EFI_GUID *Guid,
327 IN UINTN TokenNumber,
328 IN CONST VOID *Value
329 )
330 ;
331
332
333 EFI_STATUS
334 EFIAPI
335 PeiPcdSetBoolEx (
336 IN CONST EFI_GUID *Guid,
337 IN UINTN TokenNumber,
338 IN BOOLEAN Value
339 )
340 ;
341
342
343
344 EFI_STATUS
345 EFIAPI
346 PcdRegisterCallBackOnSet (
347 IN UINTN TokenNumber,
348 IN CONST EFI_GUID *Guid, OPTIONAL
349 IN PCD_PPI_CALLBACK CallBackFunction
350 )
351 ;
352
353
354 EFI_STATUS
355 EFIAPI
356 PcdUnRegisterCallBackOnSet (
357 IN UINTN TokenNumber,
358 IN CONST EFI_GUID *Guid, OPTIONAL
359 IN PCD_PPI_CALLBACK CallBackFunction
360 )
361 ;
362
363
364 EFI_STATUS
365 EFIAPI
366 PeiPcdGetNextToken (
367 IN CONST EFI_GUID *Guid, OPTIONAL
368 IN OUT UINTN *TokenNumber
369 )
370 ;
371 #endif