diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-11-30 12:02:52 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-11-30 12:02:52 +0800 |
commit | f83b09c3edc03ebcb59e65d6c37bc1bdb49b8210 (patch) | |
tree | 4617c279cb52c31774284c0bde1ab4fce7efb482 /include/linux/preempt.h | |
parent | c19848defd4890f84d733c14b73dcbc87ea180a4 (diff) | |
parent | eddc563b9850ce692c6040ef0f4575aea2396d33 (diff) |
Merge remote-tracking branch 'rt-stable/v4.4-rt' into linux-linaro-lsk-v4.4-rtlsk-v4.4-17.11-rt
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 1cfb1cb72354..f97c54265904 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -75,18 +75,23 @@ extern int in_serving_softirq(void); /* * Are we doing bottom half or hardware interrupt processing? - * Are we in a softirq context? Interrupt context? - * in_softirq - Are we currently processing softirq or have bh disabled? - * in_serving_softirq - Are we currently processing softirq? + * + * in_irq() - We're in (hard) IRQ context + * in_softirq() - We have BH disabled, or are processing softirqs + * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled + * in_serving_softirq() - We're in softirq context + * in_nmi() - We're in NMI context + * in_task() - We're in task context + * + * Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really + * should not be used in new code. */ #define in_irq() (hardirq_count()) #define in_softirq() (softirq_count()) #define in_interrupt() (irq_count()) - -/* - * Are we in NMI context? - */ -#define in_nmi() (preempt_count() & NMI_MASK) +#define in_nmi() (preempt_count() & NMI_MASK) +#define in_task() (!(preempt_count() & \ + (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) /* * The preempt_count offset after preempt_disable(); |