cpupri.h 713 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_CPUPRI_H
  3. #define _LINUX_CPUPRI_H
  4. #include <linux/sched.h>
  5. #define CPUPRI_NR_PRIORITIES (MAX_RT_PRIO + 2)
  6. #define CPUPRI_INVALID -1
  7. #define CPUPRI_IDLE 0
  8. #define CPUPRI_NORMAL 1
  9. /* values 2-101 are RT priorities 0-99 */
  10. struct cpupri_vec {
  11. atomic_t count;
  12. cpumask_var_t mask;
  13. };
  14. struct cpupri {
  15. struct cpupri_vec pri_to_cpu[CPUPRI_NR_PRIORITIES];
  16. int *cpu_to_pri;
  17. };
  18. #ifdef CONFIG_SMP
  19. int cpupri_find(struct cpupri *cp,
  20. struct task_struct *p, struct cpumask *lowest_mask);
  21. void cpupri_set(struct cpupri *cp, int cpu, int pri);
  22. int cpupri_init(struct cpupri *cp);
  23. void cpupri_cleanup(struct cpupri *cp);
  24. #endif
  25. #endif /* _LINUX_CPUPRI_H */