On 09.09.22 10:31, Tobias Schmidl wrote:
> 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 <[email protected]>
> ---
> include/bootguard.h | 4 ++--
> include/constants.h | 20 ++++++++++++++++++++
> include/envdata.h | 4 ++--
Valid point that the two versions of the same filename are spread out
uncleanly. But what prevents using envdata.h as a home here? I don't get
the conflict yet.
Jan
> 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 <[email protected]>
> + *
> + * 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
--
Siemens AG, Technology
Competence Center Embedded Linux
--
You received this message because you are subscribed to the Google Groups "EFI
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/efibootguard-dev/f5ed8e83-19c5-f979-a088-8e59cb9a796a%40siemens.com.