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_stop(preg, dreg) \
50 preg.L = LO(TBUFCTL); \
51 preg.H = HI(TBUFCTL); \
55 #define trace_buffer_init(preg, dreg) \
56 preg.L = LO(TBUFCTL); \
57 preg.H = HI(TBUFCTL); \
58 dreg = BFIN_TRACE_INIT; \
61 #define trace_buffer_save(preg, dreg) \
62 preg.L = LO(TBUFCTL); \
63 preg.H = HI(TBUFCTL); \
69 #define trace_buffer_restore(preg, dreg) \
70 preg.L = LO(TBUFCTL); \
71 preg.H = HI(TBUFCTL); \
75 #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
77 #define trace_buffer_stop(preg, dreg)
78 #define trace_buffer_init(preg, dreg)
79 #define trace_buffer_save(preg, dreg)
80 #define trace_buffer_restore(preg, dreg)
82 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
84 #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
85 # define DEBUG_HWTRACE_SAVE(preg, dreg) trace_buffer_save(preg, dreg)
86 # define DEBUG_HWTRACE_RESTORE(preg, dreg) trace_buffer_restore(preg, dreg)
88 # define DEBUG_HWTRACE_SAVE(preg, dreg)
89 # define DEBUG_HWTRACE_RESTORE(preg, dreg)
92 #endif /* __ASSEMBLY__ */
94 #endif /* _BLACKFIN_TRACE_ */