]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiHobLib.h
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Pei / Include / PeiHobLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
4ea9375a
HT
3Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 PeiHobLib.h\r
15\r
16Abstract:\r
17\r
18\r
19--*/\r
20\r
21#ifndef _EFI_PEI_HOB_LIB_H_\r
22#define _EFI_PEI_HOB_LIB_H_\r
23\r
24#include "PeiApi.h" // EFI_PEI_SERVICES definition\r
25#define EFI_STACK_SIZE 0x20000\r
26#define EFI_BSP_STORE_SIZE 0x4000\r
27\r
28EFI_STATUS\r
29BuildHobHandoffInfoTable (\r
30 IN VOID *HobStart,\r
31 IN UINT16 Version,\r
32 IN EFI_BOOT_MODE BootMode,\r
33 IN EFI_PHYSICAL_ADDRESS EfiMemoryTop,\r
34 IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom,\r
35 IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop,\r
36 IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom\r
37 )\r
38/*++\r
39\r
40Routine Description:\r
41\r
42 Builds a HandoffInformationTable Information Table HOB\r
43\r
44Arguments:\r
45\r
46 HobStart - Start pointer of hob list\r
47 Version - The version number pertaining to the PHIT HOB definition.\r
48 BootMode - The system boot mode as determined during the HOB producer phase.\r
49 EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB\r
50 producer phase.\r
51 EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB\r
52 producer phase.\r
53 EfiFreeMemoryTop - The highest address location of free memory that is currently available for use\r
54 by the HOB producer phase.\r
55 EfiFreeMemoryBottom - The lowest address location of free memory that is available for \r
56 use by the HOB producer phase.\r
57\r
58Returns:\r
59\r
60 EFI_SUCCESS\r
61\r
62--*/\r
63;\r
64\r
65EFI_STATUS\r
66BuildHobModule (\r
67 IN VOID *HobStart,\r
68 IN EFI_GUID *ModuleName,\r
69 IN EFI_PHYSICAL_ADDRESS Module,\r
70 IN UINT64 ModuleLength,\r
71 IN EFI_PHYSICAL_ADDRESS EntryPoint\r
72 )\r
73/*++\r
74\r
75Routine Description:\r
76\r
77 Builds a HOB for a loaded PE32 module\r
78\r
79Arguments:\r
80\r
81 HobStart - Start pointer of hob list\r
82\r
83 ModuleName - The GUID File Name of the HON from the Firmware Volume\r
84\r
85 Module - The 64 bit physical address of the module\r
86\r
87 ModuleLength - The length of the module in bytes\r
88\r
89 EntryPoint - The 64 bit physical address of the entry point to the module\r
90\r
91Returns:\r
92\r
93 EFI_SUCCESS\r
94 EFI_NOT_AVAILABLE_YET\r
95\r
96--*/\r
97;\r
98\r
99EFI_STATUS\r
100BuildHobResourceDescriptor (\r
101 IN VOID *HobStart,\r
102 IN EFI_RESOURCE_TYPE ResourceType,\r
103 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,\r
104 IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r
105 IN UINT64 NumberOfBytes\r
106 )\r
107/*++\r
108\r
109Routine Description:\r
110\r
111 Builds a HOB that describes a chunck of system memory\r
112\r
113Arguments:\r
114\r
115 HobStart - Start pointer of hob list\r
116\r
117 ResourceType - The type of memory described by this HOB\r
118\r
119 ResourceAttribute - The memory attributes of the memory described by this HOB\r
120\r
121 PhysicalStart - The 64 bit physical address of memory described by this HOB\r
122\r
123 NumberOfBytes - The length of the memoty described by this HOB in bytes\r
124\r
125Returns:\r
126\r
127 EFI_SUCCESS\r
128 EFI_NOT_AVAILABLE_YET\r
129\r
130--*/\r
131;\r
132\r
133EFI_STATUS\r
134BuildHobGuidType (\r
135 IN VOID *HobStart,\r
136 IN EFI_GUID *Guid,\r
137 IN VOID *Buffer,\r
138 IN UINTN BufferSize\r
139 )\r
140/*++\r
141\r
142Routine Description:\r
143\r
144 Builds a custom HOB that is tagged with a GUID for identification\r
145\r
146Arguments:\r
147\r
148 HobStart - Start pointer of hob list\r
149\r
150 Guid - The GUID of the custome HOB type\r
151\r
152 Buffer - A pointer to the data for the custom HOB type\r
153\r
154 BufferSize - The size in byte of BufferSize\r
155\r
156Returns:\r
157\r
158 EFI_SUCCESS\r
159 EFI_NOT_AVAILABLE_YET\r
160\r
161--*/\r
162;\r
163\r
164EFI_STATUS\r
165BuildHobFvDescriptor (\r
166 IN VOID *HobStart,\r
167 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
168 IN UINT64 Length\r
169 )\r
170/*++\r
171\r
172Routine Description:\r
173\r
174 Builds a Firmware Volume HOB\r
175\r
176Arguments:\r
177\r
178 HobStart - Start pointer of hob list\r
179\r
180 BaseAddress - The base address of the Firmware Volume\r
181\r
182 Length - The size of the Firmware Volume in bytes\r
183\r
184Returns:\r
185\r
186 EFI_SUCCESS\r
187 EFI_NOT_AVAILABLE_YET\r
188\r
189--*/\r
190;\r
191\r
192EFI_STATUS\r
193BuildHobCpu (\r
194 IN VOID *HobStart,\r
195 IN UINT8 SizeOfMemorySpace,\r
196 IN UINT8 SizeOfIoSpace\r
197 )\r
198/*++\r
199\r
200Routine Description:\r
201\r
202 Builds a HOB for the CPU\r
203\r
204Arguments:\r
205\r
206 HobStart - Start pointer of hob list\r
207\r
208 SizeOfMemorySpace - Identifies the maximum \r
209 physical memory addressibility of the processor.\r
210\r
211 SizeOfIoSpace - Identifies the maximum physical I/O addressibility \r
212 of the processor.\r
213\r
214Returns:\r
215\r
216 EFI_SUCCESS\r
217 EFI_NOT_AVAILABLE_YET\r
218\r
219--*/\r
220;\r
221\r
222EFI_STATUS\r
223BuildHobStack (\r
224 IN VOID *HobStart,\r
225 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
226 IN UINT64 Length\r
227 )\r
228/*++\r
229\r
230Routine Description:\r
231\r
232 Builds a HOB for the Stack\r
233\r
234Arguments:\r
235\r
236 HobStart - Start pointer of hob list\r
237\r
238 BaseAddress - The 64 bit physical address of the Stack\r
239\r
240 Length - The length of the stack in bytes\r
241\r
242Returns:\r
243\r
244 EFI_SUCCESS\r
245 EFI_NOT_AVAILABLE_YET\r
246\r
247--*/\r
248;\r
249\r
250EFI_STATUS\r
251BuildHobBspStore (\r
252 IN VOID *HobStart,\r
253 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
254 IN UINT64 Length,\r
255 IN EFI_MEMORY_TYPE MemoryType\r
256 )\r
257/*++\r
258\r
259Routine Description:\r
260\r
261 Builds a HOB for the bsp store\r
262\r
263Arguments:\r
264\r
265 HobStart - Start pointer of hob list\r
266\r
267 BaseAddress - The 64 bit physical address of bsp store\r
268\r
269 Length - The length of the bsp store in bytes\r
270 \r
271 MemoryType - Memory type of the bsp store\r
272\r
273Returns:\r
274\r
275 EFI_SUCCESS\r
276 EFI_NOT_AVAILABLE_YET\r
277\r
278--*/\r
279;\r
280\r
281EFI_STATUS\r
282BuildMemoryAllocationHob (\r
283 IN VOID *HobStart,\r
284 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
285 IN UINT64 Length,\r
286 IN EFI_GUID *Name,\r
287 IN EFI_MEMORY_TYPE MemoryType\r
288 )\r
289/*++\r
290\r
291Routine Description:\r
292\r
293 Builds a HOB for memory allocation\r
294\r
295Arguments:\r
296\r
297 HobStart - Start pointer of hob list\r
298\r
299 BaseAddress - The base address of memory allocated by this HOB.\r
300\r
301 Length - The length in bytes of memory allocated by this HOB.\r
302\r
fd0d281b 303 Name - A GUID that defines the memory allocation region's type and purpose, \r
3eb9473e 304 as well as other fields within the memory allocation HOB.\r
305\r
306 MemoryType - Defines the type of memory allocated by this HOB.\r
307\r
308Returns:\r
309\r
310 EFI_SUCCESS\r
311 EFI_NOT_AVAILABLE_YET\r
312\r
313--*/\r
314;\r
315\r
c7f33ca4 316VOID *\r
317GetHob (\r
318 IN UINT16 Type,\r
319 IN VOID *HobStart\r
320 )\r
321/*++\r
322\r
323Routine Description:\r
324\r
325 This function returns the first instance of a HOB type in a HOB list.\r
326 \r
327Arguments:\r
328\r
329 Type The HOB type to return.\r
330 HobStart The first HOB in the HOB list.\r
331 \r
332Returns:\r
333\r
334 HobStart There were no HOBs found with the requested type.\r
335 else Returns the first HOB with the matching type.\r
336\r
337--*/\r
338;\r
339\r
3eb9473e 340EFI_STATUS\r
341GetFirstGuidHob (\r
342 IN VOID **HobStart,\r
343 IN EFI_GUID *Guid,\r
344 OUT VOID **Buffer,\r
345 OUT UINTN *BufferSize OPTIONAL\r
346 ) \r
347/*++\r
348\r
349Routine Description:\r
350\r
351 This function searches the first instance of a HOB among the whole HOB list. \r
352\r
353Arguments:\r
354\r
355 HobStart - A pointer to the start pointer of hob list.\r
356\r
357 Guid - A pointer to the GUID to match with in the HOB list.\r
358\r
359 Buffer - A pointer to the pointer to the data for the custom HOB type.\r
360\r
361 BufferSize - A Pointer to the size in byte of BufferSize.\r
362\r
363Returns:\r
364 EFI_SUCCESS\r
365 The first instance of the matched GUID HOB among the whole HOB list\r
366\r
367--*/\r
368;\r
c7f33ca4 369\r
370EFI_STATUS\r
371GetNextGuidHob (\r
372 IN OUT VOID **HobStart,\r
373 IN EFI_GUID * Guid,\r
374 OUT VOID **Buffer,\r
375 OUT UINTN *BufferSize OPTIONAL\r
376 )\r
377/*++\r
378\r
379Routine Description:\r
380 Get the next guid hob.\r
381 \r
382Arguments:\r
383 HobStart A pointer to the start hob.\r
384 Guid A pointer to a guid.\r
385 Buffer A pointer to the buffer.\r
386 BufferSize Buffer size.\r
387 \r
388Returns:\r
389 Status code.\r
390\r
391 EFI_NOT_FOUND - Next Guid hob not found\r
392 \r
393 EFI_SUCCESS - Next Guid hob found and data for this Guid got\r
394 \r
395 EFI_INVALID_PARAMETER - invalid parameter\r
396\r
397--*/\r
398;\r
399\r
3eb9473e 400#endif\r