xref: /openbmc/linux/kernel/sched/cpudeadline.h (revision 68198dca)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_CPUDL_H
3 #define _LINUX_CPUDL_H
4 
5 #include <linux/sched.h>
6 #include <linux/sched/deadline.h>
7 
8 #define IDX_INVALID     -1
9 
10 struct cpudl_item {
11 	u64 dl;
12 	int cpu;
13 	int idx;
14 };
15 
16 struct cpudl {
17 	raw_spinlock_t lock;
18 	int size;
19 	cpumask_var_t free_cpus;
20 	struct cpudl_item *elements;
21 };
22 
23 
24 #ifdef CONFIG_SMP
25 int cpudl_find(struct cpudl *cp, struct task_struct *p,
26 	       struct cpumask *later_mask);
27 void cpudl_set(struct cpudl *cp, int cpu, u64 dl);
28 void cpudl_clear(struct cpudl *cp, int cpu);
29 int cpudl_init(struct cpudl *cp);
30 void cpudl_set_freecpu(struct cpudl *cp, int cpu);
31 void cpudl_clear_freecpu(struct cpudl *cp, int cpu);
32 void cpudl_cleanup(struct cpudl *cp);
33 #endif /* CONFIG_SMP */
34 
35 #endif /* _LINUX_CPUDL_H */
36