X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fhardirq.h;h=8d302298a161941ce40c6ed47411627d5f0229f8;hb=2e824ad59f678a1ff920144fda9b7dd0815fc010;hp=7803014f3a11bae4f353e7b042c0e1835997c7be;hpb=b0138a6cb7923a997d278b47c176778534d1095b;p=linux-2.6 diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 7803014f3a..8d302298a1 100644 --- a/include/linux/hardirq.h +++ b/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)