diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2013-03-21 17:49:32 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2013-04-08 11:39:22 -0400 |
| commit | ee761f629d598579594d7e1eb8c552f3c5f71e4d (patch) | |
| tree | c5661623f8420b41efc3970f1cab23e6db581f68 /include | |
| parent | 6546327ad187238ac63d2429701b32becb096fd8 (diff) | |
arch: Consolidate tsk_is_polling()
Move it to a common place. Preparatory patch for implementing
set/clear for the idle need_resched poll implementation.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130321215233.446034505@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sched.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index d35d2b6ddbfb..6709a5813f27 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -2622,6 +2622,26 @@ static inline int spin_needbreak(spinlock_t *lock) | |||
| 2622 | } | 2622 | } |
| 2623 | 2623 | ||
| 2624 | /* | 2624 | /* |
| 2625 | * Idle thread specific functions to determine the need_resched | ||
| 2626 | * polling state. We have two versions, one based on TS_POLLING in | ||
| 2627 | * thread_info.status and one based on TIF_POLLING_NRFLAG in | ||
| 2628 | * thread_info.flags | ||
| 2629 | */ | ||
| 2630 | #ifdef TS_POLLING | ||
| 2631 | static inline int tsk_is_polling(struct task_struct *p) | ||
| 2632 | { | ||
| 2633 | return task_thread_info(p)->status & TS_POLLING; | ||
| 2634 | } | ||
| 2635 | #elif defined(TIF_POLLING_NRFLAG) | ||
| 2636 | static inline int tsk_is_polling(struct task_struct *p) | ||
| 2637 | { | ||
| 2638 | return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); | ||
| 2639 | } | ||
| 2640 | #else | ||
| 2641 | static inline int tsk_is_polling(struct task_struct *p) { return 0; } | ||
| 2642 | #endif | ||
| 2643 | |||
| 2644 | /* | ||
| 2625 | * Thread group CPU time accounting. | 2645 | * Thread group CPU time accounting. |
| 2626 | */ | 2646 | */ |
| 2627 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); | 2647 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); |
