diff options
Diffstat (limited to 'include/linux/preempt.h')
-rw-r--r-- | include/linux/preempt.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 75e4e30677f1..7eeceac52dea 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -65,19 +65,24 @@ | |||
65 | 65 | ||
66 | /* | 66 | /* |
67 | * Are we doing bottom half or hardware interrupt processing? | 67 | * Are we doing bottom half or hardware interrupt processing? |
68 | * Are we in a softirq context? Interrupt context? | 68 | * |
69 | * in_softirq - Are we currently processing softirq or have bh disabled? | 69 | * in_irq() - We're in (hard) IRQ context |
70 | * in_serving_softirq - Are we currently processing softirq? | 70 | * in_softirq() - We have BH disabled, or are processing softirqs |
71 | * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled | ||
72 | * in_serving_softirq() - We're in softirq context | ||
73 | * in_nmi() - We're in NMI context | ||
74 | * in_task() - We're in task context | ||
75 | * | ||
76 | * Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really | ||
77 | * should not be used in new code. | ||
71 | */ | 78 | */ |
72 | #define in_irq() (hardirq_count()) | 79 | #define in_irq() (hardirq_count()) |
73 | #define in_softirq() (softirq_count()) | 80 | #define in_softirq() (softirq_count()) |
74 | #define in_interrupt() (irq_count()) | 81 | #define in_interrupt() (irq_count()) |
75 | #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) | 82 | #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) |
76 | 83 | #define in_nmi() (preempt_count() & NMI_MASK) | |
77 | /* | 84 | #define in_task() (!(preempt_count() & \ |
78 | * Are we in NMI context? | 85 | (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) |
79 | */ | ||
80 | #define in_nmi() (preempt_count() & NMI_MASK) | ||
81 | 86 | ||
82 | /* | 87 | /* |
83 | * The preempt_count offset after preempt_disable(); | 88 | * The preempt_count offset after preempt_disable(); |