summaryrefslogtreecommitdiffstats
path: root/src/libthread/power.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-09-20 15:08:57 +0000
committerrsc <devnull@localhost>2004-09-20 15:08:57 +0000
commite5c26b01f70303f3322ac98d670ef886a62ac38a (patch)
tree60ad947a32a9607e03d26e51f46f72a00581fa6b /src/libthread/power.c
parentdcc9531c5a8d5d43d71060f8975d592c7598b349 (diff)
downloadplan9port-e5c26b01f70303f3322ac98d670ef886a62ac38a.tar.gz
plan9port-e5c26b01f70303f3322ac98d670ef886a62ac38a.zip
various forgotten files
Diffstat (limited to 'src/libthread/power.c')
-rw-r--r--src/libthread/power.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libthread/power.c b/src/libthread/power.c
new file mode 100644
index 00000000..b0a14e6f
--- /dev/null
+++ b/src/libthread/power.c
@@ -0,0 +1,40 @@
+#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;
+
+ 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)stk)-8;
+ *((ulong *)t->sched.sp) = 0;
+}
+
+void
+_threadinswitch(int enter)
+{
+ USED(enter);
+}
+
+void
+_threadstacklimit(void *addr, void *addr2)
+{
+ USED(addr);
+}
+