]>
Commit | Line | Data |
---|---|---|
9ccd27cc IM |
1 | #ifndef _LINUX_SCHED_RT_H |
2 | #define _LINUX_SCHED_RT_H | |
8bd75c77 | 3 | |
9ccd27cc IM |
4 | #include <linux/sched.h> |
5 | ||
6 | struct task_struct; | |
8bd75c77 CW |
7 | |
8 | static inline int rt_prio(int prio) | |
9 | { | |
10 | if (unlikely(prio < MAX_RT_PRIO)) | |
11 | return 1; | |
12 | return 0; | |
13 | } | |
14 | ||
15 | static inline int rt_task(struct task_struct *p) | |
16 | { | |
17 | return rt_prio(p->prio); | |
18 | } | |
19 | ||
20 | #ifdef CONFIG_RT_MUTEXES | |
21 | extern int rt_mutex_getprio(struct task_struct *p); | |
22 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | |
0782e63b | 23 | extern int rt_mutex_get_effective_prio(struct task_struct *task, int newprio); |
e96a7705 | 24 | extern void rt_mutex_update_top_task(struct task_struct *p); |
2d3d891d | 25 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); |
8bd75c77 CW |
26 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
27 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | |
28 | { | |
29 | return tsk->pi_blocked_on != NULL; | |
30 | } | |
31 | #else | |
32 | static inline int rt_mutex_getprio(struct task_struct *p) | |
33 | { | |
34 | return p->normal_prio; | |
35 | } | |
c365c292 | 36 | |
0782e63b TG |
37 | static inline int rt_mutex_get_effective_prio(struct task_struct *task, |
38 | int newprio) | |
c365c292 | 39 | { |
0782e63b | 40 | return newprio; |
c365c292 TG |
41 | } |
42 | ||
2d3d891d DF |
43 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) |
44 | { | |
45 | return NULL; | |
46 | } | |
8bd75c77 CW |
47 | # define rt_mutex_adjust_pi(p) do { } while (0) |
48 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | |
49 | { | |
50 | return false; | |
51 | } | |
52 | #endif | |
53 | ||
54 | extern void normalize_rt_tasks(void); | |
55 | ||
56 | ||
bc681593 CW |
57 | /* |
58 | * default timeslice is 100 msecs (used only for SCHED_RR tasks). | |
59 | * Timeslices get refilled after they expire. | |
60 | */ | |
61 | #define RR_TIMESLICE (100 * HZ / 1000) | |
62 | ||
9ccd27cc | 63 | #endif /* _LINUX_SCHED_RT_H */ |