cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

deadline.h (678B)


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