diff options
author | 2000-01-06 07:04:54 +0000 | |
---|---|---|
committer | 2000-01-06 07:04:54 +0000 | |
commit | 2d73dd4db590af01b49cf18ca7e3f80de012a73e (patch) | |
tree | 80e5efa7039a1ca46bfc0b0fa72b8bbd2a5c71ee | |
parent | thread context setjmp code, art@ (diff) | |
download | wireguard-openbsd-2d73dd4db590af01b49cf18ca7e3f80de012a73e.tar.xz wireguard-openbsd-2d73dd4db590af01b49cf18ca7e3f80de012a73e.zip |
use art's thread context setjmp code
-rw-r--r-- | lib/libc_r/arch/sparc/uthread_machdep.h | 24 | ||||
-rw-r--r-- | lib/libpthread/arch/sparc/uthread_machdep.h | 24 |
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; |