usched: Allow process to change self cpu affinity
[dragonfly.git] / sys / sys / lwp.h
blob80b7ee7e2f4ca3fa39b52d4468081aa2faf0b571
1 #ifndef _SYS_LWP_H_
2 #define _SYS_LWP_H_
4 #include <sys/types.h>
6 /*
7 * Parameters for the creation of a new lwp.
8 */
9 struct lwp_params {
10 void (*lwp_func)(void *); /* Function to start execution */
11 void *lwp_arg; /* Parameter to this function */
12 void *lwp_stack; /* Stack address to use */
13 lwpid_t *lwp_tid1; /* Address to copy out new tid */
14 lwpid_t *lwp_tid2; /* Same */
17 #if !defined(_KERNEL) || defined(_KERNEL_VIRTUAL)
19 #include <machine/cpumask.h>
21 __BEGIN_DECLS
23 struct rtprio;
25 int lwp_create(struct lwp_params *);
26 int lwp_create2(struct lwp_params *, const cpumask_t *);
27 #ifndef _LWP_GETTID_DECLARED
28 lwpid_t lwp_gettid(void);
29 #define _LWP_GETTID_DECLARED
30 #endif
31 #ifndef _LWP_SETNAME_DECLARED
32 int lwp_setname(lwpid_t, const char *);
33 #define _LWP_SETNAME_DECLARED
34 #endif
35 #ifndef _LWP_RTPRIO_DECLARED
36 int lwp_rtprio(int, pid_t, lwpid_t, struct rtprio *);
37 #define _LWP_RTPRIO_DECLARED
38 #endif
39 int lwp_setaffinity(pid_t, lwpid_t, const cpumask_t *);
40 int lwp_getaffinity(pid_t, lwpid_t, cpumask_t *);
41 #ifndef _LWP_KILL_DECLARED
42 int lwp_kill(pid_t, lwpid_t, int);
43 #define _LWP_KILL_DECLARED
44 #endif
46 __END_DECLS
48 #endif /* !_KERNEL */
50 #endif /* !_SYS_LWP_H_ */