powerpc: Add static asssert for context size

Add a static assert for the siginfo_t, mcontext_t and ucontext_t
sizes. These are de-facto ABI options and cannot change size ever. For
powerpc64, also add asserts for {u,m}mcontext32_t and siginfo32.

Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D34213
This commit is contained in:
Warner Losh 2022-02-10 14:27:08 -07:00
parent 690601f0b4
commit 6e48e160ae

View File

@ -130,6 +130,21 @@ static void cleanup_power_extras(struct thread *);
extern struct sysentvec elf64_freebsd_sysvec_v2;
#endif
#ifdef __powerpc64__
_Static_assert(sizeof(mcontext_t) == 1392, "mcontext_t size incorrect");
_Static_assert(sizeof(ucontext_t) == 1472, "ucontext_t size incorrect");
_Static_assert(sizeof(siginfo_t) == 80, "siginfo_t size incorrect");
#ifdef COMPAT_FREEBSD32
_Static_assert(sizeof(mcontext32_t) == 1224, "mcontext32_t size incorrect");
_Static_assert(sizeof(ucontext32_t) == 1280, "ucontext32_t size incorrect");
_Static_assert(sizeof(struct siginfo32) == 64, "struct siginfo32 size incorrect");
#endif /* COMPAT_FREEBSD32 */
#else /* powerpc */
_Static_assert(sizeof(mcontext_t) == 1224, "mcontext_t size incorrect");
_Static_assert(sizeof(ucontext_t) == 1280, "ucontext_t size incorrect");
_Static_assert(sizeof(siginfo_t) == 64, "siginfo_t size incorrect");
#endif
void
sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
{