From 8b129b7b390107d258bd004eda8514976534408a Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Tue, 14 Jul 2015 14:36:49 +0000 Subject: ArmPlatformPkg/Bds: Remove Linux specific boot path Since the embedded Linux Loader has been removed from BdsLib there is no more Linux specific boot option. All the boot options are now expected to be arguments for EFI applications. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin Reviewed-by: Ronald Cron git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17970 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BootOptionSupport.c | 111 --------------------------------- 1 file changed, 111 deletions(-) (limited to 'ArmPlatformPkg/Bds/BootOptionSupport.c') diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c b/ArmPlatformPkg/Bds/BootOptionSupport.c index 974f220553..f50f13f71d 100644 --- a/ArmPlatformPkg/Bds/BootOptionSupport.c +++ b/ArmPlatformPkg/Bds/BootOptionSupport.c @@ -213,117 +213,6 @@ BootDeviceGetDeviceSupport ( return EFI_UNSUPPORTED; } -EFI_STATUS -BootDeviceGetType ( - IN EFI_DEVICE_PATH* DevicePath, - OUT ARM_BDS_LOADER_TYPE *BootType, - OUT UINT32 *Attributes - ) -{ - EFI_STATUS Status; - BOOLEAN IsEfiApp; - BOOLEAN IsBootLoader; - BOOLEAN HasFDTSupport; - CHAR16* FileName; - EFI_DEVICE_PATH* PrevDevicePathNode; - EFI_DEVICE_PATH* DevicePathNode; - EFI_PHYSICAL_ADDRESS Image; - UINTN FileSize; - EFI_IMAGE_DOS_HEADER* DosHeader; - UINTN PeCoffHeaderOffset; - EFI_IMAGE_NT_HEADERS32* NtHeader; - - // - // Check if the last node of the device path is a FilePath node - // - PrevDevicePathNode = NULL; - DevicePathNode = DevicePath; - while ((DevicePathNode != NULL) && !IsDevicePathEnd (DevicePathNode)) { - PrevDevicePathNode = DevicePathNode; - DevicePathNode = NextDevicePathNode (DevicePathNode); - } - - if ((PrevDevicePathNode != NULL) && - (PrevDevicePathNode->Type == MEDIA_DEVICE_PATH) && - (PrevDevicePathNode->SubType == MEDIA_FILEPATH_DP)) - { - FileName = ((FILEPATH_DEVICE_PATH*)PrevDevicePathNode)->PathName; - } else { - FileName = NULL; - } - - if (FileName == NULL) { - Print(L"Is an EFI Application? "); - Status = GetHIInputBoolean (&IsEfiApp); - if (EFI_ERROR(Status)) { - return EFI_ABORTED; - } - } else if (HasFilePathEfiExtension(FileName)) { - IsEfiApp = TRUE; - } else { - // Check if the file exist - Status = BdsLoadImage (DevicePath, AllocateAnyPages, &Image, &FileSize); - if (!EFI_ERROR (Status)) { - - DosHeader = (EFI_IMAGE_DOS_HEADER *)(UINTN) Image; - if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) { - // - // DOS image header is present, - // so read the PE header after the DOS image header. - // - PeCoffHeaderOffset = DosHeader->e_lfanew; - } else { - PeCoffHeaderOffset = 0; - } - - // - // Check PE/COFF image. - // - NtHeader = (EFI_IMAGE_NT_HEADERS32 *)(UINTN) (Image + PeCoffHeaderOffset); - if (NtHeader->Signature != EFI_IMAGE_NT_SIGNATURE) { - IsEfiApp = FALSE; - } else { - IsEfiApp = TRUE; - } - - // Free memory - gBS->FreePages (Image, EFI_SIZE_TO_PAGES(FileSize)); - } else { - // If we did not manage to open it then ask for the type - Print(L"Is an EFI Application? "); - Status = GetHIInputBoolean (&IsEfiApp); - if (EFI_ERROR(Status)) { - return EFI_ABORTED; - } - } - } - - if (IsEfiApp) { - Print(L"Is your application an OS loader? "); - Status = GetHIInputBoolean (&IsBootLoader); - if (EFI_ERROR(Status)) { - return EFI_ABORTED; - } - if (!IsBootLoader) { - *Attributes |= LOAD_OPTION_CATEGORY_APP; - } - *BootType = BDS_LOADER_EFI_APPLICATION; - } else { - Print(L"Has FDT support? "); - Status = GetHIInputBoolean (&HasFDTSupport); - if (EFI_ERROR(Status)) { - return EFI_ABORTED; - } - if (HasFDTSupport) { - *BootType = BDS_LOADER_KERNEL_LINUX_FDT; - } else { - *BootType = BDS_LOADER_KERNEL_LINUX_ATAG; - } - } - - return EFI_SUCCESS; -} - EFI_STATUS BdsLoadOptionFileSystemList ( IN OUT LIST_ENTRY* BdsLoadOptionList -- cgit v1.2.3