From 16abfe6b2f93f8db46975d4aa6b5bffadb18b0a9 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 9 Jul 2007 18:51:58 +0200 Subject: [PATCH] --- yaml --- r: 58264 b: refs/heads/master c: 4da1ce6d9c7e2a6d9236bf4dcfd33cf506082794 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/hardirq.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6b1d51c13718..c76666635b46 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f64f61145a38f7039e4f1c0b50dcc3fbe70ec28e +refs/heads/master: 4da1ce6d9c7e2a6d9236bf4dcfd33cf506082794 diff --git a/trunk/include/linux/hardirq.h b/trunk/include/linux/hardirq.h index 7803014f3a11..8d302298a161 100644 --- a/trunk/include/linux/hardirq.h +++ b/trunk/include/linux/hardirq.h @@ -78,6 +78,19 @@ # define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) #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 # define preemptible() (preempt_count() == 0 && !irqs_disabled()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)