Oops commit the thread.h file.
[dragonfly.git] / sys / sys / thread.h
CommitLineData
2df9fa87
MD
1/*
2 * SYS/THREAD.H
3 *
4 * Implements the architecture independant portion of the LWKT
5 * subsystem.
6 *
7 * $DragonFly: src/sys/sys/thread.h,v 1.1 2003/06/18 23:05:12 dillon Exp $
8 */
9
10#ifndef _SYS_THREAD_H_
11#define _SYS_THREAD_H_
12
13struct proc;
14struct thread;
15
16typedef TAILQ_HEAD(, thread) thread_list_t;
17
18struct thread {
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#if 0
24 void *td_stack; /* base of thread stack */
25 int td_stackSize; /* size of thread stack */
26 int td_flags; /* THF flags */
27 int td_pri; /* semi-static LWKT priority 0-31 */
28 int td_bglcount; /* big giant lock count */
29#endif
30};
31
32typedef struct thread *thread_t;
33
34/*
35 * Thread priorities. Typically only one thread from any given
36 * user process scheduling queue is on the LWKT run queue at a time.
37 * Remember that there is one LWKT run queue per cpu.
38 */
39
40#define THPRI_INT_HIGH 2 /* high priority interrupt */
41#define THPRI_INT_MED 4 /* medium priority interrupt */
42#define THPRI_INT_LOW 6 /* low priority interrupt */
43#define THPRI_INT_SUPPORT 10 /* kernel / high priority support */
44#define THPRI_SOFT_TIMER 12 /* kernel / timer */
45#define THPRI_SOFT_NORM 15 /* kernel / normal */
46#define THPRI_KERN_USER 20 /* kernel / block in syscall */
47#define THPRI_USER_REAL 25 /* user scheduler real time */
48#define THPRI_USER_NORM 27 /* user scheduler normal */
49#define THPRI_USER_IDLE 29 /* user scheduler idle */
50#define THPRI_IDLE_THREAD 31 /* the idle thread */
51
52#ifdef _KERNEL
53
54extern struct vm_zone *thread_zone;
55
56#endif
57
58#endif
59