(lwpProc, lwpSem): Declare as incomplete type in include/lwp.h. Move

complete declaration to src/lib/lwp/lwpint.h.
(lwpQueue): Move to src/lib/lwp/lwpint.h.
(empth_main, empth_flags): New.
(empth_init): Initialize them.
(empth_create, empth_exit): Use them instead of lwpProc members.
This commit is contained in:
Markus Armbruster 2005-12-07 19:15:37 +00:00
parent f958d3d683
commit aab54fcd54
4 changed files with 52 additions and 41 deletions

View file

@ -32,43 +32,8 @@
#define LWP_STACKCHECK 0x1
#define LWP_PRINT 0x2
/* process control block. do *not* change the position of context */
struct lwpProc {
#ifdef UCONTEXT
ucontext_t context; /* context structure */
#else /* !UCONTEXT */
jmp_buf context; /* processor context area */
#endif /* !UCONTEXT */
void *sbtm; /* bottom of stack attached to it */
int size; /* size of stack */
void (*entry)(void *); /* entry point */
int dead; /* whether the process can be rescheduled */
int pri; /* which scheduling queue we're on */
long runtime; /* time at which process is restarted */
int fd; /* fd we're blocking on */
int argc; /* initial arguments */
char **argv;
void *ud; /* user data */
void *lowmark; /* start of low buffer around stack */
void *himark; /* start of upper buffer around stack */
char *name; /* process name and description */
char *desc;
int flags;
struct lwpProc *next;
};
/* queue */
struct lwpQueue {
struct lwpProc *head;
struct lwpProc *tail;
};
/* semaphore */
struct lwpSem {
int count;
struct lwpQueue q;
char *name;
};
struct lwpProc;
struct lwpSem;
#define LWP_FD_READ 0x1
#define LWP_FD_WRITE 0x2