Move remaining scheduler-specific functions into the usched abstraction.
[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.2 2005/06/26 04:36:33 dillon 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 proc *);
24     void (*release_curproc)(struct proc *);
25     void (*select_curproc)(struct globaldata *);
26     void (*setrunqueue)(struct proc *);
27     void (*remrunqueue)(struct proc *);
28     void (*resetpriority)(struct proc *);
29     void (*heuristic_forking)(struct proc *, struct proc *);
30     void (*heuristic_exiting)(struct proc *, struct proc *);
31     void (*heuristic_estcpu)(struct proc *, int);
32 };
33
34 union usched_data {
35     /*
36      * BSD4 scheduler. 
37      */
38     struct {
39         short   priority;       /* lower is better */
40         char    interactive;    /* interactivity heuristic */
41         char    rqindex;
42         u_int   estcpu_fork;    /* interactivity heuristic */
43     } bsd4;
44
45     int         pad[4];         /* PAD for future expansion */
46 };
47
48 extern struct usched    usched_bsd4;
49
50 #endif
51