aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hardirq.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-07-03 03:24:42 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-03 18:27:03 -0400
commitde30a2b355ea85350ca2f58f3b9bf4e5bc007986 (patch)
tree0bef670aff65614b3c78ca13b20307355b8221d5 /include/linux/hardirq.h
parent5bdc9b447c0076f494a56fdcd93ee8c5e78a2afd (diff)
[PATCH] lockdep: irqtrace subsystem, core
Accurate hard-IRQ-flags and softirq-flags state tracing. This allows us to attach extra functionality to IRQ flags on/off events (such as trace-on/off). Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r--include/linux/hardirq.h26
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
92struct task_struct; 89struct 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 */
106extern void irq_exit(void); 123extern 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 */