grub2/0139-include-grub-kernel.h-FOR_MODULES-Adjust-to-preserve.patch
2013-06-07 14:03:56 -04:00

40 lines
1.4 KiB
Diff

From a074aa6ad158c90a065d5b9f7727a07254f0e6b2 Mon Sep 17 00:00:00 2001
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Date: Mon, 21 Jan 2013 22:44:20 +0100
Subject: [PATCH 139/471] * include/grub/kernel.h (FOR_MODULES): Adjust
to preserve alignment invariants.
---
ChangeLog | 5 +++++
include/grub/kernel.h | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index a2edbc5..c3405df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-21 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * include/grub/kernel.h (FOR_MODULES): Adjust to preserve alignment
+ invariants.
+
2013-01-21 Colin Watson <cjwatson@ubuntu.com>
* grub-core/font/font.c (blit_comb: do_blit): Make static instead of
diff --git a/include/grub/kernel.h b/include/grub/kernel.h
index 033479e..23e4f02 100644
--- a/include/grub/kernel.h
+++ b/include/grub/kernel.h
@@ -78,7 +78,7 @@ extern grub_addr_t EXPORT_VAR (grub_modbase);
var && (grub_addr_t) var \
< (grub_modbase + (((struct grub_module_info *) grub_modbase)->size)); \
var = (struct grub_module_header *) \
- ((void **) var + (((struct grub_module_header *) var)->size + sizeof (void *) - 1) / sizeof (void *)))
+ (((grub_uint32_t *) var) + ((((struct grub_module_header *) var)->size + sizeof (grub_addr_t) - 1) / sizeof (grub_addr_t)) * (sizeof (grub_addr_t) / sizeof (grub_uint32_t))))
grub_addr_t grub_modules_get_end (void);
--
1.8.2.1