blob: 9089a2ae913ddf4d12f10a7bcff209bbd1894400 [file] [log] [blame]
Dario Faggioliaab03e02013-11-28 11:14:43 +01001#ifndef _SCHED_DEADLINE_H
2#define _SCHED_DEADLINE_H
3
4/*
5 * SCHED_DEADLINE tasks has negative priorities, reflecting
6 * the fact that any of them has higher prio than RT and
7 * NORMAL/BATCH tasks.
8 */
9
10#define MAX_DL_PRIO 0
11
12static inline int dl_prio(int prio)
13{
14 if (unlikely(prio < MAX_DL_PRIO))
15 return 1;
16 return 0;
17}
18
19static inline int dl_task(struct task_struct *p)
20{
21 return dl_prio(p->prio);
22}
23
Juri Lelli2726d6c2015-09-02 11:01:34 +010024static inline bool dl_time_before(u64 a, u64 b)
25{
26 return (s64)(a - b) < 0;
27}
28
Dario Faggioliaab03e02013-11-28 11:14:43 +010029#endif /* _SCHED_DEADLINE_H */