diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6709a5813f27..21fe9a142e51 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2632,13 +2632,34 @@ static inline int tsk_is_polling(struct task_struct *p) | |||
2632 | { | 2632 | { |
2633 | return task_thread_info(p)->status & TS_POLLING; | 2633 | return task_thread_info(p)->status & TS_POLLING; |
2634 | } | 2634 | } |
2635 | static inline void current_set_polling(void) | ||
2636 | { | ||
2637 | current_thread_info()->status |= TS_POLLING; | ||
2638 | } | ||
2639 | |||
2640 | static inline void current_clr_polling(void) | ||
2641 | { | ||
2642 | current_thread_info()->status &= ~TS_POLLING; | ||
2643 | smp_mb__after_clear_bit(); | ||
2644 | } | ||
2635 | #elif defined(TIF_POLLING_NRFLAG) | 2645 | #elif defined(TIF_POLLING_NRFLAG) |
2636 | static inline int tsk_is_polling(struct task_struct *p) | 2646 | static inline int tsk_is_polling(struct task_struct *p) |
2637 | { | 2647 | { |
2638 | return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); | 2648 | return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); |
2639 | } | 2649 | } |
2650 | static inline void current_set_polling(void) | ||
2651 | { | ||
2652 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
2653 | } | ||
2654 | |||
2655 | static inline void current_clr_polling(void) | ||
2656 | { | ||
2657 | clear_thread_flag(TIF_POLLING_NRFLAG); | ||
2658 | } | ||
2640 | #else | 2659 | #else |
2641 | static inline int tsk_is_polling(struct task_struct *p) { return 0; } | 2660 | static inline int tsk_is_polling(struct task_struct *p) { return 0; } |
2661 | static inline void current_set_polling(void) { } | ||
2662 | static inline void current_clr_polling(void) { } | ||
2642 | #endif | 2663 | #endif |
2643 | 2664 | ||
2644 | /* | 2665 | /* |