--- /dev/null
+/*++\r
+\r
+Copyright (c) 2004 - 2007, Intel Corporation \r
+All rights reserved. This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution. The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php \r
+ \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+Module Name:\r
+\r
+ PeiHobLib.h\r
+\r
+Abstract:\r
+\r
+\r
+--*/\r
+\r
+#ifndef _EFI_PEI_HOB_LIB_H_\r
+#define _EFI_PEI_HOB_LIB_H_\r
+\r
+#include "PeiApi.h" // EFI_PEI_SERVICES definition\r
+#define EFI_STACK_SIZE 0x20000\r
+#define EFI_BSP_STORE_SIZE 0x4000\r
+\r
+EFI_STATUS\r
+BuildHobHandoffInfoTable (\r
+ IN VOID *HobStart,\r
+ IN UINT16 Version,\r
+ IN EFI_BOOT_MODE BootMode,\r
+ IN EFI_PHYSICAL_ADDRESS EfiMemoryTop,\r
+ IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom,\r
+ IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop,\r
+ IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HandoffInformationTable Information Table HOB\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+ Version - The version number pertaining to the PHIT HOB definition.\r
+ BootMode - The system boot mode as determined during the HOB producer phase.\r
+ EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB\r
+ producer phase.\r
+ EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB\r
+ producer phase.\r
+ EfiFreeMemoryTop - The highest address location of free memory that is currently available for use\r
+ by the HOB producer phase.\r
+ EfiFreeMemoryBottom - The lowest address location of free memory that is available for \r
+ use by the HOB producer phase.\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobModule (\r
+ IN VOID *HobStart,\r
+ IN EFI_GUID *ModuleName,\r
+ IN EFI_PHYSICAL_ADDRESS Module,\r
+ IN UINT64 ModuleLength,\r
+ IN EFI_PHYSICAL_ADDRESS EntryPoint\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HOB for a loaded PE32 module\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ ModuleName - The GUID File Name of the HON from the Firmware Volume\r
+\r
+ Module - The 64 bit physical address of the module\r
+\r
+ ModuleLength - The length of the module in bytes\r
+\r
+ EntryPoint - The 64 bit physical address of the entry point to the module\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobResourceDescriptor (\r
+ IN VOID *HobStart,\r
+ IN EFI_RESOURCE_TYPE ResourceType,\r
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,\r
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r
+ IN UINT64 NumberOfBytes\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HOB that describes a chunck of system memory\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ ResourceType - The type of memory described by this HOB\r
+\r
+ ResourceAttribute - The memory attributes of the memory described by this HOB\r
+\r
+ PhysicalStart - The 64 bit physical address of memory described by this HOB\r
+\r
+ NumberOfBytes - The length of the memoty described by this HOB in bytes\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobGuidType (\r
+ IN VOID *HobStart,\r
+ IN EFI_GUID *Guid,\r
+ IN VOID *Buffer,\r
+ IN UINTN BufferSize\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a custom HOB that is tagged with a GUID for identification\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ Guid - The GUID of the custome HOB type\r
+\r
+ Buffer - A pointer to the data for the custom HOB type\r
+\r
+ BufferSize - The size in byte of BufferSize\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobFvDescriptor (\r
+ IN VOID *HobStart,\r
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
+ IN UINT64 Length\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a Firmware Volume HOB\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ BaseAddress - The base address of the Firmware Volume\r
+\r
+ Length - The size of the Firmware Volume in bytes\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobCpu (\r
+ IN VOID *HobStart,\r
+ IN UINT8 SizeOfMemorySpace,\r
+ IN UINT8 SizeOfIoSpace\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HOB for the CPU\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ SizeOfMemorySpace - Identifies the maximum \r
+ physical memory addressibility of the processor.\r
+\r
+ SizeOfIoSpace - Identifies the maximum physical I/O addressibility \r
+ of the processor.\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobStack (\r
+ IN VOID *HobStart,\r
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
+ IN UINT64 Length\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HOB for the Stack\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ BaseAddress - The 64 bit physical address of the Stack\r
+\r
+ Length - The length of the stack in bytes\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildHobBspStore (\r
+ IN VOID *HobStart,\r
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
+ IN UINT64 Length,\r
+ IN EFI_MEMORY_TYPE MemoryType\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HOB for the bsp store\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ BaseAddress - The 64 bit physical address of bsp store\r
+\r
+ Length - The length of the bsp store in bytes\r
+ \r
+ MemoryType - Memory type of the bsp store\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+BuildMemoryAllocationHob (\r
+ IN VOID *HobStart,\r
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
+ IN UINT64 Length,\r
+ IN EFI_GUID *Name,\r
+ IN EFI_MEMORY_TYPE MemoryType\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Builds a HOB for memory allocation\r
+\r
+Arguments:\r
+\r
+ HobStart - Start pointer of hob list\r
+\r
+ BaseAddress - The base address of memory allocated by this HOB.\r
+\r
+ Length - The length in bytes of memory allocated by this HOB.\r
+\r
+ Name - A GUID that defines the memory allocation region¡¯s type and purpose, \r
+ as well as other fields within the memory allocation HOB.\r
+\r
+ MemoryType - Defines the type of memory allocated by this HOB.\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS\r
+ EFI_NOT_AVAILABLE_YET\r
+\r
+--*/\r
+;\r
+\r
+VOID *\r
+GetHob (\r
+ IN UINT16 Type,\r
+ IN VOID *HobStart\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ This function returns the first instance of a HOB type in a HOB list.\r
+ \r
+Arguments:\r
+\r
+ Type The HOB type to return.\r
+ HobStart The first HOB in the HOB list.\r
+ \r
+Returns:\r
+\r
+ HobStart There were no HOBs found with the requested type.\r
+ else Returns the first HOB with the matching type.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+GetFirstGuidHob (\r
+ IN VOID **HobStart,\r
+ IN EFI_GUID *Guid,\r
+ OUT VOID **Buffer,\r
+ OUT UINTN *BufferSize OPTIONAL\r
+ ) \r
+/*++\r
+\r
+Routine Description:\r
+\r
+ This function searches the first instance of a HOB among the whole HOB list. \r
+\r
+Arguments:\r
+\r
+ HobStart - A pointer to the start pointer of hob list.\r
+\r
+ Guid - A pointer to the GUID to match with in the HOB list.\r
+\r
+ Buffer - A pointer to the pointer to the data for the custom HOB type.\r
+\r
+ BufferSize - A Pointer to the size in byte of BufferSize.\r
+\r
+Returns:\r
+ EFI_SUCCESS\r
+ The first instance of the matched GUID HOB among the whole HOB list\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+GetNextGuidHob (\r
+ IN OUT VOID **HobStart,\r
+ IN EFI_GUID * Guid,\r
+ OUT VOID **Buffer,\r
+ OUT UINTN *BufferSize OPTIONAL\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ Get the next guid hob.\r
+ \r
+Arguments:\r
+ HobStart A pointer to the start hob.\r
+ Guid A pointer to a guid.\r
+ Buffer A pointer to the buffer.\r
+ BufferSize Buffer size.\r
+ \r
+Returns:\r
+ Status code.\r
+\r
+ EFI_NOT_FOUND - Next Guid hob not found\r
+ \r
+ EFI_SUCCESS - Next Guid hob found and data for this Guid got\r
+ \r
+ EFI_INVALID_PARAMETER - invalid parameter\r
+\r
+--*/\r
+;\r
+\r
+#endif\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2004 - 2007, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- PeiHobLib.h\r
-\r
-Abstract:\r
-\r
-\r
---*/\r
-\r
-#ifndef _EFI_PEI_HOB_LIB_H_\r
-#define _EFI_PEI_HOB_LIB_H_\r
-\r
-#include "PeiApi.h" // EFI_PEI_SERVICES definition\r
-#define EFI_STACK_SIZE 0x20000\r
-#define EFI_BSP_STORE_SIZE 0x4000\r
-\r
-EFI_STATUS\r
-BuildHobHandoffInfoTable (\r
- IN VOID *HobStart,\r
- IN UINT16 Version,\r
- IN EFI_BOOT_MODE BootMode,\r
- IN EFI_PHYSICAL_ADDRESS EfiMemoryTop,\r
- IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom,\r
- IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop,\r
- IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HandoffInformationTable Information Table HOB\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
- Version - The version number pertaining to the PHIT HOB definition.\r
- BootMode - The system boot mode as determined during the HOB producer phase.\r
- EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB\r
- producer phase.\r
- EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB\r
- producer phase.\r
- EfiFreeMemoryTop - The highest address location of free memory that is currently available for use\r
- by the HOB producer phase.\r
- EfiFreeMemoryBottom - The lowest address location of free memory that is available for \r
- use by the HOB producer phase.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobModule (\r
- IN VOID *HobStart,\r
- IN EFI_GUID *ModuleName,\r
- IN EFI_PHYSICAL_ADDRESS Module,\r
- IN UINT64 ModuleLength,\r
- IN EFI_PHYSICAL_ADDRESS EntryPoint\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HOB for a loaded PE32 module\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- ModuleName - The GUID File Name of the HON from the Firmware Volume\r
-\r
- Module - The 64 bit physical address of the module\r
-\r
- ModuleLength - The length of the module in bytes\r
-\r
- EntryPoint - The 64 bit physical address of the entry point to the module\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobResourceDescriptor (\r
- IN VOID *HobStart,\r
- IN EFI_RESOURCE_TYPE ResourceType,\r
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,\r
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r
- IN UINT64 NumberOfBytes\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HOB that describes a chunck of system memory\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- ResourceType - The type of memory described by this HOB\r
-\r
- ResourceAttribute - The memory attributes of the memory described by this HOB\r
-\r
- PhysicalStart - The 64 bit physical address of memory described by this HOB\r
-\r
- NumberOfBytes - The length of the memoty described by this HOB in bytes\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobGuidType (\r
- IN VOID *HobStart,\r
- IN EFI_GUID *Guid,\r
- IN VOID *Buffer,\r
- IN UINTN BufferSize\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a custom HOB that is tagged with a GUID for identification\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- Guid - The GUID of the custome HOB type\r
-\r
- Buffer - A pointer to the data for the custom HOB type\r
-\r
- BufferSize - The size in byte of BufferSize\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobFvDescriptor (\r
- IN VOID *HobStart,\r
- IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
- IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a Firmware Volume HOB\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- BaseAddress - The base address of the Firmware Volume\r
-\r
- Length - The size of the Firmware Volume in bytes\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobCpu (\r
- IN VOID *HobStart,\r
- IN UINT8 SizeOfMemorySpace,\r
- IN UINT8 SizeOfIoSpace\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HOB for the CPU\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- SizeOfMemorySpace - Identifies the maximum \r
- physical memory addressibility of the processor.\r
-\r
- SizeOfIoSpace - Identifies the maximum physical I/O addressibility \r
- of the processor.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobStack (\r
- IN VOID *HobStart,\r
- IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
- IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HOB for the Stack\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- BaseAddress - The 64 bit physical address of the Stack\r
-\r
- Length - The length of the stack in bytes\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildHobBspStore (\r
- IN VOID *HobStart,\r
- IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
- IN UINT64 Length,\r
- IN EFI_MEMORY_TYPE MemoryType\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HOB for the bsp store\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- BaseAddress - The 64 bit physical address of bsp store\r
-\r
- Length - The length of the bsp store in bytes\r
- \r
- MemoryType - Memory type of the bsp store\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-BuildMemoryAllocationHob (\r
- IN VOID *HobStart,\r
- IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
- IN UINT64 Length,\r
- IN EFI_GUID *Name,\r
- IN EFI_MEMORY_TYPE MemoryType\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Builds a HOB for memory allocation\r
-\r
-Arguments:\r
-\r
- HobStart - Start pointer of hob list\r
-\r
- BaseAddress - The base address of memory allocated by this HOB.\r
-\r
- Length - The length in bytes of memory allocated by this HOB.\r
-\r
- Name - A GUID that defines the memory allocation region¡¯s type and purpose, \r
- as well as other fields within the memory allocation HOB.\r
-\r
- MemoryType - Defines the type of memory allocated by this HOB.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS\r
- EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-;\r
-\r
-VOID *\r
-GetHob (\r
- IN UINT16 Type,\r
- IN VOID *HobStart\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- This function returns the first instance of a HOB type in a HOB list.\r
- \r
-Arguments:\r
-\r
- Type The HOB type to return.\r
- HobStart The first HOB in the HOB list.\r
- \r
-Returns:\r
-\r
- HobStart There were no HOBs found with the requested type.\r
- else Returns the first HOB with the matching type.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-GetFirstGuidHob (\r
- IN VOID **HobStart,\r
- IN EFI_GUID *Guid,\r
- OUT VOID **Buffer,\r
- OUT UINTN *BufferSize OPTIONAL\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
- This function searches the first instance of a HOB among the whole HOB list. \r
-\r
-Arguments:\r
-\r
- HobStart - A pointer to the start pointer of hob list.\r
-\r
- Guid - A pointer to the GUID to match with in the HOB list.\r
-\r
- Buffer - A pointer to the pointer to the data for the custom HOB type.\r
-\r
- BufferSize - A Pointer to the size in byte of BufferSize.\r
-\r
-Returns:\r
- EFI_SUCCESS\r
- The first instance of the matched GUID HOB among the whole HOB list\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-GetNextGuidHob (\r
- IN OUT VOID **HobStart,\r
- IN EFI_GUID * Guid,\r
- OUT VOID **Buffer,\r
- OUT UINTN *BufferSize OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Get the next guid hob.\r
- \r
-Arguments:\r
- HobStart A pointer to the start hob.\r
- Guid A pointer to a guid.\r
- Buffer A pointer to the buffer.\r
- BufferSize Buffer size.\r
- \r
-Returns:\r
- Status code.\r
-\r
- EFI_NOT_FOUND - Next Guid hob not found\r
- \r
- EFI_SUCCESS - Next Guid hob found and data for this Guid got\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
-\r
-#endif\r