summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/arch
diff options
context:
space:
mode:
authord <d@openbsd.org>2000-01-06 07:04:36 +0000
committerd <d@openbsd.org>2000-01-06 07:04:36 +0000
commita6790dcadd4fbd0662a1c40463b432b0592b8d61 (patch)
tree2bed7fdd99e59d59976fe80e62f46bca4505da6d /lib/libpthread/arch
parentuse new tests, and -lpthread (diff)
downloadwireguard-openbsd-a6790dcadd4fbd0662a1c40463b432b0592b8d61.tar.xz
wireguard-openbsd-a6790dcadd4fbd0662a1c40463b432b0592b8d61.zip
thread context setjmp code, art@
Diffstat (limited to 'lib/libpthread/arch')
-rw-r--r--lib/libpthread/arch/sparc/uthread_machdep.S35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/libpthread/arch/sparc/uthread_machdep.S b/lib/libpthread/arch/sparc/uthread_machdep.S
new file mode 100644
index 00000000000..c24fff66c07
--- /dev/null
+++ b/lib/libpthread/arch/sparc/uthread_machdep.S
@@ -0,0 +1,35 @@
+/* $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
+