diff options
author | 1999-03-03 06:00:10 +0000 | |
---|---|---|
committer | 1999-03-03 06:00:10 +0000 | |
commit | 2e2cba694ebac6d36888da7619ca8edb4960417b (patch) | |
tree | 8c9e0893b6c0ffea841a329237da76d310fb2a92 /lib/libpthread/arch | |
parent | Temporary disable AFS and Optimizations for m88k. (diff) | |
download | wireguard-openbsd-2e2cba694ebac6d36888da7619ca8edb4960417b.tar.xz wireguard-openbsd-2e2cba694ebac6d36888da7619ca8edb4960417b.zip |
m88k addition.
Diffstat (limited to 'lib/libpthread/arch')
-rw-r--r-- | lib/libpthread/arch/m88k/_atomic_lock.c | 19 | ||||
-rw-r--r-- | lib/libpthread/arch/m88k/uthread_machdep.h | 40 |
2 files changed, 59 insertions, 0 deletions
diff --git a/lib/libpthread/arch/m88k/_atomic_lock.c b/lib/libpthread/arch/m88k/_atomic_lock.c new file mode 100644 index 00000000000..a6ca8e7f71f --- /dev/null +++ b/lib/libpthread/arch/m88k/_atomic_lock.c @@ -0,0 +1,19 @@ +/* $OpenBSD: _atomic_lock.c,v 1.1 1999/03/03 06:00:10 smurph Exp $ */ +/* + * Atomic lock for m68k + */ + +#include "spinlock.h" + +int +_atomic_lock(volatile _spinlock_lock_t *lock) +{ + return (_thread_slow_atomic_lock(lock)); +} + +int +_atomic_is_locked(volatile _spinlock_lock_t *lock) +{ + + return (*lock != _SPINLOCK_UNLOCKED); +} diff --git a/lib/libpthread/arch/m88k/uthread_machdep.h b/lib/libpthread/arch/m88k/uthread_machdep.h new file mode 100644 index 00000000000..dcad59d851d --- /dev/null +++ b/lib/libpthread/arch/m88k/uthread_machdep.h @@ -0,0 +1,40 @@ +/* + * OpenBSD/m88k machine-dependent thread macros + * + * $OpenBSD: uthread_machdep.h,v 1.1 1999/03/03 06:00:10 smurph Exp $ + */ + +/* save the floating point state of a thread */ +#define _thread_machdep_save_float_state(thr) \ + { \ + /* fsave privileged instr */ \ + } + +/* restore the floating point state of a thread */ +#define _thread_machdep_restore_float_state(thr) \ + { \ + /* frestore privileged instr */ \ + } + +/* initialise the jmpbuf stack frame so it continues from entry */ + +#define _thread_machdep_thread_create(thr, entry, pattr) \ + { \ + /* entry */ \ + (thr)->saved_jmp_buf[5] = (long) entry; \ + /* stack */ \ + (thr)->saved_jmp_buf[2] = (long) (thr)->stack \ + + (pattr)->stacksize_attr \ + - 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[108]; */ + int dummy; +}; + |