[PATCH v1 1/6] lib/efi: Add EFI_DEFALT_ATTRIBUTES macro
Geoff Levand
geoff at infradead.org
Sat Aug 11 03:29:14 AEST 2018
For convenience, add a new efi data attributes macro
EFI_DEFALT_ATTRIBUTES.
Signed-off-by: Geoff Levand <geoff at infradead.org>
---
discover/platform-arm64.c | 5 +----
lib/efi/efivar.h | 6 ++++++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/discover/platform-arm64.c b/discover/platform-arm64.c
index a70298a..0eb2579 100644
--- a/discover/platform-arm64.c
+++ b/discover/platform-arm64.c
@@ -70,10 +70,7 @@ static void write_nvram(const struct param_list *pl)
struct efi_data efi_data;
struct param *param;
- efi_data.attributes =
- EFI_VARIABLE_NON_VOLATILE |
- EFI_VARIABLE_RUNTIME_ACCESS |
- EFI_VARIABLE_BOOTSERVICE_ACCESS;
+ efi_data.attributes = EFI_DEFALT_ATTRIBUTES;
param_list_for_each(pl, param) {
if (!param->modified)
diff --git a/lib/efi/efivar.h b/lib/efi/efivar.h
index 0d44100..48edd17 100644
--- a/lib/efi/efivar.h
+++ b/lib/efi/efivar.h
@@ -30,6 +30,12 @@
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
#define EFI_VARIABLE_APPEND_WRITE 0x00000040
+#define EFI_DEFALT_ATTRIBUTES ( \
+ EFI_VARIABLE_NON_VOLATILE | \
+ EFI_VARIABLE_RUNTIME_ACCESS | \
+ EFI_VARIABLE_BOOTSERVICE_ACCESS \
+)
+
#ifndef EFIVARFS_MAGIC
#define EFIVARFS_MAGIC 0xde5e81e4
#endif
--
2.14.1
More information about the Petitboot
mailing list