summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>2000-01-06 07:04:55 +0000
committerDavid Leonard <d@cvs.openbsd.org>2000-01-06 07:04:55 +0000
commit9cefcf1e1e59cdeb6e8701aefa83f650fb2c7452 (patch)
tree1fd77a68f58b3776cb2f8bcbea526fbf66ec9833
parent51b6d2b79c35846bc706cb7acc002ee6f6ba29ab (diff)
use art's thread context setjmp code
-rw-r--r--lib/libc_r/arch/sparc/uthread_machdep.h24
-rw-r--r--lib/libpthread/arch/sparc/uthread_machdep.h24
2 files changed, 22 insertions, 26 deletions
diff --git a/lib/libc_r/arch/sparc/uthread_machdep.h b/lib/libc_r/arch/sparc/uthread_machdep.h
index 46ffd6dc92c..53ad543f77a 100644
--- a/lib/libc_r/arch/sparc/uthread_machdep.h
+++ b/lib/libc_r/arch/sparc/uthread_machdep.h
@@ -1,7 +1,7 @@
/*
* OpenBSD/sparc machine-dependent thread macros
*
- * $OpenBSD: uthread_machdep.h,v 1.3 1999/11/25 07:01:29 d Exp $
+ * $OpenBSD: uthread_machdep.h,v 1.4 2000/01/06 07:04:54 d Exp $
*/
#include <sys/signal.h>
@@ -18,22 +18,20 @@
/* XXX tdb */ \
}
-/* initialise the jmpbuf stack frame so it continues from entry */
+typedef long _machdep_jmp_buf[2];
+
+int _thread_machdep_setjmp __P((_machdep_jmp_buf));
+void _thread_machdep_longjmp __P((_machdep_jmp_buf, int));
+/* initialise the jmpbuf stack frame so it continues from entry */
#define _thread_machdep_thread_create(thr, entry, pattr) \
- { \
- /* entry */ \
- (thr)->saved_jmp_buf[1] = (long) entry; \
- /* stack */ \
- (thr)->saved_jmp_buf[0] = (long) (thr)->stack->base \
- + (thr)->stack->size \
- - sizeof(double); \
+ { \
+ long stack = (long)(thr)->stack->base + \
+ (thr)->stack->size - 64; \
+ (thr)->saved_jmp_buf[0] = (long)stack; \
+ (thr)->saved_jmp_buf[1] = (long)entry - 8; \
}
-#define _thread_machdep_longjmp(a,v) _longjmp(a,v)
-#define _thread_machdep_setjmp(a) _setjmp(a)
-typedef jmp_buf _machdep_jmp_buf;
-
struct _machdep_struct {
/* char saved_fp[???]; */
int dummy;
diff --git a/lib/libpthread/arch/sparc/uthread_machdep.h b/lib/libpthread/arch/sparc/uthread_machdep.h
index 46ffd6dc92c..53ad543f77a 100644
--- a/lib/libpthread/arch/sparc/uthread_machdep.h
+++ b/lib/libpthread/arch/sparc/uthread_machdep.h
@@ -1,7 +1,7 @@
/*
* OpenBSD/sparc machine-dependent thread macros
*
- * $OpenBSD: uthread_machdep.h,v 1.3 1999/11/25 07:01:29 d Exp $
+ * $OpenBSD: uthread_machdep.h,v 1.4 2000/01/06 07:04:54 d Exp $
*/
#include <sys/signal.h>
@@ -18,22 +18,20 @@
/* XXX tdb */ \
}
-/* initialise the jmpbuf stack frame so it continues from entry */
+typedef long _machdep_jmp_buf[2];
+
+int _thread_machdep_setjmp __P((_machdep_jmp_buf));
+void _thread_machdep_longjmp __P((_machdep_jmp_buf, int));
+/* initialise the jmpbuf stack frame so it continues from entry */
#define _thread_machdep_thread_create(thr, entry, pattr) \
- { \
- /* entry */ \
- (thr)->saved_jmp_buf[1] = (long) entry; \
- /* stack */ \
- (thr)->saved_jmp_buf[0] = (long) (thr)->stack->base \
- + (thr)->stack->size \
- - sizeof(double); \
+ { \
+ long stack = (long)(thr)->stack->base + \
+ (thr)->stack->size - 64; \
+ (thr)->saved_jmp_buf[0] = (long)stack; \
+ (thr)->saved_jmp_buf[1] = (long)entry - 8; \
}
-#define _thread_machdep_longjmp(a,v) _longjmp(a,v)
-#define _thread_machdep_setjmp(a) _setjmp(a)
-typedef jmp_buf _machdep_jmp_buf;
-
struct _machdep_struct {
/* char saved_fp[???]; */
int dummy;