diff options
author | David Leonard <d@cvs.openbsd.org> | 2000-10-04 05:55:36 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 2000-10-04 05:55:36 +0000 |
commit | 8e95e2f842b2fdd99c416cc00a8d321656fea5af (patch) | |
tree | ae270251a663e179dd260f976e6b3ecb477678cf /lib/libc_r/arch/alpha/uthread_machdep.h | |
parent | 367c0082943cc6fa224d021a045222f13f86cfe4 (diff) |
switch to _machdep_switch() instead of setjmp/longjmp. For some reason this fixes sparc threads.
Diffstat (limited to 'lib/libc_r/arch/alpha/uthread_machdep.h')
-rw-r--r-- | lib/libc_r/arch/alpha/uthread_machdep.h | 70 |
1 files changed, 4 insertions, 66 deletions
diff --git a/lib/libc_r/arch/alpha/uthread_machdep.h b/lib/libc_r/arch/alpha/uthread_machdep.h index 9a7c52da977..3c159c84b99 100644 --- a/lib/libc_r/arch/alpha/uthread_machdep.h +++ b/lib/libc_r/arch/alpha/uthread_machdep.h @@ -1,68 +1,6 @@ -/* - * OpenBSD/alpha machine-dependent thread macros - * - * $OpenBSD: uthread_machdep.h,v 1.5 1999/11/25 07:01:27 d Exp $ - */ +/* $OpenBSD: uthread_machdep.h,v 1.6 2000/10/04 05:55:33 d Exp $ */ +/* David Leonard, <d@csee.uq.edu.au>. Public domain. */ -/* save the floating point state of a thread */ -#define _thread_machdep_save_float_state(thr) \ -do { \ - __asm__( \ - "stt $f8, ( 0 * 8) + %0\n\tstt $f9, ( 1 * 8) + %0\n\t" \ - "stt $f10, ( 2 * 8) + %0\n\tstt $f11, ( 3 * 8) + %0\n\t" \ - "stt $f12, ( 4 * 8) + %0\n\tstt $f13, ( 5 * 8) + %0\n\t" \ - "stt $f14, ( 6 * 8) + %0\n\tstt $f15, ( 7 * 8) + %0\n\t" \ - "stt $f16, ( 8 * 8) + %0\n\tstt $f17, ( 9 * 8) + %0\n\t" \ - "stt $f18, (10 * 8) + %0\n\tstt $f19, (11 * 8) + %0\n\t" \ - "stt $f20, (12 * 8) + %0\n\tstt $f21, (13 * 8) + %0\n\t" \ - "stt $f22, (14 * 8) + %0\n\tstt $f23, (15 * 8) + %0\n\t" \ - "stt $f24, (16 * 8) + %0\n\tstt $f25, (17 * 8) + %0\n\t" \ - "stt $f26, (18 * 8) + %0\n\tstt $f27, (19 * 8) + %0\n\t" \ - "stt $f28, (20 * 8) + %0\n\tstt $f29, (21 * 8) + %0\n\t" \ - "stt $f30, (22 * 8) + %0" \ - : : "o" ((thr)->_machdep.saved_fp) : "memory"); \ -} while(0) - -/* restore the floating point state of a thread */ -#define _thread_machdep_restore_float_state(thr) \ -do { \ - __asm__( \ - "ldt $f8, ( 0 * 8) + %0\n\tldt $f9, ( 1 * 8) + %0\n\t" \ - "ldt $f10, ( 2 * 8) + %0\n\tldt $f11, ( 3 * 8) + %0\n\t" \ - "ldt $f12, ( 4 * 8) + %0\n\tldt $f13, ( 5 * 8) + %0\n\t" \ - "ldt $f14, ( 6 * 8) + %0\n\tldt $f15, ( 7 * 8) + %0\n\t" \ - "ldt $f16, ( 8 * 8) + %0\n\tldt $f17, ( 9 * 8) + %0\n\t" \ - "ldt $f18, (10 * 8) + %0\n\tldt $f19, (11 * 8) + %0\n\t" \ - "ldt $f20, (12 * 8) + %0\n\tldt $f21, (13 * 8) + %0\n\t" \ - "ldt $f22, (14 * 8) + %0\n\tldt $f23, (15 * 8) + %0\n\t" \ - "ldt $f24, (16 * 8) + %0\n\tldt $f25, (17 * 8) + %0\n\t" \ - "ldt $f26, (18 * 8) + %0\n\tldt $f27, (19 * 8) + %0\n\t" \ - "ldt $f28, (20 * 8) + %0\n\tldt $f29, (21 * 8) + %0\n\t" \ - "ldt $f30, (22 * 8) + %0\n\t" \ - : : "o" (thr->_machdep.saved_fp) : \ - "$f8", "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15", \ - "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23", \ - "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30"); \ -} while(0) - -/* initialise the jmpbuf stack frame so it continues from entry */ -#define _thread_machdep_thread_create(thr, entry, pattr) \ - { \ - /* entry */ \ - (thr)->saved_jmp_buf[2] = (long) entry; \ - (thr)->saved_jmp_buf[4 + R_RA] = 0; \ - (thr)->saved_jmp_buf[4 + R_T12] = (long) entry; \ - /* stack */ \ - (thr)->saved_jmp_buf[4 + R_SP] = (long) (thr)->stack->base \ - + (thr)->stack->size \ - - sizeof(double); \ - } - -#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[23 * 8]; +struct _machdep_state { + int fp; }; |