]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
Minor coding style adjustment for DxeIpl.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / DxeIpl.h
index 71ca9c360eaf114197002d227b86577cf2a593e6..3eac29da295fc13c10fa06b586516541557cfad8 100644 (file)
@@ -1,6 +1,8 @@
-/*++\r
+/** @file\r
+  Master header file for DxeIpl PEIM. All source files in this module should\r
+  include this file for common defininitions. \r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\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
@@ -9,13 +11,7 @@ http://opensource.org/licenses/bsd-license.php
 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
-  DxeIpl.h\r
-\r
-Abstract:\r
-\r
---*/\r
+**/\r
 \r
 #ifndef __PEI_DXEIPL_H__\r
 #define __PEI_DXEIPL_H__\r
@@ -26,13 +22,13 @@ Abstract:
 #include <Ppi/EndOfPeiPhase.h>\r
 #include <Protocol/CustomizedDecompress.h>\r
 #include <Protocol/Decompress.h>\r
-#include <Ppi/Security.h>\r
-#include <Ppi/SectionExtraction.h>\r
-#include <Ppi/FvLoadFile.h>\r
 #include <Ppi/MemoryDiscovered.h>\r
+#include <Ppi/ReadOnlyVariable2.h>\r
+#include <Guid/MemoryTypeInformation.h>\r
 #include <Ppi/Decompress.h>\r
 #include <Ppi/FirmwareVolumeInfo.h>\r
 \r
+#include <Guid/MemoryAllocationHob.h>\r
 #include <Guid/FirmwareFileSystem2.h>\r
 \r
 #include <Library/DebugLib.h>\r
@@ -42,9 +38,8 @@ Abstract:
 #include <Library/PeiServicesLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 #include <Library/CacheMaintenanceLib.h>\r
-#include <Library/PeCoffLoaderLib.h>\r
 #include <Library/UefiDecompressLib.h>\r
-#include <Library/CustomDecompressLib.h>\r
+#include <Library/ExtractGuidedSectionLib.h>\r
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
@@ -52,7 +47,6 @@ Abstract:
 #include <Library/PeCoffLib.h>\r
 #include <Library/S3Lib.h>\r
 #include <Library/RecoveryLib.h>\r
-#include <Library/PeiPiLib.h>\r
 \r
 #define STACK_SIZE      0x20000\r
 #define BSP_STORE_SIZE  0x4000\r
@@ -61,15 +55,21 @@ Abstract:
 \r
 extern BOOLEAN gInMemory;\r
 \r
-EFI_STATUS\r
-PeiFindFile (\r
-  IN  UINT8                  Type,\r
-  IN  EFI_SECTION_TYPE       SectionType,\r
-  OUT EFI_GUID               *FileName,\r
-  OUT VOID                   **Pe32Data\r
-  )\r
-;\r
 \r
+\r
+\r
+/**\r
+   Loads and relocates a PE/COFF image into memory.\r
+\r
+   @param FileHandle        The image file handle\r
+   @param ImageAddress      The base address of the relocated PE/COFF image\r
+   @param ImageSize         The size of the relocated PE/COFF image\r
+   @param EntryPoint        The entry point of the relocated PE/COFF image\r
+   \r
+   @return EFI_SUCCESS           The file was loaded and relocated\r
+   @return EFI_OUT_OF_RESOURCES  There was not enough memory to load and relocate the PE/COFF file\r
+\r
+**/\r
 EFI_STATUS\r
 PeiLoadFile (\r
   IN  EFI_PEI_FILE_HANDLE                       FileHandle,\r
@@ -79,52 +79,54 @@ PeiLoadFile (
   )\r
 ;\r
 \r
-EFI_STATUS\r
-DxeIplAddEncapsulatedFirmwareVolumes (\r
-  VOID\r
-  )\r
-;\r
 \r
+\r
+/**\r
+   Find DxeCore driver from all First Volumes.\r
+\r
+   @param FileHandle    Pointer to FFS file to search.\r
+   \r
+   @return EFI_SUCESS   Success to find the FFS in specificed FV\r
+   @return others       Fail to find the FFS in specificed FV\r
+\r
+**/\r
 EFI_STATUS\r
-DxeIplFindFirmwareVolumeInstance (\r
-  IN OUT UINTN              *Instance,\r
-  IN  EFI_FV_FILETYPE       SeachType,\r
-  OUT EFI_PEI_FV_HANDLE     *VolumeHandle,\r
+DxeIplFindDxeCore (\r
   OUT EFI_PEI_FILE_HANDLE   *FileHandle\r
   )\r
 ;\r
 \r
+\r
+\r
+/**\r
+   This function simply retrieves the function pointer of ImageRead in\r
+   ImageContext structure.\r
+    \r
+   @param ImageContext       A pointer to the structure of \r
+                             PE_COFF_LOADER_IMAGE_CONTEXT\r
+   \r
+   @retval EFI_SUCCESS       This function always return EFI_SUCCESS.\r
+\r
+**/\r
 EFI_STATUS\r
 GetImageReadFunction (\r
   IN      PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 ;\r
 \r
-EFI_STATUS\r
-PeiImageRead (\r
-  IN     VOID    *FileHandle,\r
-  IN     UINTN   FileOffset,\r
-  IN OUT UINTN   *ReadSize,\r
-  OUT    VOID    *Buffer\r
-  )\r
-;\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-DxeIplLoadFile (\r
-  IN EFI_PEI_FV_FILE_LOADER_PPI                 *This,\r
-  IN  EFI_FFS_FILE_HEADER                       *FfsHeader,\r
-  OUT EFI_PHYSICAL_ADDRESS                      *ImageAddress,\r
-  OUT UINT64                                    *ImageSize,\r
-  OUT EFI_PHYSICAL_ADDRESS                      *EntryPoint\r
-  );\r
 \r
-EFI_STATUS\r
-ShadowDxeIpl (\r
-  IN EFI_FFS_FILE_HEADER                       *DxeIpl,\r
-  IN EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader\r
-  );\r
+/**\r
+   Main entry point to last PEIM \r
+    \r
+   @param This          Entry point for DXE IPL PPI\r
+   @param PeiServices   General purpose services available to every PEIM.\r
+   @param HobList       Address to the Pei HOB list\r
+   \r
+   @return EFI_SUCCESS              DXE core was successfully loaded. \r
+   @return EFI_OUT_OF_RESOURCES     There are not enough resources to load DXE core.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DxeLoadCore (\r
@@ -133,6 +135,20 @@ DxeLoadCore (
   IN EFI_PEI_HOB_POINTERS  HobList\r
   );\r
 \r
+\r
+\r
+/**\r
+   Transfers control to DxeCore.\r
+\r
+   This function performs a CPU architecture specific operations to execute\r
+   the entry point of DxeCore with the parameters of HobList.\r
+   It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.\r
+\r
+   @param DxeCoreEntryPoint         The entrypoint of DxeCore.\r
+   @param HobList                   The start of HobList passed to DxeCore.\r
+   @param EndOfPeiSignal            The PPI descriptor for EFI_END_OF_PEI_PPI.\r
+\r
+**/\r
 VOID\r
 HandOffToDxeCore (\r
   IN EFI_PHYSICAL_ADDRESS   DxeCoreEntryPoint,\r
@@ -140,14 +156,35 @@ HandOffToDxeCore (
   IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal\r
   );\r
 \r
-EFI_STATUS\r
-PeiProcessFile (\r
-  IN      EFI_SECTION_TYPE       SectionType,\r
-  IN      EFI_FFS_FILE_HEADER    *FfsFileHeader,\r
-  OUT     VOID                   **Pe32Data,\r
-  IN      EFI_PEI_HOB_POINTERS   *OrigHob\r
+\r
+\r
+/**\r
+   Updates the Stack HOB passed to DXE phase.\r
+\r
+   This function traverses the whole HOB list and update the stack HOB to\r
+   reflect the real stack that is used by DXE core.\r
+\r
+   @param BaseAddress           The lower address of stack used by DxeCore.\r
+   @param Length                The length of stack used by DxeCore.\r
+\r
+**/\r
+VOID\r
+UpdateStackHob (\r
+  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
+  IN UINT64                      Length\r
   );\r
 \r
+\r
+\r
+/**\r
+  Initializes the Dxe Ipl PPI\r
+\r
+  @param  FfsHandle   The handle of FFS file.\r
+  @param  PeiServices General purpose services available to\r
+                      every PEIM.\r
+  @return EFI_SUCESS\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeimInitializeDxeIpl (\r