Commit 4da1ce6d authored by Ingo Molnar's avatar Ingo Molnar

sched: add in_atomic_preempt_off()

add in_atomic_preempt_off() - debugging helper that will
simplify schedule().
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent f64f6114
...@@ -78,6 +78,19 @@ ...@@ -78,6 +78,19 @@
# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) # define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
#endif #endif
#ifdef CONFIG_PREEMPT
# define PREEMPT_CHECK_OFFSET 1
#else
# define PREEMPT_CHECK_OFFSET 0
#endif
/*
* Check whether we were atomic before we did preempt_disable():
* (used by the scheduler)
*/
#define in_atomic_preempt_off() \
((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
#ifdef CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
# define preemptible() (preempt_count() == 0 && !irqs_disabled()) # define preemptible() (preempt_count() == 0 && !irqs_disabled())
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment