Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 1 | #ifndef _LINUX_CPUDL_H |
| 2 | #define _LINUX_CPUDL_H |
| 3 | |
| 4 | #include <linux/sched.h> |
Juri Lelli | 2726d6c | 2015-09-02 11:01:34 +0100 | [diff] [blame] | 5 | #include <linux/sched/deadline.h> |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 6 | |
| 7 | #define IDX_INVALID -1 |
| 8 | |
Peter Zijlstra | 944770a | 2014-05-14 16:13:56 +0200 | [diff] [blame] | 9 | struct cpudl_item { |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 10 | u64 dl; |
| 11 | int cpu; |
Peter Zijlstra | 944770a | 2014-05-14 16:13:56 +0200 | [diff] [blame] | 12 | int idx; |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 13 | }; |
| 14 | |
| 15 | struct cpudl { |
| 16 | raw_spinlock_t lock; |
| 17 | int size; |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 18 | cpumask_var_t free_cpus; |
Peter Zijlstra | 944770a | 2014-05-14 16:13:56 +0200 | [diff] [blame] | 19 | struct cpudl_item *elements; |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | |
| 23 | #ifdef CONFIG_SMP |
| 24 | int cpudl_find(struct cpudl *cp, struct task_struct *p, |
| 25 | struct cpumask *later_mask); |
Tommaso Cucinotta | d8206bb | 2016-08-14 16:27:08 +0200 | [diff] [blame] | 26 | void cpudl_set(struct cpudl *cp, int cpu, u64 dl); |
| 27 | void cpudl_clear(struct cpudl *cp, int cpu); |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 28 | int cpudl_init(struct cpudl *cp); |
Xunlei Pang | 16b2694 | 2015-01-19 04:49:36 +0000 | [diff] [blame] | 29 | void cpudl_set_freecpu(struct cpudl *cp, int cpu); |
| 30 | void cpudl_clear_freecpu(struct cpudl *cp, int cpu); |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 31 | void cpudl_cleanup(struct cpudl *cp); |
Juri Lelli | 6bfd6d7 | 2013-11-07 14:43:47 +0100 | [diff] [blame] | 32 | #endif /* CONFIG_SMP */ |
| 33 | |
| 34 | #endif /* _LINUX_CPUDL_H */ |