2 * lwpint.h -- lwp internal structures
4 * Copyright (C) 1991-3 Stephen Crane.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * author: Stephen Crane, (jsc@doc.ic.ac.uk), Department of Computing,
21 * Imperial College of Science, Technology and Medicine, 180 Queen's
22 * Gate, London SW7 2BZ, England.
31 #endif /* !UCONTEXT */
33 /* `liveness' counter: check signals every `n' visits to the scheduler */
34 /* note: the lower this value, the more responsive the system but the */
35 /* more inefficient the context switch time */
38 /* process control block. do *not* change the position of context */
41 ucontext_t context; /* context structure */
43 jmp_buf context; /* processor context area */
44 #endif /* !UCONTEXT */
45 void *sbtm; /* stack buffer attached to it */
46 int size; /* size of stack buffer */
47 char *ustack; /* lowest usable stack address */
48 int usize; /* size of usable stack */
49 void (*entry)(void *); /* entry point */
50 int dead; /* whether the process can be rescheduled */
51 int pri; /* which scheduling queue we're on */
52 long runtime; /* time at which process is restarted */
53 int fd; /* fd we're blocking on */
54 int argc; /* initial arguments */
56 void *ud; /* user data */
57 char *name; /* process name and description */
76 #define LWP_REDZONE 1024 /* make this a multiple of 1024 */
78 /* XXX Note that this assumes sizeof(long) == 4 */
79 #define LWP_CHECKMARK 0x5a5a5a5aL
81 extern int LwpStackGrowsDown;
83 int lwpNewContext(struct lwpProc *, int);
84 void lwpSwitchContext(struct lwpProc *, struct lwpProc *);
85 void lwpAddTail(struct lwpQueue *, struct lwpProc *);
86 struct lwpProc *lwpGetFirst(struct lwpQueue *);
87 void lwpReady(struct lwpProc *);
88 void lwpReschedule(void);
89 void lwpEntryPoint(void);
90 void lwpInitSelect(struct lwpProc * self);
91 void lwpDestroy(struct lwpProc * proc);