summaryrefslogtreecommitdiffstats
path: root/sys/compat/freebsd32/freebsd32_misc.c
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2012-03-03 21:39:12 +0000
committerjmallett <jmallett@FreeBSD.org>2012-03-03 21:39:12 +0000
commit6485e73b874436e497d338e5ac1604e2e491a467 (patch)
treec8e87928b14131043ec6928f3347f4e43b326ff3 /sys/compat/freebsd32/freebsd32_misc.c
parent35f5c46c91cca7eca1523a35b1a1f4e514545ee1 (diff)
downloadFreeBSD-src-6485e73b874436e497d338e5ac1604e2e491a467.zip
FreeBSD-src-6485e73b874436e497d338e5ac1604e2e491a467.tar.gz
On MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries. This might
not be ideal, but is the ABI we've shipped so far. Fix macros which reflect the results of _ALIGN on 32-bit MIPS to use the right alignment. This fixes sendmsg under COMPAT_FREEBSD32 on n64 MIPS kernels.
Diffstat (limited to 'sys/compat/freebsd32/freebsd32_misc.c')
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 3938e99..81568ae 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -952,7 +952,11 @@ freebsd32_copyoutmsghdr(struct msghdr *msg, struct msghdr32 *msg32)
return (error);
}
+#ifndef __mips__
#define FREEBSD32_ALIGNBYTES (sizeof(int) - 1)
+#else
+#define FREEBSD32_ALIGNBYTES (sizeof(long) - 1)
+#endif
#define FREEBSD32_ALIGN(p) \
(((u_long)(p) + FREEBSD32_ALIGNBYTES) & ~FREEBSD32_ALIGNBYTES)
#define FREEBSD32_CMSG_SPACE(l) \
OpenPOWER on IntegriCloud