blob: 538c9796ad4a0b085e4c4284683fe7856b420153 [file] [log] [blame]
Juri Lelli6bfd6d72013-11-07 14:43:47 +01001#ifndef _LINUX_CPUDL_H
2#define _LINUX_CPUDL_H
3
4#include <linux/sched.h>
5
6#define IDX_INVALID -1
7
Peter Zijlstra944770a2014-05-14 16:13:56 +02008struct cpudl_item {
Juri Lelli6bfd6d72013-11-07 14:43:47 +01009 u64 dl;
10 int cpu;
Peter Zijlstra944770a2014-05-14 16:13:56 +020011 int idx;
Juri Lelli6bfd6d72013-11-07 14:43:47 +010012};
13
14struct cpudl {
15 raw_spinlock_t lock;
16 int size;
Juri Lelli6bfd6d72013-11-07 14:43:47 +010017 cpumask_var_t free_cpus;
Peter Zijlstra944770a2014-05-14 16:13:56 +020018 struct cpudl_item *elements;
Juri Lelli6bfd6d72013-11-07 14:43:47 +010019};
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 */