Merge from vendor branch LUKEMFTP:
[dragonfly.git] / sys / sys / usched.h
1 /*
2  * SYS/USCHED.H
3  *
4  *      Userland scheduler API
5  * 
6  * $DragonFly: src/sys/sys/usched.h,v 1.6 2005/10/11 09:59:56 corecode Exp $
7  */
8
9 #ifndef _SYS_USCHED_H_
10 #define _SYS_USCHED_H_
11
12 #ifndef _SYS_QUEUE_H_
13 #include <sys/queue.h>
14 #endif
15
16 struct proc;
17 struct globaldata;
18
19 struct usched {
20     TAILQ_ENTRY(usched) entry;
21     const char *name;
22     const char *desc;
23     void (*acquire_curproc)(struct lwp *);
24     void (*release_curproc)(struct lwp *);
25     void (*select_curproc)(struct globaldata *);
26     void (*setrunqueue)(struct lwp *);
27     void (*remrunqueue)(struct lwp *);
28     void (*schedulerclock)(struct lwp *, sysclock_t, sysclock_t);
29     void (*recalculate)(struct lwp *);
30     void (*resetpriority)(struct lwp *);
31     void (*heuristic_forking)(struct lwp *, struct lwp *);
32     void (*heuristic_exiting)(struct lwp *, struct lwp *);
33 };
34
35 union usched_data {
36     /*
37      * BSD4 scheduler. 
38      */
39     struct {
40         short   priority;       /* lower is better */
41         char    interactive;    /* (currently not used) */
42         char    rqindex;
43         int     origcpu;
44         int     estcpu;         /* dynamic priority modification */
45     } bsd4;
46
47     int         pad[4];         /* PAD for future expansion */
48 };
49
50 extern struct usched    usched_bsd4;
51
52 #endif
53