1 /* SPDX-License-Identifier: GPL-2.0 */
2 
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 #include <linux/sched.h>
10 
11 #define MAX_DL_PRIO		0
12 
dl_prio(int prio)13 static inline int dl_prio(int prio)
14 {
15 	if (unlikely(prio < MAX_DL_PRIO))
16 		return 1;
17 	return 0;
18 }
19 
dl_task(struct task_struct * p)20 static inline int dl_task(struct task_struct *p)
21 {
22 	return dl_prio(p->prio);
23 }
24 
dl_time_before(u64 a,u64 b)25 static inline bool dl_time_before(u64 a, u64 b)
26 {
27 	return (s64)(a - b) < 0;
28 }
29 
30 #ifdef CONFIG_SMP
31 
32 struct root_domain;
33 extern void dl_add_task_root_domain(struct task_struct *p);
34 extern void dl_clear_root_domain(struct root_domain *rd);
35 
36 #endif /* CONFIG_SMP */
37