blob: 0cb034331cbb80e592da0d52eec8d9ae63d2e6ba [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Dario Faggioliaab03e02013-11-28 11:14:43 +01002
3/*
4 * SCHED_DEADLINE tasks has negative priorities, reflecting
5 * the fact that any of them has higher prio than RT and
6 * NORMAL/BATCH tasks.
7 */
8
9#define MAX_DL_PRIO 0
10
11static inline int dl_prio(int prio)
12{
13 if (unlikely(prio < MAX_DL_PRIO))
14 return 1;
15 return 0;
16}
17
18static inline int dl_task(struct task_struct *p)
19{
20 return dl_prio(p->prio);
21}
22
Juri Lelli2726d6c2015-09-02 11:01:34 +010023static inline bool dl_time_before(u64 a, u64 b)
24{
25 return (s64)(a - b) < 0;
26}