| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 
|---|---|
| 2 | #include <linux/types.h> | 
| 3 | #include <linux/spinlock.h> | 
| 4 | |
| 5 | #define IDX_INVALID -1 | 
| 6 | |
| 7 | struct cpudl_item { | 
| 8 | u64 dl; | 
| 9 | int cpu; | 
| 10 | int idx; | 
| 11 | }; | 
| 12 | |
| 13 | struct cpudl { | 
| 14 | raw_spinlock_t lock; | 
| 15 | int size; | 
| 16 | cpumask_var_t free_cpus; | 
| 17 | struct cpudl_item *elements; | 
| 18 | }; | 
| 19 | |
| 20 | int cpudl_find(struct cpudl *cp, struct task_struct *p, struct cpumask *later_mask); | 
| 21 | void cpudl_set(struct cpudl *cp, int cpu, u64 dl); | 
| 22 | void cpudl_clear(struct cpudl *cp, int cpu); | 
| 23 | int cpudl_init(struct cpudl *cp); | 
| 24 | void cpudl_set_freecpu(struct cpudl *cp, int cpu); | 
| 25 | void cpudl_clear_freecpu(struct cpudl *cp, int cpu); | 
| 26 | void cpudl_cleanup(struct cpudl *cp); | 
| 27 | 
