Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140700
b: refs/heads/master
c: 375b38b
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt committed Feb 8, 2009
1 parent 3a122c8 commit 035c038
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e6ea1440c67de32d7c89aacf233472dfc3bce82
refs/heads/master: 375b38b4214f29109a393ab762d468054bf52354
15 changes: 15 additions & 0 deletions trunk/include/linux/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
#error PREEMPT_ACTIVE is too low!
#endif

#define NMI_OFFSET (PREEMPT_ACTIVE << 1)

#if NMI_OFFSET >= 0x80000000
#error PREEMPT_ACTIVE too high!
#endif

#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
Expand All @@ -73,6 +79,11 @@
#define in_softirq() (softirq_count())
#define in_interrupt() (irq_count())

/*
* Are we in NMI context?
*/
#define in_nmi() (preempt_count() & NMI_OFFSET)

#if defined(CONFIG_PREEMPT)
# define PREEMPT_INATOMIC_BASE kernel_locked()
# define PREEMPT_CHECK_OFFSET 1
Expand Down Expand Up @@ -167,6 +178,8 @@ extern void irq_exit(void);
#define nmi_enter() \
do { \
ftrace_nmi_enter(); \
BUG_ON(in_nmi()); \
add_preempt_count(NMI_OFFSET); \
lockdep_off(); \
rcu_nmi_enter(); \
__irq_enter(); \
Expand All @@ -177,6 +190,8 @@ extern void irq_exit(void);
__irq_exit(); \
rcu_nmi_exit(); \
lockdep_on(); \
BUG_ON(!in_nmi()); \
sub_preempt_count(NMI_OFFSET); \
ftrace_nmi_exit(); \
} while (0)

Expand Down

0 comments on commit 035c038

Please sign in to comment.