diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-12-06 10:55:25 -0500 |
---|---|---|
committer | Matthew Wilcox <willy@linux.intel.com> | 2007-12-06 17:07:29 -0500 |
commit | 92a1f4bc7af13949d2185449307088cf98b4755d (patch) | |
tree | db5a1a87a0170ae5dcba05228f5e3c1a78612fcf /include/linux | |
parent | 4a6e9e2ce822c9f597b3036887f6cf5fa3a79375 (diff) |
Add macros to replace direct uses of TASK_ flags
With the changes to support TASK_KILLABLE, ->state becomes a bitmask, and
moving these tests to convenience macros will fix all the users.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index ac3d496fbd20..69233c7fe28d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -178,6 +178,22 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
178 | /* in tsk->state again */ | 178 | /* in tsk->state again */ |
179 | #define TASK_DEAD 64 | 179 | #define TASK_DEAD 64 |
180 | 180 | ||
181 | /* Convenience macros for the sake of wake_up */ | ||
182 | #define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE) | ||
183 | #define TASK_ALL (TASK_NORMAL | TASK_STOPPED | TASK_TRACED) | ||
184 | |||
185 | /* get_task_state() */ | ||
186 | #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ | ||
187 | TASK_UNINTERRUPTIBLE | TASK_STOPPED | \ | ||
188 | TASK_TRACED) | ||
189 | |||
190 | #define task_is_traced(task) ((task->state & TASK_TRACED) != 0) | ||
191 | #define task_is_stopped(task) ((task->state & TASK_STOPPED) != 0) | ||
192 | #define task_is_stopped_or_traced(task) \ | ||
193 | ((task->state & (TASK_STOPPED | TASK_TRACED)) != 0) | ||
194 | #define task_contributes_to_load(task) \ | ||
195 | ((task->state & TASK_UNINTERRUPTIBLE) != 0) | ||
196 | |||
181 | #define __set_task_state(tsk, state_value) \ | 197 | #define __set_task_state(tsk, state_value) \ |
182 | do { (tsk)->state = (state_value); } while (0) | 198 | do { (tsk)->state = (state_value); } while (0) |
183 | #define set_task_state(tsk, state_value) \ | 199 | #define set_task_state(tsk, state_value) \ |