aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hardirq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r--include/linux/hardirq.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 49829988bfa0..897f723bd222 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -72,6 +72,13 @@
72#define in_softirq() (softirq_count()) 72#define in_softirq() (softirq_count())
73#define in_interrupt() (irq_count()) 73#define in_interrupt() (irq_count())
74 74
75/*
76 * Are we running in atomic context? WARNING: this macro cannot
77 * always detect atomic context; in particular, it cannot know about
78 * held spinlocks in non-preemptible kernels. Thus it should not be
79 * used in the general case to determine whether sleeping is possible.
80 * Do not use in_atomic() in driver code.
81 */
75#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) 82#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
76 83
77#ifdef CONFIG_PREEMPT 84#ifdef CONFIG_PREEMPT