From 8a708fb239f4272ac7e4f16f437093c56b2cab39 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 23 Nov 2003 18:18:41 +0000 Subject: sun support --- src/libthread/sun4u.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/libthread/sun4u.c (limited to 'src/libthread/sun4u.c') diff --git a/src/libthread/sun4u.c b/src/libthread/sun4u.c new file mode 100644 index 00000000..5eb2135e --- /dev/null +++ b/src/libthread/sun4u.c @@ -0,0 +1,25 @@ +#include "threadimpl.h" + +static void +launchersparc(int o0, int o1, int o2, int o3, int o4, + void (*f)(void *arg), void *arg) +{ + (*f)(arg); + threadexits(nil); +} + +void +_threadinitstack(Thread *t, void (*f)(void*), void *arg) +{ + ulong *tos, *stk; + + tos = (ulong*)&t->stk[t->stksize&~7]; + stk = tos; + --stk; + *--stk = (ulong)arg; + *--stk = (ulong)f; + t->sched.link = (ulong)launchersparc - 8; + t->sched.input[6] = 0; + t->sched.sp = (ulong)stk - 0x5c; +} + -- cgit v1.2.3