diff options
author | Bernd Schmidt <bernds_cb1@t-online.de> | 2008-04-23 07:17:34 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-04-23 07:17:34 +0800 |
commit | 2a0c4fdb6602ea066380aaf71ff7bb2f61ffeee8 (patch) | |
tree | b77ed1db44e1d0948ac2ab8414066e365da21ddd /include/asm-blackfin | |
parent | dbfe44f02b6855efb5a596e942ec2fd96d592f60 (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 'include/asm-blackfin')
-rw-r--r-- | include/asm-blackfin/trace.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-blackfin/trace.h b/include/asm-blackfin/trace.h index ef18afbc210..312b596b973 100644 --- a/include/asm-blackfin/trace.h +++ b/include/asm-blackfin/trace.h @@ -62,14 +62,14 @@ extern unsigned long software_trace_buff[]; preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ dreg = [preg]; \ - [sp++] = dreg; \ + [--sp] = dreg; \ dreg = 0x1; \ [preg] = dreg; #define trace_buffer_restore(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ - dreg = [sp--]; \ + dreg = [sp++]; \ [preg] = dreg; #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ |