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