blob: 7dc20a3232e726b3b5f91389395f49d7525120a5 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Gregory Haskins6e0534f2008-05-12 21:21:01 +02002
Thomas Gleixnere539d8f2008-06-05 10:28:00 +02003#define CPUPRI_NR_PRIORITIES (MAX_RT_PRIO + 2)
Gregory Haskins6e0534f2008-05-12 21:21:01 +02004
Ingo Molnar97fb7a02018-03-03 14:01:12 +01005#define CPUPRI_INVALID -1
6#define CPUPRI_IDLE 0
7#define CPUPRI_NORMAL 1
Gregory Haskins6e0534f2008-05-12 21:21:01 +02008/* values 2-101 are RT priorities 0-99 */
9
10struct cpupri_vec {
Ingo Molnar97fb7a02018-03-03 14:01:12 +010011 atomic_t count;
12 cpumask_var_t mask;
Gregory Haskins6e0534f2008-05-12 21:21:01 +020013};
14
15struct cpupri {
Ingo Molnar97fb7a02018-03-03 14:01:12 +010016 struct cpupri_vec pri_to_cpu[CPUPRI_NR_PRIORITIES];
17 int *cpu_to_pri;
Gregory Haskins6e0534f2008-05-12 21:21:01 +020018};
19
20#ifdef CONFIG_SMP
Ingo Molnar97fb7a02018-03-03 14:01:12 +010021int cpupri_find(struct cpupri *cp, struct task_struct *p, struct cpumask *lowest_mask);
Gregory Haskins6e0534f2008-05-12 21:21:01 +020022void cpupri_set(struct cpupri *cp, int cpu, int pri);
Ingo Molnar97fb7a02018-03-03 14:01:12 +010023int cpupri_init(struct cpupri *cp);
Rusty Russell68e74562008-11-25 02:35:13 +103024void cpupri_cleanup(struct cpupri *cp);
Gregory Haskins6e0534f2008-05-12 21:21:01 +020025#endif