]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Image/Image.c
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Image / Image.c
index d08fee42e150b1339f18efc9592c760e26015c6c..efe8c83b101b8a7a4679dc5f39861b8abcfbe9e0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pei Core Load Image Support\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2008, 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
@@ -14,32 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <PeiMain.h>\r
 \r
-/**\r
-  Routine for loading file image.\r
-\r
-  @param PeiServices      The PEI core services table.\r
-  @param FileHandle       Pointer to the FFS file header of the image.\r
-  @param ImageAddressArg  Pointer to PE/TE image.\r
-  @param ImageSizeArg     Size of PE/TE image.\r
-  @param EntryPoint       Pointer to entry point of specified image file for output.\r
-  @param AuthenticationState - Pointer to attestation authentication state of image.\r
-\r
-  @retval EFI_SUCCESS    - Image is successfully loaded.\r
-  @retval EFI_NOT_FOUND  - Fail to locate necessary PPI\r
-  @retval Others         - Fail to load file.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiLoadImageLoadImage (\r
-  IN     EFI_PEI_SERVICES             **PeiServices,\r
-  IN     EFI_PEI_FILE_HANDLE          FileHandle,\r
-  OUT    EFI_PHYSICAL_ADDRESS         *ImageAddressArg,  OPTIONAL\r
-  OUT    UINT64                       *ImageSizeArg,     OPTIONAL\r
-  OUT    EFI_PHYSICAL_ADDRESS         *EntryPoint,\r
-  OUT    UINT32                       *AuthenticationState\r
-  )\r
-;\r
-\r
 /**\r
   The wrapper function of PeiLoadImageLoadImage().\r
 \r
@@ -62,8 +36,7 @@ PeiLoadImageLoadImageWrapper (
   OUT    UINT64                       *ImageSizeArg,     OPTIONAL\r
   OUT    EFI_PHYSICAL_ADDRESS         *EntryPoint,\r
   OUT    UINT32                       *AuthenticationState\r
-  )\r
-;\r
+  );\r
 \r
 STATIC EFI_PEI_LOAD_FILE_PPI   mPeiLoadImagePpi = {\r
   PeiLoadImageLoadImageWrapper\r
@@ -94,7 +67,7 @@ EFIAPI
 PeiImageRead (\r
   IN     VOID    *FileHandle,\r
   IN     UINTN   FileOffset,\r
-  IN OUT UINTN   *ReadSize,\r
+  IN     UINTN   *ReadSize,\r
   OUT    VOID    *Buffer\r
   )\r
 {\r
@@ -114,7 +87,7 @@ PeiImageRead (
 \r
 /**\r
 \r
-  Support routine to return the Image Read.\r
+  Support routine to get the Image read file function.\r
 \r
   @param ImageContext    - The context of the image being loaded\r
 \r
@@ -150,6 +123,7 @@ GetImageReadFunction (
 \r
   @retval EFI_SUCCESS           The file was loaded and relocated\r
   @retval EFI_OUT_OF_RESOURCES  There was not enough memory to load and relocate the PE/COFF file\r
+  @retval EFI_INVALID_PARAMETER The image withou .reloc section can't be relocated.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -223,18 +197,20 @@ LoadAndRelocatePeCoffImage (
 }\r
 \r
 /**\r
-  Routine for loading file image.\r
+  Loads a PEIM into memory for subsequent execution. If there are compressed \r
+  images or images that need to be relocated into memory for performance reasons, \r
+  this service performs that transformation.\r
 \r
-  @param PeiServices      The PEI core services table.\r
+  @param PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r
   @param FileHandle       Pointer to the FFS file header of the image.\r
   @param ImageAddressArg  Pointer to PE/TE image.\r
   @param ImageSizeArg     Size of PE/TE image.\r
   @param EntryPoint       Pointer to entry point of specified image file for output.\r
   @param AuthenticationState - Pointer to attestation authentication state of image.\r
 \r
-  @retval EFI_SUCCESS    - Image is successfully loaded.\r
-  @retval EFI_NOT_FOUND  - Fail to locate necessary PPI\r
-  @retval Others         - Fail to load file.\r
+  @retval EFI_SUCCESS      Image is successfully loaded.\r
+  @retval EFI_NOT_FOUND    Fail to locate necessary PPI.\r
+  @retval EFI_UNSUPPORTED  Image Machine Type is not supported.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -355,12 +331,12 @@ PeiLoadImageLoadImage (
     // Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi\r
     //\r
     if (Machine != IMAGE_FILE_MACHINE_IA64) {\r
-      DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%10p EntryPoint=0x%10p ", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)*EntryPoint));\r
+      DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%11p EntryPoint=0x%11p ", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)*EntryPoint));\r
     } else {\r
       //\r
       // For IPF Image, the real entry point should be print.\r
       //\r
-      DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%10p EntryPoint=0x%10p ", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)(*(UINT64 *)(UINTN)*EntryPoint)));\r
+      DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%11p EntryPoint=0x%11p ", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)(*(UINT64 *)(UINTN)*EntryPoint)));\r
     }\r
     \r
     //\r
@@ -428,11 +404,11 @@ PeiLoadImageLoadImageWrapper (
 }\r
 \r
 /**\r
+  Routine to load image file for subsequent execution by LoadFile Ppi.\r
+  If any LoadFile Ppi is not found, the build-in support function for the PE32+/TE \r
+  XIP image format is used.\r
 \r
-  Routine for load image file.\r
-\r
-\r
-  @param PeiServices     - The PEI core services table.\r
+  @param PeiServices     - An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r
   @param FileHandle      - Pointer to the FFS file header of the image.\r
   @param EntryPoint      - Pointer to entry point of specified image file for output.\r
   @param AuthenticationState - Pointer to attestation authentication state of image.\r