deadline.h 558 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _LINUX_SCHED_DEADLINE_H
  2. #define _LINUX_SCHED_DEADLINE_H
  3. #include <linux/sched.h>
  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. #define MAX_DL_PRIO 0
  10. static inline int dl_prio(int prio)
  11. {
  12. if (unlikely(prio < MAX_DL_PRIO))
  13. return 1;
  14. return 0;
  15. }
  16. static inline int dl_task(struct task_struct *p)
  17. {
  18. return dl_prio(p->prio);
  19. }
  20. static inline bool dl_time_before(u64 a, u64 b)
  21. {
  22. return (s64)(a - b) < 0;
  23. }
  24. #endif /* _LINUX_SCHED_DEADLINE_H */