aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/entry-common.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/entry-common.S')
-rw-r--r--arch/sh/kernel/entry-common.S64
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
101ENTRY(exception_error) 101ENTRY(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
1101: .long break_point_trap_software 1151: .long break_point_trap_software
1112: .long do_exception_error 1162: .long do_exception_error
117#ifdef CONFIG_TRACE_IRQFLAGS
1183: .long trace_hardirqs_on
119#endif
112 120
113 .align 2 121 .align 2
114ret_from_exception: 122ret_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
116ENTRY(ret_from_irq) 129ENTRY(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
156noresched: 180noresched:
157 bra __restore_all 181 bra __restore_all
158 nop 182 nop
@@ -160,11 +184,20 @@ noresched:
160 .align 2 184 .align 2
1611: .long PREEMPT_ACTIVE 1851: .long PREEMPT_ACTIVE
1622: .long schedule 1862: .long schedule
187#ifdef CONFIG_TRACE_IRQFLAGS
1883: .long trace_hardirqs_on
1894: .long trace_hardirqs_off
190#endif
163#endif 191#endif
164 192
165ENTRY(resume_userspace) 193ENTRY(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:
2211: .long schedule 2591: .long schedule
2222: .long do_notify_resume 2602: .long do_notify_resume
2233: .long restore_all 2613: .long restore_all
262#ifdef CONFIG_TRACE_IRQFLAGS
2634: .long trace_hardirqs_on
2645: .long trace_hardirqs_off
265#endif
224 266
225 .align 2 267 .align 2
226syscall_exit_work: 268syscall_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 !
356syscall_exit: 409syscall_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:
3692: .long NR_syscalls 4272: .long NR_syscalls
3703: .long sys_call_table 4283: .long sys_call_table
3714: .long do_syscall_trace 4294: .long do_syscall_trace
430#ifdef CONFIG_TRACE_IRQFLAGS
4315: .long trace_hardirqs_on
4326: .long trace_hardirqs_off
433#endif