diff options
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r-- | include/linux/hardirq.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 114ae583cca9..b1d4332b5cf0 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -86,9 +86,6 @@ extern void synchronize_irq(unsigned int irq); | |||
86 | # define synchronize_irq(irq) barrier() | 86 | # define synchronize_irq(irq) barrier() |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | #define nmi_enter() irq_enter() | ||
90 | #define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET) | ||
91 | |||
92 | struct task_struct; | 89 | struct task_struct; |
93 | 90 | ||
94 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 91 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING |
@@ -97,12 +94,35 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
97 | } | 94 | } |
98 | #endif | 95 | #endif |
99 | 96 | ||
97 | /* | ||
98 | * It is safe to do non-atomic ops on ->hardirq_context, | ||
99 | * because NMI handlers may not preempt and the ops are | ||
100 | * always balanced, so the interrupted value of ->hardirq_context | ||
101 | * will always be restored. | ||
102 | */ | ||
100 | #define irq_enter() \ | 103 | #define irq_enter() \ |
101 | do { \ | 104 | do { \ |
102 | account_system_vtime(current); \ | 105 | account_system_vtime(current); \ |
103 | add_preempt_count(HARDIRQ_OFFSET); \ | 106 | add_preempt_count(HARDIRQ_OFFSET); \ |
107 | trace_hardirq_enter(); \ | ||
108 | } while (0) | ||
109 | |||
110 | /* | ||
111 | * Exit irq context without processing softirqs: | ||
112 | */ | ||
113 | #define __irq_exit() \ | ||
114 | do { \ | ||
115 | trace_hardirq_exit(); \ | ||
116 | account_system_vtime(current); \ | ||
117 | sub_preempt_count(HARDIRQ_OFFSET); \ | ||
104 | } while (0) | 118 | } while (0) |
105 | 119 | ||
120 | /* | ||
121 | * Exit irq context and process softirqs if needed: | ||
122 | */ | ||
106 | extern void irq_exit(void); | 123 | extern void irq_exit(void); |
107 | 124 | ||
125 | #define nmi_enter() irq_enter() | ||
126 | #define nmi_exit() __irq_exit() | ||
127 | |||
108 | #endif /* LINUX_HARDIRQ_H */ | 128 | #endif /* LINUX_HARDIRQ_H */ |