4 * Userland scheduler API
6 * $DragonFly: src/sys/sys/usched.h,v 1.14 2007/07/10 18:35:38 josepht 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 (*setrunqueue)(struct lwp *);
39 void (*schedulerclock)(struct lwp *, sysclock_t, sysclock_t);
40 void (*recalculate)(struct lwp *);
41 void (*resetpriority)(struct lwp *);
42 void (*heuristic_forking)(struct lwp *, struct lwp *);
43 void (*heuristic_exiting)(struct lwp *, struct lwp *);
44 void (*setcpumask)(struct usched *, cpumask_t);
52 short priority; /* lower is better */
53 char unused01; /* (currently not used) */
56 int estcpu; /* dynamic priority modification */
57 u_short rqtype; /* protected copy of rtprio type */
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 */
72 #define USCHED_SET_SCHEDULER 0
73 #define USCHED_SET_CPU 1
74 #define USCHED_ADD_CPU 2
75 #define USCHED_DEL_CPU 3
78 * Kernel variables and procedures, or user system calls.
82 extern struct usched usched_bsd4;
83 extern struct usched usched_dummy;
84 extern cpumask_t usched_mastermask;
86 int usched_ctl(struct usched *, int);
87 struct usched *usched_init(void);
91 #if !defined(_KERNEL) || defined(_KERNEL_VIRTUAL)
93 int usched_set(pid_t, int, void *, int);