summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Bds/BootOptionSupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg/Bds/BootOptionSupport.c')
-rw-r--r--ArmPlatformPkg/Bds/BootOptionSupport.c111
1 files changed, 0 insertions, 111 deletions
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
@@ -214,117 +214,6 @@ BootDeviceGetDeviceSupport (
}
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
)