aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorBernd Schmidt <bernds_cb1@t-online.de>2008-04-22 19:17:34 -0400
committerBryan Wu <cooloney@kernel.org>2008-04-22 19:17:34 -0400
commit2a0c4fdb6602ea066380aaf71ff7bb2f61ffeee8 (patch)
treeb77ed1db44e1d0948ac2ab8414066e365da21ddd /arch/blackfin
parentdbfe44f02b6855efb5a596e942ec2fd96d592f60 (diff)
[Blackfin] arch: fix bug - when using trace buffer with CONFIG_MPU enabled.
There were a couple of problems with the way the trace buffer state is saved/restored in assembly. The DEBUG_HWTRACE_SAVE/RESTORE macros save a value to the stack, which is not immediately obvious; the CPLB exception code needed changes to load the correct value of the stack pointer. The other problem is that the SAVE/RESTORE macros weren't pushing and popping the value downwards on the stack, but rather moving it _upwards_, which is of course completely broken. We also need to make sure there's a matching DEBUG_HWTRACE_RESTORE in the error case of the CPLB handler. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-common/entry.S7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index cee54cebbc65..a504c65d9990 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -121,10 +121,14 @@ ENTRY(_ex_icplb_miss)
121 (R7:6,P5:4) = [sp++]; 121 (R7:6,P5:4) = [sp++];
122 ASTAT = [sp++]; 122 ASTAT = [sp++];
123 SAVE_ALL_SYS 123 SAVE_ALL_SYS
124 DEBUG_HWTRACE_SAVE(p5, r7)
125#ifdef CONFIG_MPU 124#ifdef CONFIG_MPU
125 /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
126 * will change the stack pointer. */
126 R0 = SEQSTAT; 127 R0 = SEQSTAT;
127 R1 = SP; 128 R1 = SP;
129#endif
130 DEBUG_HWTRACE_SAVE(p5, r7)
131#ifdef CONFIG_MPU
128 sp += -12; 132 sp += -12;
129 call _cplb_hdr; 133 call _cplb_hdr;
130 sp += 12; 134 sp += 12;
@@ -191,6 +195,7 @@ ENTRY(_bfin_return_from_exception)
191ENDPROC(_bfin_return_from_exception) 195ENDPROC(_bfin_return_from_exception)
192 196
193ENTRY(_handle_bad_cplb) 197ENTRY(_handle_bad_cplb)
198 DEBUG_HWTRACE_RESTORE(p5, r7)
194 /* To get here, we just tried and failed to change a CPLB 199 /* To get here, we just tried and failed to change a CPLB
195 * so, handle things in trap_c (C code), by lowering to 200 * so, handle things in trap_c (C code), by lowering to
196 * IRQ5, just like we normally do. Since this is not a 201 * IRQ5, just like we normally do. Since this is not a