aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv/kernel/break.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/frv/kernel/break.S')
-rw-r--r--arch/frv/kernel/break.S77
1 files changed, 73 insertions, 4 deletions
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index 33233dc23e29..687c48d62dde 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -200,12 +200,20 @@ __break_step:
200 movsg bpcsr,gr2 200 movsg bpcsr,gr2
201 sethi.p %hi(__entry_kernel_external_interrupt),gr3 201 sethi.p %hi(__entry_kernel_external_interrupt),gr3
202 setlo %lo(__entry_kernel_external_interrupt),gr3 202 setlo %lo(__entry_kernel_external_interrupt),gr3
203 subcc gr2,gr3,gr0,icc0 203 subcc.p gr2,gr3,gr0,icc0
204 sethi %hi(__entry_uspace_external_interrupt),gr3
205 setlo.p %lo(__entry_uspace_external_interrupt),gr3
204 beq icc0,#2,__break_step_kernel_external_interrupt 206 beq icc0,#2,__break_step_kernel_external_interrupt
205 sethi.p %hi(__entry_uspace_external_interrupt),gr3 207 subcc.p gr2,gr3,gr0,icc0
206 setlo %lo(__entry_uspace_external_interrupt),gr3 208 sethi %hi(__entry_kernel_external_interrupt_virtually_disabled),gr3
207 subcc gr2,gr3,gr0,icc0 209 setlo.p %lo(__entry_kernel_external_interrupt_virtually_disabled),gr3
208 beq icc0,#2,__break_step_uspace_external_interrupt 210 beq icc0,#2,__break_step_uspace_external_interrupt
211 subcc.p gr2,gr3,gr0,icc0
212 sethi %hi(__entry_kernel_external_interrupt_virtual_reenable),gr3
213 setlo.p %lo(__entry_kernel_external_interrupt_virtual_reenable),gr3
214 beq icc0,#2,__break_step_kernel_external_interrupt_virtually_disabled
215 subcc gr2,gr3,gr0,icc0
216 beq icc0,#2,__break_step_kernel_external_interrupt_virtual_reenable
209 217
210 LEDS 0x2007,gr2 218 LEDS 0x2007,gr2
211 219
@@ -254,6 +262,9 @@ __break_step_kernel_softprog_interrupt:
254# step through an external interrupt from kernel mode 262# step through an external interrupt from kernel mode
255 .globl __break_step_kernel_external_interrupt 263 .globl __break_step_kernel_external_interrupt
256__break_step_kernel_external_interrupt: 264__break_step_kernel_external_interrupt:
265 # deal with virtual interrupt disablement
266 beq icc2,#0,__break_step_kernel_external_interrupt_virtually_disabled
267
257 sethi.p %hi(__entry_kernel_external_interrupt_reentry),gr3 268 sethi.p %hi(__entry_kernel_external_interrupt_reentry),gr3
258 setlo %lo(__entry_kernel_external_interrupt_reentry),gr3 269 setlo %lo(__entry_kernel_external_interrupt_reentry),gr3
259 270
@@ -294,6 +305,64 @@ __break_return_as_kernel_prologue:
294#endif 305#endif
295 rett #1 306 rett #1
296 307
308# we single-stepped into an interrupt handler whilst interrupts were merely virtually disabled
309# need to really disable interrupts, set flag, fix up and return
310__break_step_kernel_external_interrupt_virtually_disabled:
311 movsg psr,gr2
312 andi gr2,#~PSR_PIL,gr2
313 ori gr2,#PSR_PIL_14,gr2 /* debugging interrupts only */
314 movgs gr2,psr
315
316 ldi @(gr31,#REG_CCR),gr3
317 movgs gr3,ccr
318 subcc.p gr0,gr0,gr0,icc2 /* leave Z set, clear C */
319
320 # exceptions must've been enabled and we must've been in supervisor mode
321 setlos BPSR_BET|BPSR_BS,gr3
322 movgs gr3,bpsr
323
324 # return to where the interrupt happened
325 movsg pcsr,gr2
326 movgs gr2,bpcsr
327
328 lddi.p @(gr31,#REG_GR(2)),gr2
329
330 xor gr31,gr31,gr31
331 movgs gr0,brr
332#ifdef CONFIG_MMU
333 movsg scr3,gr31
334#endif
335 rett #1
336
337# we stepped through into the virtual interrupt reenablement trap
338#
339# we also want to single step anyway, but after fixing up so that we get an event on the
340# instruction after the broken-into exception returns
341 .globl __break_step_kernel_external_interrupt_virtual_reenable
342__break_step_kernel_external_interrupt_virtual_reenable:
343 movsg psr,gr2
344 andi gr2,#~PSR_PIL,gr2
345 movgs gr2,psr
346
347 ldi @(gr31,#REG_CCR),gr3
348 movgs gr3,ccr
349 subicc gr0,#1,gr0,icc2 /* clear Z, set C */
350
351 # save the adjusted ICC2
352 movsg ccr,gr3
353 sti gr3,@(gr31,#REG_CCR)
354
355 # exceptions must've been enabled and we must've been in supervisor mode
356 setlos BPSR_BET|BPSR_BS,gr3
357 movgs gr3,bpsr
358
359 # return to where the trap happened
360 movsg pcsr,gr2
361 movgs gr2,bpcsr
362
363 # and then process the single step
364 bra __break_continue
365
297# step through an internal exception from uspace mode 366# step through an internal exception from uspace mode
298 .globl __break_step_uspace_softprog_interrupt 367 .globl __break_step_uspace_softprog_interrupt
299__break_step_uspace_softprog_interrupt: 368__break_step_uspace_softprog_interrupt: