return Status;\r
}\r
\r
+ if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Image->ImageContext.Machine)) {\r
+ //\r
+ // The PE/COFF loader can support loading image types that can be executed. \r
+ // If we loaded an image type that we can not execute return EFI_UNSUPORTED. \r
+ //\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
+\r
//\r
// Allocate memory of the correct memory type aligned on the required image boundry\r
//\r
// Print the load address and the PDB file name if it is available\r
//\r
\r
- DEBUG_CODE (\r
- {\r
+ DEBUG_CODE_BEGIN ();\r
+ \r
UINTN Index;\r
UINTN StartIndex;\r
CHAR8 EfiFileName[256];\r
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName)); // &Image->ImageContext.PdbPointer[StartIndex]));\r
}\r
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "\n"));\r
- }\r
- );\r
+ \r
+ DEBUG_CODE_END ();\r
\r
return EFI_SUCCESS;\r
\r
//\r
PERF_START (ImageHandle, START_IMAGE_TOK, NULL, 0);\r
\r
- if (sizeof (UINTN) == 4 && Image->Machine == EFI_IMAGE_MACHINE_X64) {\r
- return EFI_UNSUPPORTED;\r
- } else if (sizeof (UINTN) == 8 && Image->Machine == EFI_IMAGE_MACHINE_IA32) {\r
- return EFI_UNSUPPORTED;\r
- } else {\r
- //\r
- // For orther possible cases\r
- //\r
- }\r
\r
//\r
// Push the current start image context, and\r
// link the current image to the head. This is the\r
// only image that can call Exit()\r
//\r
- HandleDatabaseKey = CoreGetHandleDatabaseKey();\r
+ HandleDatabaseKey = CoreGetHandleDatabaseKey ();\r
LastImage = mCurrentImage;\r
mCurrentImage = Image;\r
Image->Tpl = gEfiCurrentTpl;\r
// This make the user aware and check if the driver image have already released\r
// all the resource in this situation.\r
//\r
- DEBUG_CODE (\r
+ DEBUG_CODE_BEGIN ();\r
if (EFI_ERROR (Image->Status)) {\r
DEBUG ((EFI_D_ERROR, "Error: Image at %08X start failed: %x\n", Image->Info.ImageBase, Image->Status));\r
}\r
- );\r
+ DEBUG_CODE_END ();\r
\r
//\r
// If the image returns, exit it through Exit()\r
//\r
// Handle the image's returned ExitData\r
//\r
- DEBUG_CODE (\r
+ DEBUG_CODE_BEGIN ();\r
if (Image->ExitDataSize != 0 || Image->ExitData != NULL) {\r
\r
DEBUG (\r
}\r
DEBUG ((EFI_D_LOAD, "\n"));\r
}\r
- );\r
+ DEBUG_CODE_END ();\r
\r
//\r
// Return the exit data to the caller\r