]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/sched/rt.h
Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into...
[mirror_ubuntu-artful-kernel.git] / include / linux / sched / rt.h
CommitLineData
9ccd27cc
IM
1#ifndef _LINUX_SCHED_RT_H
2#define _LINUX_SCHED_RT_H
8bd75c77 3
9ccd27cc
IM
4#include <linux/sched.h>
5
6struct task_struct;
8bd75c77
CW
7
8static inline int rt_prio(int prio)
9{
10 if (unlikely(prio < MAX_RT_PRIO))
11 return 1;
12 return 0;
13}
14
15static inline int rt_task(struct task_struct *p)
16{
17 return rt_prio(p->prio);
18}
19
20#ifdef CONFIG_RT_MUTEXES
21extern int rt_mutex_getprio(struct task_struct *p);
22extern void rt_mutex_setprio(struct task_struct *p, int prio);
0782e63b 23extern int rt_mutex_get_effective_prio(struct task_struct *task, int newprio);
2d3d891d 24extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task);
8bd75c77
CW
25extern void rt_mutex_adjust_pi(struct task_struct *p);
26static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
27{
28 return tsk->pi_blocked_on != NULL;
29}
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}
51#endif
52
53extern void normalize_rt_tasks(void);
54
55
bc681593
CW
56/*
57 * default timeslice is 100 msecs (used only for SCHED_RR tasks).
58 * Timeslices get refilled after they expire.
59 */
60#define RR_TIMESLICE (100 * HZ / 1000)
61
9ccd27cc 62#endif /* _LINUX_SCHED_RT_H */