diff --git a/sys/boot/i386/libi386/bootinfo.c b/sys/boot/i386/libi386/bootinfo.c index bc6df27e871..92347e58cb5 100644 --- a/sys/boot/i386/libi386/bootinfo.c +++ b/sys/boot/i386/libi386/bootinfo.c @@ -23,12 +23,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bootinfo.c,v 1.10 1998/10/07 10:55:46 peter Exp $ + * $Id: bootinfo.c,v 1.11 1998/10/09 07:11:19 msmith Exp $ */ #include #include #include +#include #include #include "bootstrap.h" #include "libi386.h" @@ -165,7 +166,7 @@ bi_copyenv(vm_offset_t addr) COPY32(t, a); \ COPY32(strlen(s) + 1, a); \ i386_copyin(s, a, strlen(s) + 1); \ - a += strlen(s) + 1; \ + a += roundup(strlen(s) + 1, sizeof(u_int32_t));\ } #define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s) @@ -175,7 +176,7 @@ bi_copyenv(vm_offset_t addr) COPY32(t, a); \ COPY32(sizeof(s), a); \ i386_copyin(&s, a, sizeof(s)); \ - a += sizeof(s); \ + a += roundup(sizeof(s), sizeof(u_int32_t)); \ } #define MOD_ADDR(a, s) MOD_VAR(MODINFO_ADDR, a, s) @@ -185,7 +186,7 @@ bi_copyenv(vm_offset_t addr) COPY32(MODINFO_METADATA | mm->md_type, a); \ COPY32(mm->md_size, a); \ i386_copyin(mm->md_data, a, mm->md_size); \ - a += mm->md_size; \ + a += roundup(mm->md_size, sizeof(u_int32_t));\ } #define MOD_END(a) { \ @@ -201,7 +202,7 @@ bi_copymodules(vm_offset_t addr) /* start with the first module on the list, should be the kernel */ for (mp = mod_findmodule(NULL, NULL); mp != NULL; mp = mp->m_next) { - + MOD_NAME(addr, mp->m_name); /* this field must come first */ MOD_TYPE(addr, mp->m_type); MOD_ADDR(addr, mp->m_addr); diff --git a/sys/boot/i386/libi386/bootinfo32.c b/sys/boot/i386/libi386/bootinfo32.c index bc6df27e871..92347e58cb5 100644 --- a/sys/boot/i386/libi386/bootinfo32.c +++ b/sys/boot/i386/libi386/bootinfo32.c @@ -23,12 +23,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bootinfo.c,v 1.10 1998/10/07 10:55:46 peter Exp $ + * $Id: bootinfo.c,v 1.11 1998/10/09 07:11:19 msmith Exp $ */ #include #include #include +#include #include #include "bootstrap.h" #include "libi386.h" @@ -165,7 +166,7 @@ bi_copyenv(vm_offset_t addr) COPY32(t, a); \ COPY32(strlen(s) + 1, a); \ i386_copyin(s, a, strlen(s) + 1); \ - a += strlen(s) + 1; \ + a += roundup(strlen(s) + 1, sizeof(u_int32_t));\ } #define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s) @@ -175,7 +176,7 @@ bi_copyenv(vm_offset_t addr) COPY32(t, a); \ COPY32(sizeof(s), a); \ i386_copyin(&s, a, sizeof(s)); \ - a += sizeof(s); \ + a += roundup(sizeof(s), sizeof(u_int32_t)); \ } #define MOD_ADDR(a, s) MOD_VAR(MODINFO_ADDR, a, s) @@ -185,7 +186,7 @@ bi_copyenv(vm_offset_t addr) COPY32(MODINFO_METADATA | mm->md_type, a); \ COPY32(mm->md_size, a); \ i386_copyin(mm->md_data, a, mm->md_size); \ - a += mm->md_size; \ + a += roundup(mm->md_size, sizeof(u_int32_t));\ } #define MOD_END(a) { \ @@ -201,7 +202,7 @@ bi_copymodules(vm_offset_t addr) /* start with the first module on the list, should be the kernel */ for (mp = mod_findmodule(NULL, NULL); mp != NULL; mp = mp->m_next) { - + MOD_NAME(addr, mp->m_name); /* this field must come first */ MOD_TYPE(addr, mp->m_type); MOD_ADDR(addr, mp->m_addr); diff --git a/sys/boot/i386/libi386/bootinfo64.c b/sys/boot/i386/libi386/bootinfo64.c index bc6df27e871..92347e58cb5 100644 --- a/sys/boot/i386/libi386/bootinfo64.c +++ b/sys/boot/i386/libi386/bootinfo64.c @@ -23,12 +23,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bootinfo.c,v 1.10 1998/10/07 10:55:46 peter Exp $ + * $Id: bootinfo.c,v 1.11 1998/10/09 07:11:19 msmith Exp $ */ #include #include #include +#include #include #include "bootstrap.h" #include "libi386.h" @@ -165,7 +166,7 @@ bi_copyenv(vm_offset_t addr) COPY32(t, a); \ COPY32(strlen(s) + 1, a); \ i386_copyin(s, a, strlen(s) + 1); \ - a += strlen(s) + 1; \ + a += roundup(strlen(s) + 1, sizeof(u_int32_t));\ } #define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s) @@ -175,7 +176,7 @@ bi_copyenv(vm_offset_t addr) COPY32(t, a); \ COPY32(sizeof(s), a); \ i386_copyin(&s, a, sizeof(s)); \ - a += sizeof(s); \ + a += roundup(sizeof(s), sizeof(u_int32_t)); \ } #define MOD_ADDR(a, s) MOD_VAR(MODINFO_ADDR, a, s) @@ -185,7 +186,7 @@ bi_copyenv(vm_offset_t addr) COPY32(MODINFO_METADATA | mm->md_type, a); \ COPY32(mm->md_size, a); \ i386_copyin(mm->md_data, a, mm->md_size); \ - a += mm->md_size; \ + a += roundup(mm->md_size, sizeof(u_int32_t));\ } #define MOD_END(a) { \ @@ -201,7 +202,7 @@ bi_copymodules(vm_offset_t addr) /* start with the first module on the list, should be the kernel */ for (mp = mod_findmodule(NULL, NULL); mp != NULL; mp = mp->m_next) { - + MOD_NAME(addr, mp->m_name); /* this field must come first */ MOD_TYPE(addr, mp->m_type); MOD_ADDR(addr, mp->m_addr);