summaryrefslogtreecommitdiff
path: root/arch/arm/lib/backtrace.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib/backtrace.S')
-rw-r--r--arch/arm/lib/backtrace.S16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
index b0951d0e8b2c..41c4d3561b8f 100644
--- a/arch/arm/lib/backtrace.S
+++ b/arch/arm/lib/backtrace.S
@@ -28,7 +28,7 @@ ENTRY(__backtrace)
ENTRY(c_backtrace)
-#if !defined(CONFIG_FRAME_POINTER) || !defined(CONFIG_PRINTK)
+#if defined(CONFIG_THUMB2_KERNEL) || !defined(CONFIG_FRAME_POINTER) || !defined(CONFIG_PRINTK)
mov pc, lr
ENDPROC(__backtrace)
ENDPROC(c_backtrace)
@@ -38,7 +38,10 @@ ENDPROC(c_backtrace)
beq no_frame @ we have no stack frames
tst r1, #0x10 @ 26 or 32-bit mode?
- moveq mask, #0xfc000003 @ mask for 26-bit
+ itte eq
+ ARM( moveq mask, #0xfc000003 )
+ THUMB( moveq mask, #0xfc000000 )
+ THUMB( orreq mask, #0x03 )
movne mask, #0 @ mask for 32-bit
1: stmfd sp!, {pc} @ calculate offset of PC stored
@@ -73,6 +76,7 @@ for_each_frame: tst frame, mask @ Check for address exceptions
1003: ldr r2, [sv_pc, #-4] @ if stmfd sp!, {args} exists,
ldr r3, .Ldsi+4 @ adjust saved 'pc' back one
teq r3, r2, lsr #10 @ instruction
+ ite ne
subne r0, sv_pc, #4 @ allow for mov
subeq r0, sv_pc, #8 @ allow for mov + stmia
@@ -84,6 +88,7 @@ for_each_frame: tst frame, mask @ Check for address exceptions
ldr r1, [sv_pc, #-4] @ if stmfd sp!, {args} exists,
ldr r3, .Ldsi+4
teq r3, r1, lsr #10
+ ittt eq
ldreq r0, [frame, #-8] @ get sp
subeq r0, r0, #4 @ point at the last arg
bleq .Ldumpstm @ dump saved registers
@@ -91,6 +96,7 @@ for_each_frame: tst frame, mask @ Check for address exceptions
1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc}
ldr r3, .Ldsi @ instruction exists,
teq r3, r1, lsr #10
+ itt eq
subeq r0, frame, #16
bleq .Ldumpstm @ dump saved registers
@@ -126,10 +132,13 @@ ENDPROC(c_backtrace)
mov reg, #10
mov r7, #0
1: mov r3, #1
- tst instr, r3, lsl reg
+ ARM( tst instr, r3, lsl reg )
+ THUMB( lsl r3, reg )
+ THUMB( tst instr, r3 )
beq 2f
add r7, r7, #1
teq r7, #6
+ itte eq
moveq r7, #1
moveq r1, #'\n'
movne r1, #' '
@@ -140,6 +149,7 @@ ENDPROC(c_backtrace)
2: subs reg, reg, #1
bpl 1b
teq r7, #0
+ itt ne
adrne r0, .Lcr
blne printk
ldmfd sp!, {instr, reg, stack, r7, pc}