-Module Name:\r
-\r
- Image.c\r
-\r
-Abstract:\r
-\r
- Pei Core Load Image Support\r
-\r
---*/\r
-\r
-#include <PeiMain.h>\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file\r
-\r
-Arguments:\r
-\r
- FileHandle - The handle to the PE/COFF file\r
- FileOffset - The offset, in bytes, into the file to read\r
- ReadSize - The number of bytes to read from the file starting at FileOffset\r
- Buffer - A pointer to the buffer to read the data into.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset\r
-\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
-Routine Description:\r
-\r
- Routine for loading file image.\r
-\r
-Arguments:\r
-\r
- PeiServices - The PEI core services table.\r
- FileHandle - Pointer to the FFS file header of the image.\r
- ImageAddressArg - Pointer to PE/TE image.\r
- ImageSizeArg - Size of PE/TE image.\r
- EntryPoint - Pointer to entry point of specified image file for output.\r
- AuthenticationState - Pointer to attestation authentication state of image.\r
-\r
-Returns:\r
-\r
- Status - EFI_SUCCESS - Image is successfully loaded.\r
- EFI_NOT_FOUND - Fail to locate necessary PPI\r
- Others - Fail to load file.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeiLoadImageLoadImageWrapper (\r
- IN CONST EFI_PEI_LOAD_FILE_PPI *This,\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
-Routine Description:\r
-\r
- The wrapper function of PeiLoadImageLoadImage().\r
-\r
-Arguments:\r
-\r
- This - Pointer to EFI_PEI_LOAD_FILE_PPI.\r
- PeiServices - The PEI core services table.\r
- FileHandle - Pointer to the FFS file header of the image.\r
- ImageAddressArg - Pointer to PE/TE image.\r
- ImageSizeArg - Size of PE/TE image.\r
- EntryPoint - Pointer to entry point of specified image file for output.\r
- AuthenticationState - Pointer to attestation authentication state of image.\r