diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-12-17 07:16:30 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-17 07:22:45 -0500 |
commit | e1781538cf5c870ab696e9b8f0a5c498d3900f2f (patch) | |
tree | 42027696b4bc241194299b29cef2ae814b087acd /include/linux | |
parent | 464763cf1c6df632dccc8f2f4c7e50163154a2c0 (diff) |
sched: Assert task state bits at build time
Since everybody is lazy and prone to forgetting things, make the
compiler help us a bit.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091217121830.060186433@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 94858df38a87..37543876ddf5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -192,9 +192,13 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
192 | #define TASK_DEAD 64 | 192 | #define TASK_DEAD 64 |
193 | #define TASK_WAKEKILL 128 | 193 | #define TASK_WAKEKILL 128 |
194 | #define TASK_WAKING 256 | 194 | #define TASK_WAKING 256 |
195 | #define TASK_STATE_MAX 512 | ||
195 | 196 | ||
196 | #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" | 197 | #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" |
197 | 198 | ||
199 | extern char ___assert_task_state[1 - 2*!!( | ||
200 | sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; | ||
201 | |||
198 | /* Convenience macros for the sake of set_task_state */ | 202 | /* Convenience macros for the sake of set_task_state */ |
199 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) | 203 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) |
200 | #define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED) | 204 | #define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED) |