Title: [4191] trunk: 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
Revision
4191
Author
vapier
Date
2008-01-30 16:39:25 -0600 (Wed, 30 Jan 2008)

Log Message

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

Diffstat

 arch/blackfin/mach-common/entry.S |   12 ++++--------
 include/asm-blackfin/trace.h      |   35 ++++++++++++++++++++---------------
 2 files changed, 24 insertions(+), 23 deletions(-)

Modified Paths

Diff

Modified: trunk/arch/blackfin/mach-common/entry.S (4190 => 4191)


--- trunk/arch/blackfin/mach-common/entry.S	2008-01-30 22:22:45 UTC (rev 4190)
+++ trunk/arch/blackfin/mach-common/entry.S	2008-01-30 22:39:25 UTC (rev 4191)
@@ -121,6 +121,7 @@
 	(R7:6,P5:4) = [sp++];
 	ASTAT = [sp++];
 	SAVE_ALL_SYS
+	DEBUG_HWTRACE_SAVE(p5, r7)
 #ifdef CONFIG_MPU
 	R0 = SEQSTAT;
 	R1 = SP;
@@ -132,14 +133,13 @@
 #else
 	call __cplb_hdr;
 #endif
-	DEBUG_START_HWTRACE(p5, r7)
+	DEBUG_HWTRACE_RESTORE(p5, r7)
 	RESTORE_ALL_SYS
 	SP = EX_SCRATCH_REG;
 	rtx;
 ENDPROC(_ex_icplb_miss)
 
 ENTRY(_ex_syscall)
-	DEBUG_START_HWTRACE(p5, r7)
 	(R7:6,P5:4) = [sp++];
 	ASTAT = [sp++];
 	raise 15;		/* invoked by TRAP #0, for sys call */
@@ -178,7 +178,6 @@
 ENDPROC(_ex_single_step)
 
 ENTRY(_bfin_return_from_exception)
-	DEBUG_START_HWTRACE(p5, r7)
 #if ANOMALY_05000257
 	R7=LC0;
 	LC0=R7;
@@ -200,10 +199,9 @@
 	 * need to make a CPLB exception look like a normal exception
 	 */
 
-	DEBUG_START_HWTRACE(p5, r7)
 	RESTORE_ALL_SYS
 	[--sp] = ASTAT;
-	[--sp] = (R7:6, P5:4);
+	[--sp] = (R7:6,P5:4);
 
 ENTRY(_ex_replaceable)
 	nop;
@@ -253,7 +251,6 @@
 	R6 = SEQSTAT;
 	[P5] = R6;
 
-	DEBUG_START_HWTRACE(p5, r7)
 	(R7:6,P5:4) = [sp++];
 	ASTAT = [sp++];
 	SP = EX_SCRATCH_REG;
@@ -382,8 +379,7 @@
 	sp.h = _exception_stack_top;
 	/* Try to deal with syscalls quickly.  */
 	[--sp] = ASTAT;
-	[--sp] = (R7:6, P5:4);
-	DEBUG_STOP_HWTRACE(p5, r7)
+	[--sp] = (R7:6,P5:4);
 	r7 = SEQSTAT;		/* reason code is in bit 5:0 */
 	r6.l = lo(SEQSTAT_EXCAUSE);
 	r6.h = hi(SEQSTAT_EXCAUSE);

Modified: trunk/include/asm-blackfin/trace.h (4190 => 4191)


--- trunk/include/asm-blackfin/trace.h	2008-01-30 22:22:45 UTC (rev 4190)
+++ trunk/include/asm-blackfin/trace.h	2008-01-30 22:39:25 UTC (rev 4191)
@@ -46,42 +46,47 @@
 
 #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__ */
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to