4 * Implements the architecture independant portion of the LWKT
7 * $DragonFly: src/sys/sys/thread.h,v 1.2 2003/06/19 06:26:10 dillon Exp $
10 #ifndef _SYS_THREAD_H_
11 #define _SYS_THREAD_H_
16 typedef TAILQ_HEAD(, thread) thread_list_t;
19 TAILQ_ENTRY(thread) td_threadq;
20 struct proc *td_proc; /* (optional) associated process */
21 struct pcb *td_pcb; /* points to pcb and top of kstack */
22 int td_pri; /* 0-31, 0=highest priority */
23 char *td_kstack; /* kernel stack */
25 int td_flags; /* THF flags */
26 int td_pri; /* semi-static LWKT priority 0-31 */
27 int td_bglcount; /* big giant lock count */
31 typedef struct thread *thread_t;
34 * Thread priorities. Typically only one thread from any given
35 * user process scheduling queue is on the LWKT run queue at a time.
36 * Remember that there is one LWKT run queue per cpu.
39 #define THPRI_INT_HIGH 2 /* high priority interrupt */
40 #define THPRI_INT_MED 4 /* medium priority interrupt */
41 #define THPRI_INT_LOW 6 /* low priority interrupt */
42 #define THPRI_INT_SUPPORT 10 /* kernel / high priority support */
43 #define THPRI_SOFT_TIMER 12 /* kernel / timer */
44 #define THPRI_SOFT_NORM 15 /* kernel / normal */
45 #define THPRI_KERN_USER 20 /* kernel / block in syscall */
46 #define THPRI_USER_REAL 25 /* user scheduler real time */
47 #define THPRI_USER_NORM 27 /* user scheduler normal */
48 #define THPRI_USER_IDLE 29 /* user scheduler idle */
49 #define THPRI_IDLE_THREAD 31 /* the idle thread */
51 #define CACHE_NTHREADS 4
55 extern struct vm_zone *thread_zone;