AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * When a boot option does not provide a file path the EFI file to be |
| 4 | * booted is \EFI\BOOT\$(BOOTEFI_NAME).EFI. The architecture specific |
| 5 | * file name is defined in this include. |
| 6 | * |
| 7 | * Copyright (c) 2022, Heinrich Schuchardt <xypron.glpk@gmx.de> |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 8 | * Copyright (c) 2022, Linaro Limited |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef _EFI_DEFAULT_FILENAME_H |
| 12 | #define _EFI_DEFAULT_FILENAME_H |
| 13 | |
| 14 | #include <host_arch.h> |
| 15 | |
| 16 | #undef BOOTEFI_NAME |
| 17 | |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 18 | #ifdef CONFIG_SANDBOX |
| 19 | |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 20 | #if HOST_ARCH == HOST_ARCH_X86_64 |
| 21 | #define BOOTEFI_NAME "BOOTX64.EFI" |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 22 | #elif HOST_ARCH == HOST_ARCH_X86 |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 23 | #define BOOTEFI_NAME "BOOTIA32.EFI" |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 24 | #elif HOST_ARCH == HOST_ARCH_AARCH64 |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 25 | #define BOOTEFI_NAME "BOOTAA64.EFI" |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 26 | #elif HOST_ARCH == HOST_ARCH_ARM |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 27 | #define BOOTEFI_NAME "BOOTARM.EFI" |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 28 | #elif HOST_ARCH == HOST_ARCH_RISCV32 |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 29 | #define BOOTEFI_NAME "BOOTRISCV32.EFI" |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 30 | #elif HOST_ARCH == HOST_ARCH_RISCV64 |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 31 | #define BOOTEFI_NAME "BOOTRISCV64.EFI" |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 32 | #else |
| 33 | #error Unsupported UEFI architecture |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 34 | #endif |
| 35 | |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 36 | #else |
| 37 | |
| 38 | #if defined(CONFIG_ARM64) |
| 39 | #define BOOTEFI_NAME "BOOTAA64.EFI" |
| 40 | #elif defined(CONFIG_ARM) |
| 41 | #define BOOTEFI_NAME "BOOTARM.EFI" |
| 42 | #elif defined(CONFIG_X86_64) |
| 43 | #define BOOTEFI_NAME "BOOTX64.EFI" |
| 44 | #elif defined(CONFIG_X86) |
| 45 | #define BOOTEFI_NAME "BOOTIA32.EFI" |
| 46 | #elif defined(CONFIG_ARCH_RV32I) |
| 47 | #define BOOTEFI_NAME "BOOTRISCV32.EFI" |
| 48 | #elif defined(CONFIG_ARCH_RV64I) |
| 49 | #define BOOTEFI_NAME "BOOTRISCV64.EFI" |
| 50 | #else |
AKASHI Takahiro | 4e65ca0 | 2022-04-28 17:09:39 +0900 | [diff] [blame] | 51 | #error Unsupported UEFI architecture |
| 52 | #endif |
| 53 | |
| 54 | #endif |
Heinrich Schuchardt | 3a0654e | 2022-06-10 18:24:48 +0200 | [diff] [blame] | 55 | |
| 56 | #endif |