summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/arch/sparc
diff options
context:
space:
mode:
authord <d@openbsd.org>2000-10-04 05:55:33 +0000
committerd <d@openbsd.org>2000-10-04 05:55:33 +0000
commit789060e356dc0d45ff8b10b23e67fb240c40e245 (patch)
tree433c497a393444dcea2ecdd760f9bc499789e5b2 /lib/libpthread/arch/sparc
parentif fstat fails fails, as it will on some sockets, close anyway. (diff)
downloadwireguard-openbsd-789060e356dc0d45ff8b10b23e67fb240c40e245.tar.xz
wireguard-openbsd-789060e356dc0d45ff8b10b23e67fb240c40e245.zip
switch to _machdep_switch() instead of setjmp/longjmp. For some reason this fixes sparc threads.
Diffstat (limited to 'lib/libpthread/arch/sparc')
-rw-r--r--lib/libpthread/arch/sparc/uthread_machdep.S35
-rw-r--r--lib/libpthread/arch/sparc/uthread_machdep.h42
2 files changed, 5 insertions, 72 deletions
diff --git a/lib/libpthread/arch/sparc/uthread_machdep.S b/lib/libpthread/arch/sparc/uthread_machdep.S
deleted file mode 100644
index c24fff66c07..00000000000
--- a/lib/libpthread/arch/sparc/uthread_machdep.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $OpenBSD: uthread_machdep.S,v 1.1 2000/01/06 07:04:36 d Exp $ */
-
-#include <machine/asm.h>
-#include <machine/trap.h>
-
-ENTRY(_thread_machdep_create)
- st %o2, [%o0] /* store the new stack pointer */
- sub %o1, 8, %o1 /* the return adress is o7 + 8 ! */
- st %o1, [%o0+4] /* store the new pc */
-
- retl
- nop
-
-ENTRY(_thread_machdep_setjmp)
- t ST_FLUSHWIN /* flush register windows */
- st %sp, [%o0] /* store sp */
- st %o7, [%o0+4] /* store pc */
- retl
- clr %o0 /* return 0 */
-
-ENTRY(_thread_machdep_longjmp)
- t ST_FLUSHWIN /* flush register windows */
- sub %sp, 64, %sp /* foo? */
-
- ld [%o0+4], %o7 /* restore pc */
- ld [%o0], %fp /* restore fp, the restore ins below will
- * cause it to become sp */
- /* i?i:1 - Do we need to care? it's always called with 1 */
- tst %o1
- be,a 0f
- mov 1, %o1
-0:
- retl
- restore %o1, 0, %o0
-
diff --git a/lib/libpthread/arch/sparc/uthread_machdep.h b/lib/libpthread/arch/sparc/uthread_machdep.h
index 53ad543f77a..cb43f3a0463 100644
--- a/lib/libpthread/arch/sparc/uthread_machdep.h
+++ b/lib/libpthread/arch/sparc/uthread_machdep.h
@@ -1,39 +1,7 @@
-/*
- * OpenBSD/sparc machine-dependent thread macros
- *
- * $OpenBSD: uthread_machdep.h,v 1.4 2000/01/06 07:04:54 d Exp $
- */
+/* $OpenBSD: uthread_machdep.h,v 1.5 2000/10/04 05:55:35 d Exp $ */
+/* David Leonard, <d@csee.uq.edu.au>. Public domain. */
-#include <sys/signal.h>
-
-/* save the floating point state of a thread */
-#define _thread_machdep_save_float_state(thr) \
- { \
- /* XXX tdb */ \
- }
-
-/* restore the floating point state of a thread */
-#define _thread_machdep_restore_float_state(thr) \
- { \
- /* XXX tdb */ \
- }
-
-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) \
- { \
- 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; \
- }
-
-struct _machdep_struct {
- /* char saved_fp[???]; */
- int dummy;
+struct _machdep_state {
+ int fp; /* frame pointer */
+ int pc; /* program counter */
};
-