diff options
Diffstat (limited to 'src/libthread/PowerMacintosh.c')
| -rw-r--r-- | src/libthread/PowerMacintosh.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libthread/PowerMacintosh.c b/src/libthread/PowerMacintosh.c new file mode 100644 index 00000000..ddacea37 --- /dev/null +++ b/src/libthread/PowerMacintosh.c @@ -0,0 +1,28 @@ +#include "threadimpl.h" + +static void +launcherpower(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, + void (*f)(void *arg), void *arg) +{ + (*f)(arg); + threadexits(nil); +} + +void +_threadinitstack(Thread *t, void (*f)(void*), void *arg) +{ + ulong *tos, *stk; + int n; + + tos = (ulong*)&t->stk[t->stksize&~7]; + stk = tos; + --stk; + --stk; + --stk; + --stk; + *--stk = (ulong)arg; + *--stk = (ulong)f; + t->sched.pc = (ulong)launcherpower+LABELDPC; + t->sched.sp = (ulong)tos-80; +} + |
