dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0109-align-struct-efi_variable-better.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Peter Jones <pjones@redhat.com>
d9d99f
Date: Tue, 27 Feb 2018 13:55:35 -0500
d9d99f
Subject: [PATCH] align struct efi_variable better...
d9d99f
d9d99f
---
d9d99f
 include/grub/efiemu/runtime.h | 2 +-
d9d99f
 include/grub/types.h          | 1 +
d9d99f
 2 files changed, 2 insertions(+), 1 deletion(-)
d9d99f
d9d99f
diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
d9d99f
index 36d2dedf47e..9d93ba88bac 100644
d9d99f
--- a/include/grub/efiemu/runtime.h
d9d99f
+++ b/include/grub/efiemu/runtime.h
d9d99f
@@ -33,5 +33,5 @@ struct efi_variable
d9d99f
   grub_uint32_t namelen;
d9d99f
   grub_uint32_t size;
d9d99f
   grub_efi_uint32_t attributes;
d9d99f
-} GRUB_PACKED;
d9d99f
+} GRUB_PACKED GRUB_ALIGNED(8);
d9d99f
 #endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */
d9d99f
diff --git a/include/grub/types.h b/include/grub/types.h
d9d99f
index b93e4820194..f6a9723971d 100644
d9d99f
--- a/include/grub/types.h
d9d99f
+++ b/include/grub/types.h
d9d99f
@@ -29,6 +29,7 @@
d9d99f
 #else
d9d99f
 #define GRUB_PACKED __attribute__ ((packed))
d9d99f
 #endif
d9d99f
+#define GRUB_ALIGNED(x) __attribute__((aligned (x)))
d9d99f
 
d9d99f
 #ifdef GRUB_BUILD
d9d99f
 # define GRUB_CPU_SIZEOF_VOID_P	BUILD_SIZEOF_VOID_P