Fix "ls: not found" problem during buildworld. mdate.sh script
[dragonfly.git] / sys / sys / usched.h
blobaa36a61ee64cbd2c93f26ffc6a507bb5b3ed8fb6
1 /*
2 * SYS/USCHED.H
4 * Userland scheduler API
5 *
6 * $DragonFly: src/sys/sys/usched.h,v 1.7 2005/11/16 02:24:33 dillon Exp $
7 */
9 #ifndef _SYS_USCHED_H_
10 #define _SYS_USCHED_H_
12 #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
14 #ifndef _SYS_QUEUE_H_
15 #include <sys/queue.h>
16 #endif
18 struct proc;
19 struct globaldata;
21 struct usched {
22 TAILQ_ENTRY(usched) entry;
23 const char *name;
24 const char *desc;
25 void (*usched_register)(void);
26 void (*usched_unregister)(void);
27 void (*acquire_curproc)(struct lwp *);
28 void (*release_curproc)(struct lwp *);
29 void (*select_curproc)(struct globaldata *);
30 void (*setrunqueue)(struct lwp *);
31 void (*remrunqueue)(struct lwp *);
32 void (*schedulerclock)(struct lwp *, sysclock_t, sysclock_t);
33 void (*recalculate)(struct lwp *);
34 void (*resetpriority)(struct lwp *);
35 void (*heuristic_forking)(struct lwp *, struct lwp *);
36 void (*heuristic_exiting)(struct lwp *, struct lwp *);
37 void (*setcpumask)(struct usched *, cpumask_t);
40 union usched_data {
42 * BSD4 scheduler.
44 struct {
45 short priority; /* lower is better */
46 char interactive; /* (currently not used) */
47 char rqindex;
48 int origcpu;
49 int estcpu; /* dynamic priority modification */
50 } bsd4;
52 int pad[4]; /* PAD for future expansion */
56 * Flags for usched_ctl()
58 #define USCH_ADD 0x00000001
59 #define USCH_REM 0x00000010
61 #endif /* _KERNEL || _KERNEL_STRUCTURES */
64 * Kernel variables and procedures, or user system calls.
66 #ifdef _KERNEL
68 extern struct usched usched_bsd4;
70 int usched_ctl(struct usched *, int);
71 struct usched *usched_init(void);
73 #else
75 int usched_set(const char *, int);
77 #endif
79 #endif