diff options
-rw-r--r-- | include/linux/hardirq.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 7803014f3a11..8d302298a161 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -79,6 +79,19 @@ | |||
79 | #endif | 79 | #endif |
80 | 80 | ||
81 | #ifdef CONFIG_PREEMPT | 81 | #ifdef CONFIG_PREEMPT |
82 | # define PREEMPT_CHECK_OFFSET 1 | ||
83 | #else | ||
84 | # define PREEMPT_CHECK_OFFSET 0 | ||
85 | #endif | ||
86 | |||
87 | /* | ||
88 | * Check whether we were atomic before we did preempt_disable(): | ||
89 | * (used by the scheduler) | ||
90 | */ | ||
91 | #define in_atomic_preempt_off() \ | ||
92 | ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) | ||
93 | |||
94 | #ifdef CONFIG_PREEMPT | ||
82 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 95 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
83 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | 96 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) |
84 | #else | 97 | #else |