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