* Remove a procedural layer in the scheduler clock code by having
[dragonfly.git] / sys / sys / usched.h
CommitLineData
a77ac49d
MD
1/*
2 * SYS/USCHED.H
3 *
4 * Userland scheduler API
5 *
dcc99b62 6 * $DragonFly: src/sys/sys/usched.h,v 1.4 2005/06/27 18:37:59 dillon Exp $
a77ac49d
MD
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
16struct proc;
17struct globaldata;
18
19struct 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 *);
dcc99b62
MD
28 void (*schedulerclock)(struct proc *, sysclock_t, sysclock_t);
29 void (*recalculate)(struct proc *);
a77ac49d 30 void (*resetpriority)(struct proc *);
352f5709
MD
31 void (*heuristic_forking)(struct proc *, struct proc *);
32 void (*heuristic_exiting)(struct proc *, struct proc *);
352f5709
MD
33};
34
35union usched_data {
36 /*
37 * BSD4 scheduler.
38 */
39 struct {
40 short priority; /* lower is better */
a46fac56 41 char interactive; /* (currently not used) */
352f5709 42 char rqindex;
dcc99b62
MD
43 int childscpu;
44 int estcpu; /* dynamic priority modification */
352f5709
MD
45 } bsd4;
46
47 int pad[4]; /* PAD for future expansion */
a77ac49d
MD
48};
49
50extern struct usched usched_bsd4;
51
52#endif
53