git: d4f495fbf88f - main - i386: Add static asssert for context size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Feb 2022 21:33:59 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=d4f495fbf88fbc0391b221ce2315a820ad31236d
commit d4f495fbf88fbc0391b221ce2315a820ad31236d
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-02-10 21:26:53 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-02-10 21:32:20 +0000
i386: 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.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D34211
---
sys/i386/i386/exec_machdep.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sys/i386/i386/exec_machdep.c b/sys/i386/i386/exec_machdep.c
index 01602e43733f..0463615d96d9 100644
--- a/sys/i386/i386/exec_machdep.c
+++ b/sys/i386/i386/exec_machdep.c
@@ -115,6 +115,10 @@ static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask);
extern struct sysentvec elf32_freebsd_sysvec;
+_Static_assert(sizeof(mcontext_t) == 640, "mcontext_t size incorrect");
+_Static_assert(sizeof(ucontext_t) == 704, "ucontext_t size incorrect");
+_Static_assert(sizeof(siginfo_t) == 64, "siginfo_t size incorrect");
+
/*
* Send an interrupt to process.
*