aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/threadimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libthread/threadimpl.h')
-rw-r--r--src/libthread/threadimpl.h46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/libthread/threadimpl.h b/src/libthread/threadimpl.h
index 8d22a161..fd40f252 100644
--- a/src/libthread/threadimpl.h
+++ b/src/libthread/threadimpl.h
@@ -9,36 +9,11 @@
# if defined(__APPLE__)
# define _XOPEN_SOURCE /* for Snow Leopard */
# endif
-# include <ucontext.h>
#endif
#include <sys/utsname.h>
#include "libc.h"
#include "thread.h"
-#if defined(__OpenBSD__)
-# define mcontext libthread_mcontext
-# define mcontext_t libthread_mcontext_t
-# define ucontext libthread_ucontext
-# define ucontext_t libthread_ucontext_t
-# if defined __i386__
-# include "386-ucontext.h"
-# elif defined __amd64__
-# include "x86_64-ucontext.h"
-# else
-# include "power-ucontext.h"
-# endif
-extern pid_t rfork_thread(int, void*, int(*)(void*), void*);
-#endif
-
-#if defined(__arm__)
-int mygetmcontext(ulong*);
-void mysetmcontext(const ulong*);
-#define setcontext(u) mysetmcontext(&(u)->uc_mcontext.arm_r0)
-#define getcontext(u) mygetmcontext(&(u)->uc_mcontext.arm_r0)
-#endif
-
-
-typedef struct Context Context;
typedef struct Execjob Execjob;
typedef struct Proc Proc;
typedef struct _Procrendez _Procrendez;
@@ -54,11 +29,6 @@ enum
STACK = 8192
};
-struct Context
-{
- ucontext_t uc;
-};
-
struct Execjob
{
int *fd;
@@ -72,11 +42,7 @@ struct _Procrendez
{
Lock *l;
int asleep;
-#ifdef PLAN9PORT_USING_PTHREADS
pthread_cond_t cond;
-#else
- int pid;
-#endif
};
struct _Thread
@@ -85,18 +51,14 @@ struct _Thread
_Thread *prev;
_Thread *allnext;
_Thread *allprev;
- Context context;
void (*startfn)(void*);
void *startarg;
uint id;
-#ifdef PLAN9PORT_USING_PTHREADS
pthread_t osprocid;
-#else
- int osprocid;
-#endif
uchar *stk;
uint stksize;
int exiting;
+ int mainthread;
Proc *proc;
char name[256];
char state[256];
@@ -114,11 +76,7 @@ struct Proc
Proc *next;
Proc *prev;
char msg[128];
-#ifdef PLAN9PORT_USING_PTHREADS
pthread_t osprocid;
-#else
- int osprocid;
-#endif
Lock lock;
int nswitch;
_Thread *thread0;
@@ -130,9 +88,7 @@ struct Proc
uint nthread;
uint sysproc;
_Procrendez runrend;
- Lock schedlock;
_Thread *schedthread;
- Context schedcontext;
void *udata;
Jmp sigjmp;
int mainproc;