Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92a1f4bc7af13949d2185449307088cf98b4755d
Commit:     92a1f4bc7af13949d2185449307088cf98b4755d
Parent:     4a6e9e2ce822c9f597b3036887f6cf5fa3a79375
Author:     Matthew Wilcox <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 6 10:55:25 2007 -0500
Committer:  Matthew Wilcox <[EMAIL PROTECTED]>
CommitDate: Thu Dec 6 17:07:29 2007 -0500

    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 <[EMAIL PROTECTED]>
---
 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 ac3d496..69233c7 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)
 /* in tsk->state again */
 #define TASK_DEAD              64
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL            (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL               (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT            (TASK_RUNNING | TASK_INTERRUPTIBLE | \
+                                TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+                                TASK_TRACED)
+
+#define task_is_traced(task)   ((task->state & TASK_TRACED) != 0)
+#define task_is_stopped(task)  ((task->state & TASK_STOPPED) != 0)
+#define task_is_stopped_or_traced(task)        \
+                       ((task->state & (TASK_STOPPED | TASK_TRACED)) != 0)
+#define task_contributes_to_load(task) \
+                               ((task->state & TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value)             \
        do { (tsk)->state = (state_value); } while (0)
 #define set_task_state(tsk, state_value)               \
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to