summaryrefslogtreecommitdiffstats
path: root/src/libthread/386.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-25 21:56:33 +0000
committerrsc <devnull@localhost>2004-12-25 21:56:33 +0000
commit1544f90960275dc9211bde30329c3258e0e1bf38 (patch)
treef55e7a73c03aaa24daa7cc2ad02822b921c477f9 /src/libthread/386.c
parent7788fd54094693384ef5c92c475656dba8819feb (diff)
downloadplan9port-1544f90960275dc9211bde30329c3258e0e1bf38.tar.gz
plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.zip
New thread library
Diffstat (limited to 'src/libthread/386.c')
-rw-r--r--src/libthread/386.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/libthread/386.c b/src/libthread/386.c
deleted file mode 100644
index 313c2be5..00000000
--- a/src/libthread/386.c
+++ /dev/null
@@ -1,62 +0,0 @@
-#if defined(__linux__)
-#include "ucontext.c"
-#else
-
-#include "threadimpl.h"
-/*
- * To use this you need some patches to Valgrind that
- * let it help out with detecting stack overflow.
- */
-#ifdef USEVALGRIND
-#include <valgrind/memcheck.h>
-#endif
-
-static void
-launcher386(void (*f)(void *arg), void *arg)
-{
- Proc *p;
- Thread *t;
-
- p = _threadgetproc();
- t = p->thread;
- _threadstacklimit(t->stk, t->stk+t->stksize);
-
- (*f)(arg);
- threadexits(nil);
-}
-
-void
-_threadinitstack(Thread *t, void (*f)(void*), void *arg)
-{
- ulong *tos;
-
- tos = (ulong*)&t->stk[t->stksize&~7];
- *--tos = (ulong)arg;
- *--tos = (ulong)f;
- t->sched.pc = (ulong)launcher386;
- t->sched.sp = (ulong)tos - 8; /* old PC and new PC */
-}
-
-void
-_threadinswitch(int enter)
-{
- USED(enter);
-#ifdef USEVALGRIND
- if(enter)
- VALGRIND_SET_STACK_LIMIT(0, 0, 0);
- else
- VALGRIND_SET_STACK_LIMIT(0, 0, 1);
-#endif
-}
-
-void
-_threadstacklimit(void *bottom, void *top)
-{
- USED(bottom);
- USED(top);
-
-#ifdef USEVALGRIND
- VALGRIND_SET_STACK_LIMIT(1, bottom, top);
-#endif
-}
-#endif