From 80f31c8a03d2f0644d0ceaf14e7e0108a007c962 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 2 Feb 2008 15:47:24 +0800 Subject: [Blackfin] arch: change the trace buffer control start/stop logic in the exception handlers To save/restore the trace buffer control so that if we take an exception after turning off the trace buffer at a higher level we dont inadvertently turn the trace buffer back on Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- include/asm-blackfin/trace.h | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'include/asm-blackfin/trace.h') diff --git a/include/asm-blackfin/trace.h b/include/asm-blackfin/trace.h index 6313aace9d59..ef18afbc2101 100644 --- a/include/asm-blackfin/trace.h +++ b/include/asm-blackfin/trace.h @@ -46,42 +46,47 @@ extern unsigned long software_trace_buff[]; #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON -#define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg) -#define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg) - #define trace_buffer_stop(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ dreg = 0x1; \ [preg] = dreg; -#define trace_buffer_start(preg, dreg) \ - preg.L = LO(TBUFCTL); \ - preg.H = HI(TBUFCTL); \ - dreg = BFIN_TRACE_ON; \ - [preg] = dreg; - #define trace_buffer_init(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ dreg = BFIN_TRACE_INIT; \ [preg] = dreg; +#define trace_buffer_save(preg, dreg) \ + preg.L = LO(TBUFCTL); \ + preg.H = HI(TBUFCTL); \ + dreg = [preg]; \ + [sp++] = dreg; \ + dreg = 0x1; \ + [preg] = dreg; + +#define trace_buffer_restore(preg, dreg) \ + preg.L = LO(TBUFCTL); \ + preg.H = HI(TBUFCTL); \ + dreg = [sp--]; \ + [preg] = dreg; + #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ #define trace_buffer_stop(preg, dreg) -#define trace_buffer_start(preg, dreg) #define trace_buffer_init(preg, dreg) +#define trace_buffer_save(preg, dreg) +#define trace_buffer_restore(preg, dreg) #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE -# define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg) -# define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg) - +# define DEBUG_HWTRACE_SAVE(preg, dreg) trace_buffer_save(preg, dreg) +# define DEBUG_HWTRACE_RESTORE(preg, dreg) trace_buffer_restore(preg, dreg) #else -# define DEBUG_START_HWTRACE(preg, dreg) -# define DEBUG_STOP_HWTRACE(preg, dreg) +# define DEBUG_HWTRACE_SAVE(preg, dreg) +# define DEBUG_HWTRACE_RESTORE(preg, dreg) #endif #endif /* __ASSEMBLY__ */ -- cgit v1.2.3