3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 #ifndef _EFI_PEI_HOB_LIB_H_
22 #define _EFI_PEI_HOB_LIB_H_
24 #include "PeiApi.h" // EFI_PEI_SERVICES definition
25 #define EFI_STACK_SIZE 0x20000
26 #define EFI_BSP_STORE_SIZE 0x4000
29 BuildHobHandoffInfoTable (
32 IN EFI_BOOT_MODE BootMode
,
33 IN EFI_PHYSICAL_ADDRESS EfiMemoryTop
,
34 IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom
,
35 IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
,
36 IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
42 Builds a HandoffInformationTable Information Table HOB
46 HobStart - Start pointer of hob list
47 Version - The version number pertaining to the PHIT HOB definition.
48 BootMode - The system boot mode as determined during the HOB producer phase.
49 EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB
51 EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB
53 EfiFreeMemoryTop - The highest address location of free memory that is currently available for use
54 by the HOB producer phase.
55 EfiFreeMemoryBottom - The lowest address location of free memory that is available for
56 use by the HOB producer phase.
68 IN EFI_GUID
*ModuleName
,
69 IN EFI_PHYSICAL_ADDRESS Module
,
70 IN UINT64 ModuleLength
,
71 IN EFI_PHYSICAL_ADDRESS EntryPoint
77 Builds a HOB for a loaded PE32 module
81 HobStart - Start pointer of hob list
83 ModuleName - The GUID File Name of the HON from the Firmware Volume
85 Module - The 64 bit physical address of the module
87 ModuleLength - The length of the module in bytes
89 EntryPoint - The 64 bit physical address of the entry point to the module
100 BuildHobResourceDescriptor (
102 IN EFI_RESOURCE_TYPE ResourceType
,
103 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
,
104 IN EFI_PHYSICAL_ADDRESS PhysicalStart
,
105 IN UINT64 NumberOfBytes
111 Builds a HOB that describes a chunck of system memory
115 HobStart - Start pointer of hob list
117 ResourceType - The type of memory described by this HOB
119 ResourceAttribute - The memory attributes of the memory described by this HOB
121 PhysicalStart - The 64 bit physical address of memory described by this HOB
123 NumberOfBytes - The length of the memoty described by this HOB in bytes
128 EFI_NOT_AVAILABLE_YET
144 Builds a custom HOB that is tagged with a GUID for identification
148 HobStart - Start pointer of hob list
150 Guid - The GUID of the custome HOB type
152 Buffer - A pointer to the data for the custom HOB type
154 BufferSize - The size in byte of BufferSize
159 EFI_NOT_AVAILABLE_YET
165 BuildHobFvDescriptor (
167 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
174 Builds a Firmware Volume HOB
178 HobStart - Start pointer of hob list
180 BaseAddress - The base address of the Firmware Volume
182 Length - The size of the Firmware Volume in bytes
187 EFI_NOT_AVAILABLE_YET
195 IN UINT8 SizeOfMemorySpace
,
196 IN UINT8 SizeOfIoSpace
202 Builds a HOB for the CPU
206 HobStart - Start pointer of hob list
208 SizeOfMemorySpace - Identifies the maximum
209 physical memory addressibility of the processor.
211 SizeOfIoSpace - Identifies the maximum physical I/O addressibility
217 EFI_NOT_AVAILABLE_YET
225 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
232 Builds a HOB for the Stack
236 HobStart - Start pointer of hob list
238 BaseAddress - The 64 bit physical address of the Stack
240 Length - The length of the stack in bytes
245 EFI_NOT_AVAILABLE_YET
253 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
255 IN EFI_MEMORY_TYPE MemoryType
261 Builds a HOB for the bsp store
265 HobStart - Start pointer of hob list
267 BaseAddress - The 64 bit physical address of bsp store
269 Length - The length of the bsp store in bytes
271 MemoryType - Memory type of the bsp store
276 EFI_NOT_AVAILABLE_YET
282 BuildMemoryAllocationHob (
284 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
287 IN EFI_MEMORY_TYPE MemoryType
293 Builds a HOB for memory allocation
297 HobStart - Start pointer of hob list
299 BaseAddress - The base address of memory allocated by this HOB.
301 Length - The length in bytes of memory allocated by this HOB.
303 Name - A GUID that defines the memory allocation region¡¯s type and purpose,
304 as well as other fields within the memory allocation HOB.
306 MemoryType - Defines the type of memory allocated by this HOB.
311 EFI_NOT_AVAILABLE_YET
325 This function returns the first instance of a HOB type in a HOB list.
329 Type The HOB type to return.
330 HobStart The first HOB in the HOB list.
334 HobStart There were no HOBs found with the requested type.
335 else Returns the first HOB with the matching type.
345 OUT UINTN
*BufferSize OPTIONAL
351 This function searches the first instance of a HOB among the whole HOB list.
355 HobStart - A pointer to the start pointer of hob list.
357 Guid - A pointer to the GUID to match with in the HOB list.
359 Buffer - A pointer to the pointer to the data for the custom HOB type.
361 BufferSize - A Pointer to the size in byte of BufferSize.
365 The first instance of the matched GUID HOB among the whole HOB list
372 IN OUT VOID
**HobStart
,
375 OUT UINTN
*BufferSize OPTIONAL
380 Get the next guid hob.
383 HobStart A pointer to the start hob.
384 Guid A pointer to a guid.
385 Buffer A pointer to the buffer.
386 BufferSize Buffer size.
391 EFI_NOT_FOUND - Next Guid hob not found
393 EFI_SUCCESS - Next Guid hob found and data for this Guid got
395 EFI_INVALID_PARAMETER - invalid parameter