diff options
Diffstat (limited to 'stand/i386/libi386/bootinfo32.c')
-rw-r--r-- | stand/i386/libi386/bootinfo32.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c index dd919d0fad93..207fe9a3fde8 100644 --- a/stand/i386/libi386/bootinfo32.c +++ b/stand/i386/libi386/bootinfo32.c @@ -59,6 +59,7 @@ static struct bootinfo bi; * MOD_SIZE sizeof(size_t) module size * MOD_METADATA (variable) type-specific metadata */ +#define MOD_ALIGN(l) roundup(l, sizeof(u_long)) #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ @@ -71,7 +72,7 @@ static struct bootinfo bi; COPY32(strlen(s) + 1, a, c); \ if (c) \ archsw.arch_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_long));\ + a += MOD_ALIGN(strlen(s) + 1); \ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -83,7 +84,7 @@ static struct bootinfo bi; COPY32(sizeof(s), a, c); \ if (c) \ archsw.arch_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_long)); \ + a += MOD_ALIGN(sizeof(s)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -94,7 +95,7 @@ static struct bootinfo bi; COPY32(mm->md_size, a, c); \ if (c) \ archsw.arch_copyin(mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_long));\ + a += MOD_ALIGN(mm->md_size); \ } #define MOD_END(a, c) { \ |