* include/grub/kernel.h (FOR_MODULES): Preserve alignment invariants.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-13 16:29:15 +01:00
parent 0c6087a8c9
commit 30dd48c2b0
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2011-12-13 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/kernel.h (FOR_MODULES): Preserve alignment invariants.
2011-12-13 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/loader/multiboot_mbi2.c (grub_multiboot_add_elfsyms):

View file

@ -71,13 +71,15 @@ struct grub_module_info64
extern grub_addr_t EXPORT_VAR (grub_modbase);
#define FOR_MODULES(var) for (\
var = grub_modbase ? (struct grub_module_header *) \
#define FOR_MODULES(var) for (var = grub_modbase ? (struct grub_module_header *) \
(grub_modbase + (((struct grub_module_info *) grub_modbase)->offset)) : 0;\
var && (grub_addr_t) var \
< (grub_modbase + (((struct grub_module_info *) grub_modbase)->size)); \
var = (struct grub_module_header *) \
((char *) var + ((struct grub_module_header *) var)->size))
((grub_uint32_t *) var \
+ ((((struct grub_module_header *) var)->size \
+ sizeof (grub_uint32_t) - 1) \
/ sizeof (grub_uint32_t))))
grub_addr_t grub_modules_get_end (void);