2 * Common header file for blackfin family of processors.
6 #ifndef _BLACKFIN_TRACE_
7 #define _BLACKFIN_TRACE_
9 /* Normally, we use ON, but you can't turn on software expansion until
10 * interrupts subsystem is ready
13 #define BFIN_TRACE_INIT ((CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION << 4) | 0x03)
14 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
15 #define BFIN_TRACE_ON (BFIN_TRACE_INIT | (CONFIG_DEBUG_BFIN_HWTRACE_EXPAND << 2))
17 #define BFIN_TRACE_ON (BFIN_TRACE_INIT)
21 extern unsigned long trace_buff_offset;
22 extern unsigned long software_trace_buff[];
24 /* Trace Macros for C files */
26 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
28 #define trace_buffer_save(x) \
30 (x) = bfin_read_TBUFCTL(); \
31 bfin_write_TBUFCTL((x) & ~TBUFEN); \
34 #define trace_buffer_restore(x) \
36 bfin_write_TBUFCTL((x)); \
38 #else /* DEBUG_BFIN_HWTRACE_ON */
40 #define trace_buffer_save(x)
41 #define trace_buffer_restore(x)
42 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
45 /* Trace Macros for Assembly files */
47 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
49 #define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg)
50 #define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg)
52 #define trace_buffer_stop(preg, dreg) \
53 preg.L = LO(TBUFCTL); \
54 preg.H = HI(TBUFCTL); \
58 #define trace_buffer_start(preg, dreg) \
59 preg.L = LO(TBUFCTL); \
60 preg.H = HI(TBUFCTL); \
61 dreg = BFIN_TRACE_ON; \
64 #define trace_buffer_init(preg, dreg) \
65 preg.L = LO(TBUFCTL); \
66 preg.H = HI(TBUFCTL); \
67 dreg = BFIN_TRACE_INIT; \
70 #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
72 #define trace_buffer_stop(preg, dreg)
73 #define trace_buffer_start(preg, dreg)
74 #define trace_buffer_init(preg, dreg)
76 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
78 #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
79 # define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg)
80 # define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg)
83 # define DEBUG_START_HWTRACE(preg, dreg)
84 # define DEBUG_STOP_HWTRACE(preg, dreg)
87 #endif /* __ASSEMBLY__ */
89 #endif /* _BLACKFIN_TRACE_ */