summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/setjmp.h
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-01-20 09:09:24 +0000
committerjb <jb@FreeBSD.org>1998-01-20 09:09:24 +0000
commit1b94ff548145fb10224df86f77d684ccfa34e93a (patch)
tree5e3941894c2f5141bbbf2f994de05e48fa27c702 /sys/amd64/include/setjmp.h
parent6fa79119c9d6e7a91f513a41060a3f2d04514bd6 (diff)
downloadFreeBSD-src-1b94ff548145fb10224df86f77d684ccfa34e93a.zip
FreeBSD-src-1b94ff548145fb10224df86f77d684ccfa34e93a.tar.gz
Suggested by: bde
Move sigjmp_buf and jmp_buf structure definitions to machine/setjmp.h so that i386 can continue to use int as the basic register type and alpha can use long. Bruce was concerned about possible differing alignment. I've left the definition of _JBLEN in machine/setjmp.h even though Bruce's example used the number directly. I don't know if any other code relies on _JBLEN, so I left it to avoid potential breakage.
Diffstat (limited to 'sys/amd64/include/setjmp.h')
-rw-r--r--sys/amd64/include/setjmp.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/amd64/include/setjmp.h b/sys/amd64/include/setjmp.h
index 2615a09..c0337c0 100644
--- a/sys/amd64/include/setjmp.h
+++ b/sys/amd64/include/setjmp.h
@@ -1,4 +1,4 @@
-/* $Id$ */
+/* $Id: setjmp.h,v 1.1 1998/01/10 23:04:51 jb Exp $ */
/*
* Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -33,3 +33,14 @@
*/
#define _JBLEN 8 /* Size of the jmp_buf on x86. */
+
+/*
+ * jmp_buf and sigjmp_buf are encapsulated in different structs to force
+ * compile-time diagnostics for mismatches. The structs are the same
+ * internally to avoid some run-time errors for mismatches.
+ */
+#ifndef _ANSI_SOURCE
+typedef struct { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
+#endif /* not ANSI */
+
+typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1];
OpenPOWER on IntegriCloud