1 #ifndef _LINUX_SCHED_RT_H
2 #define _LINUX_SCHED_RT_H
4 #include <linux/sched.h>
8 static inline int rt_prio(int prio)
10 if (unlikely(prio < MAX_RT_PRIO))
15 static inline int rt_task(struct task_struct *p)
17 return rt_prio(p->prio);
20 #ifdef CONFIG_RT_MUTEXES
22 * Must hold either p->pi_lock or task_rq(p)->lock.
24 static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *p)
26 return p->pi_top_task;
28 extern void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task);
29 extern void rt_mutex_adjust_pi(struct task_struct *p);
30 static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
32 return tsk->pi_blocked_on != NULL;
35 static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
39 # define rt_mutex_adjust_pi(p) do { } while (0)
40 static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
46 extern void normalize_rt_tasks(void);
50 * default timeslice is 100 msecs (used only for SCHED_RR tasks).
51 * Timeslices get refilled after they expire.
53 #define RR_TIMESLICE (100 * HZ / 1000)
55 #endif /* _LINUX_SCHED_RT_H */