deadline.h 514 B

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