Blob


1 #include "threadimpl.h"
3 static void
4 launchersparc(int o0, int o1, int o2, int o3, int o4,
5 void (*f)(void *arg), void *arg)
6 {
7 (*f)(arg);
8 threadexits(nil);
9 }
11 void
12 _threadinitstack(Thread *t, void (*f)(void*), void *arg)
13 {
14 ulong *tos, *stk;
16 tos = (ulong*)&t->stk[t->stksize&~7];
17 stk = tos;
18 --stk;
19 *--stk = (ulong)arg;
20 *--stk = (ulong)f;
21 t->sched.link = (ulong)launchersparc - 8;
22 t->sched.input[6] = 0;
23 t->sched.sp = (ulong)stk - 0x5c;
24 }