Skip to content

Commit cfb2d93

Browse files
committed
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
1 parent 9fb8c88 commit cfb2d93

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sys/compat/freebsd32/freebsd32.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,14 @@ struct kevent32 {
141141
short filter; /* filter for event */
142142
u_short flags;
143143
u_int fflags;
144+
#ifdef __powerpc__
145+
uint32_t pad0;
146+
#endif
144147
int32_t data1, data2;
145148
uint32_t udata; /* opaque user data identifier */
149+
#ifdef __powerpc__
150+
uint32_t pad1;
151+
#endif
146152
uint32_t ext64[8];
147153
};
148154

sys/compat/freebsd32/freebsd32_misc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ CTASSERT(sizeof(struct statfs32) == 256);
119119
CTASSERT(sizeof(struct rusage32) == 72);
120120
#endif
121121
CTASSERT(sizeof(struct sigaltstack32) == 12);
122+
#ifdef __powerpc__
123+
CTASSERT(sizeof(struct kevent32) == 64);
124+
#else
122125
CTASSERT(sizeof(struct kevent32) == 56);
126+
#endif
123127
CTASSERT(sizeof(struct iovec32) == 8);
124128
CTASSERT(sizeof(struct msghdr32) == 28);
125129
#ifdef __amd64__

0 commit comments

Comments
 (0)