summaryrefslogtreecommitdiff
path: root/kernel/sched_cpupri.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-14 14:11:02 (GMT)
committerIngo Molnar <mingo@elte.hu>2008-07-14 14:11:02 (GMT)
commitd14c8a680ccfdeb5e7b9be4d61162c2b373bd1e8 (patch)
tree38cead29b9b34b9d26b5cfe7b2c2673d6f7ac052 /kernel/sched_cpupri.h
parentd59fdcf2ac501de99c3dfb452af5e254d4342886 (diff)
parent873a6ed6288b6c2c0d2cc84d3b2bf2fab9ba0181 (diff)
downloadlinux-fsl-qoriq-d14c8a680ccfdeb5e7b9be4d61162c2b373bd1e8.tar.xz
Merge branch 'sched/for-linus' into tracing/for-linus
Diffstat (limited to 'kernel/sched_cpupri.h')
-rw-r--r--kernel/sched_cpupri.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/sched_cpupri.h b/kernel/sched_cpupri.h
new file mode 100644
index 0000000..f25811b0
--- /dev/null
+++ b/kernel/sched_cpupri.h
@@ -0,0 +1,36 @@
+#ifndef _LINUX_CPUPRI_H
+#define _LINUX_CPUPRI_H
+
+#include <linux/sched.h>
+
+#define CPUPRI_NR_PRIORITIES (MAX_RT_PRIO + 2)
+#define CPUPRI_NR_PRI_WORDS BITS_TO_LONGS(CPUPRI_NR_PRIORITIES)
+
+#define CPUPRI_INVALID -1
+#define CPUPRI_IDLE 0
+#define CPUPRI_NORMAL 1
+/* values 2-101 are RT priorities 0-99 */
+
+struct cpupri_vec {
+ spinlock_t lock;
+ int count;
+ cpumask_t mask;
+};
+
+struct cpupri {
+ struct cpupri_vec pri_to_cpu[CPUPRI_NR_PRIORITIES];
+ long pri_active[CPUPRI_NR_PRI_WORDS];
+ int cpu_to_pri[NR_CPUS];
+};
+
+#ifdef CONFIG_SMP
+int cpupri_find(struct cpupri *cp,
+ struct task_struct *p, cpumask_t *lowest_mask);
+void cpupri_set(struct cpupri *cp, int cpu, int pri);
+void cpupri_init(struct cpupri *cp);
+#else
+#define cpupri_set(cp, cpu, pri) do { } while (0)
+#define cpupri_init() do { } while (0)
+#endif
+
+#endif /* _LINUX_CPUPRI_H */