4 * Userland scheduler API
6 * $DragonFly: src/sys/sys/usched.h,v 1.9 2006/05/20 02:42:13 dillon Exp $
10 #define _SYS_USCHED_H_
12 #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
15 #include <sys/types.h>
18 #include <sys/queue.h>
20 #ifndef _SYS_SYSTIMER_H_
21 #include <sys/systimer.h>
24 #define NAME_LENGTH 32
31 TAILQ_ENTRY(usched) entry;
34 void (*usched_register)(void);
35 void (*usched_unregister)(void);
36 void (*acquire_curproc)(struct lwp *);
37 void (*release_curproc)(struct lwp *);
38 void (*select_curproc)(struct globaldata *);
39 void (*setrunqueue)(struct lwp *);
40 void (*remrunqueue)(struct lwp *);
41 void (*schedulerclock)(struct lwp *, sysclock_t, sysclock_t);
42 void (*recalculate)(struct lwp *);
43 void (*resetpriority)(struct lwp *);
44 void (*heuristic_forking)(struct lwp *, struct lwp *);
45 void (*heuristic_exiting)(struct lwp *, struct lwp *);
46 void (*setcpumask)(struct usched *, cpumask_t);
54 short priority; /* lower is better */
55 char interactive; /* (currently not used) */
58 int estcpu; /* dynamic priority modification */
61 int pad[4]; /* PAD for future expansion */
65 * Flags for usched_ctl()
67 #define USCH_ADD 0x00000001
68 #define USCH_REM 0x00000010
70 #endif /* _KERNEL || _KERNEL_STRUCTURES */
73 * Kernel variables and procedures, or user system calls.
77 extern struct usched usched_bsd4;
79 int usched_ctl(struct usched *, int);
80 struct usched *usched_init(void);
84 int usched_set(const char *, int);