summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-02 13:01:23 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-10 14:59:48 +0200
commit91b08bb00fb9b7e1de223709f4564b8fcedc711b (patch)
treed7436c669e442b7a14bd965eb38e0a677781140e /src/boot
parente04df06f5876ec4f3b068bccc5fa4a53ab6bf9b2 (diff)
downloadsystemd-91b08bb00fb9b7e1de223709f4564b8fcedc711b.tar.gz
boot,shared: share the definitions of EFI_LOADER_FEATURE macros
This means the the code needs to be kept compatible in the shared header, but I think that still nicer than having two places to declare the same things. I added src/boot to -I, so that efi/foo.h needs to be used. This reduces the potential for accidentally including the wrong header.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/efi/boot.c11
-rw-r--r--src/boot/efi/loader-features.h13
2 files changed, 19 insertions, 5 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 57c423bfb6..f542f45ca0 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -9,6 +9,7 @@
#include "disk.h"
#include "graphics.h"
#include "linux.h"
+#include "loader-features.h"
#include "measure.h"
#include "pe.h"
#include "shim.h"
@@ -2277,11 +2278,11 @@ static VOID config_write_entries_to_variable(Config *config) {
EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
static const UINT64 loader_features =
- (1ULL << 0) | /* I honour the LoaderConfigTimeout variable */
- (1ULL << 1) | /* I honour the LoaderConfigTimeoutOneShot variable */
- (1ULL << 2) | /* I honour the LoaderEntryDefault variable */
- (1ULL << 3) | /* I honour the LoaderEntryOneShot variable */
- (1ULL << 4) | /* I support boot counting */
+ EFI_LOADER_FEATURE_CONFIG_TIMEOUT |
+ EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT |
+ EFI_LOADER_FEATURE_ENTRY_DEFAULT |
+ EFI_LOADER_FEATURE_ENTRY_ONESHOT |
+ EFI_LOADER_FEATURE_BOOT_COUNTING |
0;
_cleanup_freepool_ CHAR16 *infostr = NULL, *typestr = NULL;
diff --git a/src/boot/efi/loader-features.h b/src/boot/efi/loader-features.h
new file mode 100644
index 0000000000..40095e28ec
--- /dev/null
+++ b/src/boot/efi/loader-features.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#ifndef UINT64_C
+# define UINT64_C(c) (c ## ULL)
+#endif
+
+#define EFI_LOADER_FEATURE_CONFIG_TIMEOUT (UINT64_C(1) << 0)
+#define EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT (UINT64_C(1) << 1)
+#define EFI_LOADER_FEATURE_ENTRY_DEFAULT (UINT64_C(1) << 2)
+#define EFI_LOADER_FEATURE_ENTRY_ONESHOT (UINT64_C(1) << 3)
+#define EFI_LOADER_FEATURE_BOOT_COUNTING (UINT64_C(1) << 4)
+#define EFI_LOADER_FEATURE_XBOOTLDR (UINT64_C(1) << 5)