diff options
Diffstat (limited to 'lib/libc_r/arch/i386/uthread_machdep.h')
-rw-r--r-- | lib/libc_r/arch/i386/uthread_machdep.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/libc_r/arch/i386/uthread_machdep.h b/lib/libc_r/arch/i386/uthread_machdep.h new file mode 100644 index 00000000000..2a296d3ae25 --- /dev/null +++ b/lib/libc_r/arch/i386/uthread_machdep.h @@ -0,0 +1,35 @@ +/* + * OpenBSD/i386 machine-dependent thread macros + * + * $OpenBSD: uthread_machdep.h,v 1.1 1998/08/28 01:54:58 d Exp $ + */ + +/* save the floating point state of a thread */ +#define _thread_machdep_save_float_state(thr) \ + { \ + char *fdata = (char*)((thr)->_machdep.saved_fp); \ + __asm__("fsave %0"::"m" (*fdata)); \ + } + +/* restore the floating point state of a thread */ +#define _thread_machdep_restore_float_state(thr) \ + { \ + char *fdata = (char*)((thr)->_machdep.saved_fp); \ + __asm__("frstor %0"::"m" (*fdata)); \ + } + +/* initialise the jmpbuf stack frame so it continues from entry */ +#define _thread_machdep_thread_create(thr, entry, pattr) \ + { \ + /* entry */ \ + (thr)->saved_jmp_buf[0] = (long) entry; \ + /* stack */ \ + (thr)->saved_jmp_buf[2] = (long) (thr)->stack \ + + (pattr)->stacksize_attr \ + - sizeof(double); \ + } + +struct _machdep_struct { + char saved_fp[108]; +}; + |