]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
Update to fix minor coding style issues.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / DxeIpl.h
CommitLineData
96226baa 1/** @file\r
fbc81c1e 2 Master header file for DxeIpl PEIM. All source files in this module should\r
f45af90b 3 include this file for common defininitions.\r
95276127 4\r
96226baa 5Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
95276127 6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
797a9d67 14**/\r
95276127 15\r
16#ifndef __PEI_DXEIPL_H__\r
17#define __PEI_DXEIPL_H__\r
18\r
859b72fa
A
19#include <PiPei.h>\r
20#include <Ppi/DxeIpl.h>\r
859b72fa
A
21#include <Protocol/EdkDecompress.h>\r
22#include <Ppi/EndOfPeiPhase.h>\r
23#include <Protocol/CustomizedDecompress.h>\r
24#include <Protocol/Decompress.h>\r
859b72fa 25#include <Ppi/MemoryDiscovered.h>\r
b74350e9 26#include <Ppi/ReadOnlyVariable2.h>\r
27#include <Guid/MemoryTypeInformation.h>\r
b0d803fe 28#include <Ppi/Decompress.h>\r
29#include <Ppi/FirmwareVolumeInfo.h>\r
30\r
30c8f861 31#include <Guid/MemoryAllocationHob.h>\r
b0d803fe 32#include <Guid/FirmwareFileSystem2.h>\r
33\r
859b72fa
A
34#include <Library/DebugLib.h>\r
35#include <Library/PeimEntryPoint.h>\r
36#include <Library/BaseLib.h>\r
37#include <Library/HobLib.h>\r
38#include <Library/PeiServicesLib.h>\r
39#include <Library/ReportStatusCodeLib.h>\r
40#include <Library/CacheMaintenanceLib.h>\r
859b72fa 41#include <Library/UefiDecompressLib.h>\r
18fd8d65 42#include <Library/ExtractGuidedSectionLib.h>\r
859b72fa
A
43#include <Library/PeiServicesTablePointerLib.h>\r
44#include <Library/BaseMemoryLib.h>\r
45#include <Library/MemoryAllocationLib.h>\r
46#include <Library/PcdLib.h>\r
47#include <Library/PeCoffLib.h>\r
4fb31c2c 48#include <Library/S3Lib.h>\r
49#include <Library/RecoveryLib.h>\r
95276127 50\r
51#define STACK_SIZE 0x20000\r
52#define BSP_STORE_SIZE 0x4000\r
53\r
54#define GET_OCCUPIED_SIZE(ActualSize, Alignment) ((ActualSize + (Alignment - 1)) & ~(Alignment - 1))\r
55\r
56extern BOOLEAN gInMemory;\r
57\r
91d92e25 58\r
59\r
60\r
61/**\r
62 Loads and relocates a PE/COFF image into memory.\r
63\r
64 @param FileHandle The image file handle\r
65 @param ImageAddress The base address of the relocated PE/COFF image\r
66 @param ImageSize The size of the relocated PE/COFF image\r
67 @param EntryPoint The entry point of the relocated PE/COFF image\r
68 \r
69 @return EFI_SUCCESS The file was loaded and relocated\r
70 @return EFI_OUT_OF_RESOURCES There was not enough memory to load and relocate the PE/COFF file\r
71\r
72**/\r
95276127 73EFI_STATUS\r
74PeiLoadFile (\r
b0d803fe 75 IN EFI_PEI_FILE_HANDLE FileHandle,\r
95276127 76 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r
77 OUT UINT64 *ImageSize,\r
78 OUT EFI_PHYSICAL_ADDRESS *EntryPoint\r
f45af90b 79 );\r
95276127 80\r
91d92e25 81\r
82\r
83/**\r
84 Find DxeCore driver from all First Volumes.\r
85\r
86 @param FileHandle Pointer to FFS file to search.\r
87 \r
88 @return EFI_SUCESS Success to find the FFS in specificed FV\r
89 @return others Fail to find the FFS in specificed FV\r
90\r
91**/\r
b0d803fe 92EFI_STATUS\r
288f9b38 93DxeIplFindDxeCore (\r
b0d803fe 94 OUT EFI_PEI_FILE_HANDLE *FileHandle\r
f45af90b 95 );\r
95276127 96\r
91d92e25 97\r
98\r
99/**\r
100 This function simply retrieves the function pointer of ImageRead in\r
101 ImageContext structure.\r
102 \r
103 @param ImageContext A pointer to the structure of \r
104 PE_COFF_LOADER_IMAGE_CONTEXT\r
105 \r
106 @retval EFI_SUCCESS This function always return EFI_SUCCESS.\r
107\r
108**/\r
95276127 109EFI_STATUS\r
110GetImageReadFunction (\r
111 IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
f45af90b 112 );\r
95276127 113\r
91d92e25 114\r
115\r
116/**\r
117 Main entry point to last PEIM \r
118 \r
119 @param This Entry point for DXE IPL PPI\r
120 @param PeiServices General purpose services available to every PEIM.\r
121 @param HobList Address to the Pei HOB list\r
122 \r
123 @return EFI_SUCCESS DXE core was successfully loaded. \r
124 @return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.\r
125\r
126**/\r
95276127 127EFI_STATUS\r
128EFIAPI\r
129DxeLoadCore (\r
130 IN EFI_DXE_IPL_PPI *This,\r
131 IN EFI_PEI_SERVICES **PeiServices,\r
132 IN EFI_PEI_HOB_POINTERS HobList\r
133 );\r
134\r
91d92e25 135\r
136\r
137/**\r
138 Transfers control to DxeCore.\r
139\r
140 This function performs a CPU architecture specific operations to execute\r
141 the entry point of DxeCore with the parameters of HobList.\r
142 It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.\r
143\r
144 @param DxeCoreEntryPoint The entrypoint of DxeCore.\r
145 @param HobList The start of HobList passed to DxeCore.\r
146 @param EndOfPeiSignal The PPI descriptor for EFI_END_OF_PEI_PPI.\r
147\r
148**/\r
95276127 149VOID\r
150HandOffToDxeCore (\r
151 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r
152 IN EFI_PEI_HOB_POINTERS HobList,\r
153 IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal\r
154 );\r
155\r
91d92e25 156\r
157\r
158/**\r
159 Updates the Stack HOB passed to DXE phase.\r
160\r
161 This function traverses the whole HOB list and update the stack HOB to\r
162 reflect the real stack that is used by DXE core.\r
163\r
164 @param BaseAddress The lower address of stack used by DxeCore.\r
165 @param Length The length of stack used by DxeCore.\r
166\r
167**/\r
30c8f861 168VOID\r
169UpdateStackHob (\r
170 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
171 IN UINT64 Length\r
172 );\r
173\r
91d92e25 174\r
175\r
176/**\r
177 Initializes the Dxe Ipl PPI\r
178\r
179 @param FfsHandle The handle of FFS file.\r
180 @param PeiServices General purpose services available to\r
181 every PEIM.\r
182 @return EFI_SUCESS\r
183\r
184**/\r
95276127 185EFI_STATUS\r
186EFIAPI\r
187PeimInitializeDxeIpl (\r
b0d803fe 188 IN EFI_PEI_FILE_HANDLE FfsHandle,\r
95276127 189 IN EFI_PEI_SERVICES **PeiServices\r
f45af90b 190 );\r
95276127 191\r
192\r
193#endif\r