diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-12-04 04:17:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-05 20:45:40 -0500 |
commit | afbfb52e47273a440df33274452c603e8c332de2 (patch) | |
tree | 041dc70061a67e787b362959298e093830b4b4d7 /arch/sh/kernel/entry-common.S | |
parent | c03c69610bfa728805deceeb624ee4268c722a5a (diff) |
sh: stacktrace/lockdep/irqflags tracing support.
Wire up all of the essentials for lockdep..
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/entry-common.S')
-rw-r--r-- | arch/sh/kernel/entry-common.S | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 8f96d21fcb1c..29136a35d7c7 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -100,6 +100,11 @@ debug_trap: | |||
100 | .align 2 | 100 | .align 2 |
101 | ENTRY(exception_error) | 101 | ENTRY(exception_error) |
102 | ! | 102 | ! |
103 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
104 | mov.l 3f, r0 | ||
105 | jsr @r0 | ||
106 | nop | ||
107 | #endif | ||
103 | sti | 108 | sti |
104 | mov.l 2f, r0 | 109 | mov.l 2f, r0 |
105 | jmp @r0 | 110 | jmp @r0 |
@@ -109,10 +114,18 @@ ENTRY(exception_error) | |||
109 | .align 2 | 114 | .align 2 |
110 | 1: .long break_point_trap_software | 115 | 1: .long break_point_trap_software |
111 | 2: .long do_exception_error | 116 | 2: .long do_exception_error |
117 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
118 | 3: .long trace_hardirqs_on | ||
119 | #endif | ||
112 | 120 | ||
113 | .align 2 | 121 | .align 2 |
114 | ret_from_exception: | 122 | ret_from_exception: |
115 | preempt_stop() | 123 | preempt_stop() |
124 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
125 | mov.l 4f, r0 | ||
126 | jsr @r0 | ||
127 | nop | ||
128 | #endif | ||
116 | ENTRY(ret_from_irq) | 129 | ENTRY(ret_from_irq) |
117 | ! | 130 | ! |
118 | mov #OFF_SR, r0 | 131 | mov #OFF_SR, r0 |
@@ -143,6 +156,11 @@ need_resched: | |||
143 | mov.l 1f, r0 | 156 | mov.l 1f, r0 |
144 | mov.l r0, @(TI_PRE_COUNT,r8) | 157 | mov.l r0, @(TI_PRE_COUNT,r8) |
145 | 158 | ||
159 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
160 | mov.l 3f, r0 | ||
161 | jsr @r0 | ||
162 | nop | ||
163 | #endif | ||
146 | sti | 164 | sti |
147 | mov.l 2f, r0 | 165 | mov.l 2f, r0 |
148 | jsr @r0 | 166 | jsr @r0 |
@@ -150,9 +168,15 @@ need_resched: | |||
150 | mov #0, r0 | 168 | mov #0, r0 |
151 | mov.l r0, @(TI_PRE_COUNT,r8) | 169 | mov.l r0, @(TI_PRE_COUNT,r8) |
152 | cli | 170 | cli |
171 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
172 | mov.l 4f, r0 | ||
173 | jsr @r0 | ||
174 | nop | ||
175 | #endif | ||
153 | 176 | ||
154 | bra need_resched | 177 | bra need_resched |
155 | nop | 178 | nop |
179 | |||
156 | noresched: | 180 | noresched: |
157 | bra __restore_all | 181 | bra __restore_all |
158 | nop | 182 | nop |
@@ -160,11 +184,20 @@ noresched: | |||
160 | .align 2 | 184 | .align 2 |
161 | 1: .long PREEMPT_ACTIVE | 185 | 1: .long PREEMPT_ACTIVE |
162 | 2: .long schedule | 186 | 2: .long schedule |
187 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
188 | 3: .long trace_hardirqs_on | ||
189 | 4: .long trace_hardirqs_off | ||
190 | #endif | ||
163 | #endif | 191 | #endif |
164 | 192 | ||
165 | ENTRY(resume_userspace) | 193 | ENTRY(resume_userspace) |
166 | ! r8: current_thread_info | 194 | ! r8: current_thread_info |
167 | cli | 195 | cli |
196 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
197 | mov.l 5f, r0 | ||
198 | jsr @r0 | ||
199 | nop | ||
200 | #endif | ||
168 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags | 201 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags |
169 | tst #_TIF_WORK_MASK, r0 | 202 | tst #_TIF_WORK_MASK, r0 |
170 | bt/s __restore_all | 203 | bt/s __restore_all |
@@ -210,6 +243,11 @@ work_resched: | |||
210 | jsr @r1 ! schedule | 243 | jsr @r1 ! schedule |
211 | nop | 244 | nop |
212 | cli | 245 | cli |
246 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
247 | mov.l 5f, r0 | ||
248 | jsr @r0 | ||
249 | nop | ||
250 | #endif | ||
213 | ! | 251 | ! |
214 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags | 252 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags |
215 | tst #_TIF_WORK_MASK, r0 | 253 | tst #_TIF_WORK_MASK, r0 |
@@ -221,6 +259,10 @@ work_resched: | |||
221 | 1: .long schedule | 259 | 1: .long schedule |
222 | 2: .long do_notify_resume | 260 | 2: .long do_notify_resume |
223 | 3: .long restore_all | 261 | 3: .long restore_all |
262 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
263 | 4: .long trace_hardirqs_on | ||
264 | 5: .long trace_hardirqs_off | ||
265 | #endif | ||
224 | 266 | ||
225 | .align 2 | 267 | .align 2 |
226 | syscall_exit_work: | 268 | syscall_exit_work: |
@@ -229,6 +271,11 @@ syscall_exit_work: | |||
229 | tst #_TIF_SYSCALL_TRACE, r0 | 271 | tst #_TIF_SYSCALL_TRACE, r0 |
230 | bt/s work_pending | 272 | bt/s work_pending |
231 | tst #_TIF_NEED_RESCHED, r0 | 273 | tst #_TIF_NEED_RESCHED, r0 |
274 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
275 | mov.l 5f, r0 | ||
276 | jsr @r0 | ||
277 | nop | ||
278 | #endif | ||
232 | sti | 279 | sti |
233 | ! XXX setup arguments... | 280 | ! XXX setup arguments... |
234 | mov.l 4f, r0 ! do_syscall_trace | 281 | mov.l 4f, r0 ! do_syscall_trace |
@@ -265,7 +312,7 @@ syscall_trace_entry: | |||
265 | mov.l r0, @(OFF_R0,r15) ! Return value | 312 | mov.l r0, @(OFF_R0,r15) ! Return value |
266 | 313 | ||
267 | __restore_all: | 314 | __restore_all: |
268 | mov.l 1f,r0 | 315 | mov.l 1f, r0 |
269 | jmp @r0 | 316 | jmp @r0 |
270 | nop | 317 | nop |
271 | 318 | ||
@@ -331,7 +378,13 @@ ENTRY(system_call) | |||
331 | mov #OFF_TRA, r9 | 378 | mov #OFF_TRA, r9 |
332 | add r15, r9 | 379 | add r15, r9 |
333 | mov.l r8, @r9 ! set TRA value to tra | 380 | mov.l r8, @r9 ! set TRA value to tra |
381 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
382 | mov.l 5f, r10 | ||
383 | jsr @r10 | ||
384 | nop | ||
385 | #endif | ||
334 | sti | 386 | sti |
387 | |||
335 | ! | 388 | ! |
336 | get_current_thread_info r8, r10 | 389 | get_current_thread_info r8, r10 |
337 | mov.l @(TI_FLAGS,r8), r8 | 390 | mov.l @(TI_FLAGS,r8), r8 |
@@ -355,6 +408,11 @@ syscall_call: | |||
355 | ! | 408 | ! |
356 | syscall_exit: | 409 | syscall_exit: |
357 | cli | 410 | cli |
411 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
412 | mov.l 6f, r0 | ||
413 | jsr @r0 | ||
414 | nop | ||
415 | #endif | ||
358 | ! | 416 | ! |
359 | get_current_thread_info r8, r0 | 417 | get_current_thread_info r8, r0 |
360 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags | 418 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags |
@@ -369,3 +427,7 @@ syscall_exit: | |||
369 | 2: .long NR_syscalls | 427 | 2: .long NR_syscalls |
370 | 3: .long sys_call_table | 428 | 3: .long sys_call_table |
371 | 4: .long do_syscall_trace | 429 | 4: .long do_syscall_trace |
430 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
431 | 5: .long trace_hardirqs_on | ||
432 | 6: .long trace_hardirqs_off | ||
433 | #endif | ||