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
ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated\r
Unicode string, optionally followed by additional binary data. The string\r
is a description that the caller may use to further indicate the reason for\r
- the image¡¯s exit.\r
+ the image's exit.\r
\r
Returns:\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
\r
ImageHandle - Handle that identifies the image. This parameter is passed to the image\r
on entry.\r
- Status - The image¡¯s exit code.\r
+ Status - The image's exit code.\r
ExitDataSize - The size, in bytes, of ExitData. Ignored if ExitStatus is\r
EFI_SUCCESS.\r
ExitData - Pointer to a data buffer that includes a Null-terminated Unicode string,\r
optionally followed by additional binary data. The string is a\r
description that the caller may use to further indicate the reason for\r
- the image¡¯s exit.\r
+ the image's exit.\r
\r
Returns:\r
\r