aboutsummaryrefslogtreecommitdiff
path: root/include/efi_default_filename.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/efi_default_filename.h')
-rw-r--r--include/efi_default_filename.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/efi_default_filename.h b/include/efi_default_filename.h
new file mode 100644
index 0000000000..13b9de8754
--- /dev/null
+++ b/include/efi_default_filename.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * When a boot option does not provide a file path the EFI file to be
+ * booted is \EFI\BOOT\$(BOOTEFI_NAME).EFI. The architecture specific
+ * file name is defined in this include.
+ *
+ * Copyright (c) 2022, Heinrich Schuchardt <xypron.glpk@gmx.de>
+ */
+
+#ifndef _EFI_DEFAULT_FILENAME_H
+#define _EFI_DEFAULT_FILENAME_H
+
+#include <host_arch.h>
+
+#undef BOOTEFI_NAME
+
+#if HOST_ARCH == HOST_ARCH_X86_64
+#define BOOTEFI_NAME "BOOTX64.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_X86
+#define BOOTEFI_NAME "BOOTIA32.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_AARCH64
+#define BOOTEFI_NAME "BOOTAA64.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_ARM
+#define BOOTEFI_NAME "BOOTARM.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV32
+#define BOOTEFI_NAME "BOOTRISCV32.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV64
+#define BOOTEFI_NAME "BOOTRISCV64.EFI"
+#endif
+
+#ifndef BOOTEFI_NAME
+#error Unsupported UEFI architecture
+#endif
+
+#endif