summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/include/setjmp.h4
-rw-r--r--sys/amd64/include/setjmp.h4
-rw-r--r--sys/i386/include/setjmp.h4
-rw-r--r--sys/ia64/include/setjmp.h30
-rw-r--r--sys/powerpc/include/setjmp.h4
-rw-r--r--sys/sparc64/include/setjmp.h4
6 files changed, 40 insertions, 10 deletions
diff --git a/sys/alpha/include/setjmp.h b/sys/alpha/include/setjmp.h
index d808f97..bf1bec6 100644
--- a/sys/alpha/include/setjmp.h
+++ b/sys/alpha/include/setjmp.h
@@ -35,6 +35,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
+#include <sys/cdefs.h>
+
#define _JBLEN 81 /* Size, in longs, of a jmp_buf. */
/*
@@ -42,7 +44,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
-#ifndef _ANSI_SOURCE
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif
diff --git a/sys/amd64/include/setjmp.h b/sys/amd64/include/setjmp.h
index 092545f..e6e0371 100644
--- a/sys/amd64/include/setjmp.h
+++ b/sys/amd64/include/setjmp.h
@@ -35,6 +35,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
+#include <sys/cdefs.h>
+
#define _JBLEN 11 /* Size of the jmp_buf on x86. */
/*
@@ -42,7 +44,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
-#ifndef _ANSI_SOURCE
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif
diff --git a/sys/i386/include/setjmp.h b/sys/i386/include/setjmp.h
index 092545f..e6e0371 100644
--- a/sys/i386/include/setjmp.h
+++ b/sys/i386/include/setjmp.h
@@ -35,6 +35,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
+#include <sys/cdefs.h>
+
#define _JBLEN 11 /* Size of the jmp_buf on x86. */
/*
@@ -42,7 +44,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
-#ifndef _ANSI_SOURCE
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif
diff --git a/sys/ia64/include/setjmp.h b/sys/ia64/include/setjmp.h
index a873208..ac4f35a 100644
--- a/sys/ia64/include/setjmp.h
+++ b/sys/ia64/include/setjmp.h
@@ -42,6 +42,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
+#include <sys/cdefs.h>
+
/*
* IA64 assembler doesn't like C style comments. This also means we can't
* include other include files to get things like the roundup2() macro.
@@ -52,9 +54,14 @@
* of an individual item saved in jmp_buf.
*/
+#if __BSD_VISIBLE
#define our_roundup(x, y) (((x)+((y)-1))&(~((y)-1)))
+#endif
-#define JMPBUF_ALIGNMENT 0x10
+#define _JMPBUF_ALIGNMENT 0x10
+
+#if __BSD_VISIBLE
+#define JMPBUF_ALIGNMENT _JMPBUF_ALIGNMENT
#define JMPBUF_ADDR_OF(buf, item) \
((size_t)((our_roundup((size_t)buf, JMPBUF_ALIGNMENT)) + item))
@@ -100,22 +107,35 @@
#define J_SIG0 0x1d8
#define J_SIG1 0x1e0
#define J_SIGMASK 0x1e8
-#define J_END 0x1f0
+#endif /* __BSD_VISIBLE */
+#define _J_END 0x1f0
+#if __BSD_VISIBLE
+#define J_END _J_END
+#endif
+
+/*
+ * XXX this check is wrong, since LOCORE is in the application namespace and
+ * applications shouldn't be able to affect the implementation. One workaround
+ * would be to only check LOCORE if _KERNEL is defined, but unfortunately
+ * LOCORE is used outside of the kernel. The best solution would be to rename
+ * LOCORE to _LOCORE, so that it can be used in userland to safely affect the
+ * implementation.
+ */
#ifndef LOCORE
/*
* 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
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf {
- char Buffer[J_END + JMPBUF_ALIGNMENT];
+ char _Buffer[_J_END + _JMPBUF_ALIGNMENT];
} sigjmp_buf[1];
#endif
typedef struct _jmp_buf {
- char Buffer[J_END + JMPBUF_ALIGNMENT];
+ char _Buffer[ _J_END + _JMPBUF_ALIGNMENT ];
} jmp_buf[1];
#endif
diff --git a/sys/powerpc/include/setjmp.h b/sys/powerpc/include/setjmp.h
index f6d1378..e453044 100644
--- a/sys/powerpc/include/setjmp.h
+++ b/sys/powerpc/include/setjmp.h
@@ -6,6 +6,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
+#include <sys/cdefs.h>
+
#define _JBLEN 100
/*
@@ -13,7 +15,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
-#ifndef _ANSI_SOURCE
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif
diff --git a/sys/sparc64/include/setjmp.h b/sys/sparc64/include/setjmp.h
index 1668cff..c38bcab 100644
--- a/sys/sparc64/include/setjmp.h
+++ b/sys/sparc64/include/setjmp.h
@@ -36,6 +36,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
+#include <sys/cdefs.h>
+
#define _JBLEN 5
#define _JB_FP 0
@@ -49,7 +51,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
-#ifndef _ANSI_SOURCE
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif
OpenPOWER on IntegriCloud