diff options
Diffstat (limited to 'src/libthread/sun4u.c')
-rw-r--r-- | src/libthread/sun4u.c | 25 |
1 files changed, 25 insertions, 0 deletions
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; +} + |