\r
#include "DxeIpl.h"\r
\r
-\r
-\r
-\r
-\r
/**\r
Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file\r
\r
//\r
// This function assumes 32-bit alignment to increase performance\r
//\r
-// ASSERT (ALIGN_POINTER (Destination32, sizeof (UINT32)) == Destination32);\r
-// ASSERT (ALIGN_POINTER (Source32, sizeof (UINT32)) == Source32);\r
\r
Length = *ReadSize;\r
while (Length-- != 0) {\r
\r
return EFI_SUCCESS;\r
}\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
- VOID *MemoryBuffer;\r
-\r
- if (gInMemory) {\r
- ImageContext->ImageRead = PeiImageRead;\r
- return EFI_SUCCESS;\r
- }\r
-\r
- //\r
- // BugBug; This code assumes PeiImageRead() is less than a page in size!\r
- // Allocate a page so we can shaddow the read function from FLASH into \r
- // memory to increase performance. \r
- //\r
- \r
- MemoryBuffer = AllocateCopyPool (0x400, (VOID *)(UINTN) PeiImageRead);\r
- ASSERT (MemoryBuffer != NULL);\r
-\r
- ImageContext->ImageRead = (PE_COFF_LOADER_READ_FILE) (UINTN) MemoryBuffer;\r
-\r
- return EFI_SUCCESS;\r
-}\r