sched: get effective policy and rt_prio
[deliverable/linux.git] / include / linux / sched / rt.h
CommitLineData
8bd75c77
CW
1#ifndef _SCHED_RT_H
2#define _SCHED_RT_H
3
5c228079 4#include <linux/sched/prio.h>
8bd75c77
CW
5
6static inline int rt_prio(int prio)
7{
8 if (unlikely(prio < MAX_RT_PRIO))
9 return 1;
10 return 0;
11}
12
13static inline int rt_task(struct task_struct *p)
14{
15 return rt_prio(p->prio);
16}
17
18#ifdef CONFIG_RT_MUTEXES
19extern int rt_mutex_getprio(struct task_struct *p);
20extern void rt_mutex_setprio(struct task_struct *p, int prio);
0782e63b 21extern int rt_mutex_get_effective_prio(struct task_struct *task, int newprio);
2d3d891d 22extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task);
8bd75c77
CW
23extern void rt_mutex_adjust_pi(struct task_struct *p);
24static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
25{
26 return tsk->pi_blocked_on != NULL;
27}
f3871408
JD
28extern int rt_mutex_get_effective_policy(int policy, int prio);
29extern int rt_mutex_get_effective_rt_prio(int prio);
8bd75c77
CW
30#else
31static inline int rt_mutex_getprio(struct task_struct *p)
32{
33 return p->normal_prio;
34}
c365c292 35
0782e63b
TG
36static inline int rt_mutex_get_effective_prio(struct task_struct *task,
37 int newprio)
c365c292 38{
0782e63b 39 return newprio;
c365c292
TG
40}
41
2d3d891d
DF
42static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
43{
44 return NULL;
45}
8bd75c77
CW
46# define rt_mutex_adjust_pi(p) do { } while (0)
47static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
48{
49 return false;
50}
f3871408
JD
51static inline int rt_mutex_get_effective_policy(int policy, int prio);
52{
53 return policy;
54}
55static inline int rt_mutex_get_effective_rt_prio(int prio)
56{
57 return task->rt_priority;
58}
8bd75c77
CW
59#endif
60
61extern void normalize_rt_tasks(void);
62
63
bc681593
CW
64/*
65 * default timeslice is 100 msecs (used only for SCHED_RR tasks).
66 * Timeslices get refilled after they expire.
67 */
68#define RR_TIMESLICE (100 * HZ / 1000)
69
8bd75c77 70#endif /* _SCHED_RT_H */
This page took 0.335122 seconds and 5 git commands to generate.