Enhance PeiCore and DxeCore check whether the image machine type is supported when start image.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9266 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-09-16 02:37:23 +00:00
parent 3f42faa73d
commit 919df8e6d2
2 changed files with 15 additions and 0 deletions

View File

@ -1120,6 +1120,14 @@ CoreStartImage (
return EFI_INVALID_PARAMETER;
}
if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Image->Machine)) {
//
// The image to be started must have the machine type supported by DxeCore.
//
ASSERT (FALSE);
return EFI_UNSUPPORTED;
}
//
// Don't profile Objects or invalid start requests
//

View File

@ -434,6 +434,13 @@ PeiLoadImage (
AuthenticationState
);
if (!EFI_ERROR (Status)) {
if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCoffLoaderGetMachineType ((VOID *) (UINTN) ImageAddress))) {
//
// The image to be started must have the machine type supported by PeiCore.
//
ASSERT (FALSE);
return EFI_UNSUPPORTED;
}
return Status;
}
}