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