We have two variables that are really dependent on each other. But,
since both header files compile with different runtimes, we cannot
simply have one include the other. So instead, we move these dependent
variables to a shared third file.
Signed-off-by: Tobias Schmidl <
tobias...@siemens.com>
---
include/bootguard.h | 4 ++--
include/constants.h | 20 ++++++++++++++++++++
include/envdata.h | 4 ++--
3 files changed, 24 insertions(+), 4 deletions(-)
create mode 100644 include/constants.h
diff --git a/include/bootguard.h b/include/bootguard.h
index 8e38d95..c1b4e18 100644
--- a/include/bootguard.h
+++ b/include/bootguard.h
@@ -16,6 +16,8 @@
#include <efi.h>
+#include "constants.h"
+
/* The following definitions regarding status and error constants are
* implemented the same way the corresponding gnu-efi constants are
* defined. This is done for symmetry reasons and for the sake of
@@ -31,8 +33,6 @@ typedef int BG_STATUS;
#define DEFAULT_TIMEOUT_SEC 60
-#define ENV_FILE_NAME L"BGENV.DAT"
-
extern EFI_HANDLE this_image;
typedef struct _BG_LOADER_PARAMS {
diff --git a/include/constants.h b/include/constants.h
new file mode 100644
index 0000000..67605da
--- /dev/null
+++ b/include/constants.h
@@ -0,0 +1,20 @@
+/*
+ * EFI Boot Guard
+ *
+ * Copyright (c) Siemens AG, 2022
+ *
+ * Authors:
+ * Tobias Schmidl <
tobias...@siemens.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#pragma once
+
+#define ENV_FILE_NAME L"BGENV.DAT"
+#define FAT_ENV_FILENAME "BGENV.DAT"
+#define ENV_STRING_LENGTH 255
+
diff --git a/include/envdata.h b/include/envdata.h
index fddfa7f..cd274f4 100644
--- a/include/envdata.h
+++ b/include/envdata.h
@@ -16,8 +16,8 @@
#include <stdint.h>
-#define FAT_ENV_FILENAME "BGENV.DAT"
-#define ENV_STRING_LENGTH 255
+#include "constants.h"
+
#define USTATE_OK 0
#define USTATE_INSTALLED 1
--
2.37.2