From bff8060ac559b7b9f361750f48eae08678dfeaf2 Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 30 Jun 2017 16:12:57 +0000 Subject: [PATCH] Amend the layout of kevent32 on powerpc where uint64_t has 8-byte alignment. Reported,tested and assertion updates by: andreast Sponsored by: The FreeBSD Foundation --- sys/compat/freebsd32/freebsd32.h | 6 ++++++ sys/compat/freebsd32/freebsd32_misc.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index 0babcd94f034..a6944d407e78 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -141,8 +141,14 @@ struct kevent32 { short filter; /* filter for event */ u_short flags; u_int fflags; +#ifdef __powerpc__ + uint32_t pad0; +#endif int32_t data1, data2; uint32_t udata; /* opaque user data identifier */ +#ifdef __powerpc__ + uint32_t pad1; +#endif uint32_t ext64[8]; }; diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index c7f0231f6a96..8a5bf3979e76 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -119,7 +119,11 @@ CTASSERT(sizeof(struct statfs32) == 256); CTASSERT(sizeof(struct rusage32) == 72); #endif CTASSERT(sizeof(struct sigaltstack32) == 12); +#ifdef __powerpc__ +CTASSERT(sizeof(struct kevent32) == 64); +#else CTASSERT(sizeof(struct kevent32) == 56); +#endif CTASSERT(sizeof(struct iovec32) == 8); CTASSERT(sizeof(struct msghdr32) == 28); #ifdef __amd64__