diff options
Diffstat (limited to 'include/asm-blackfin/trace.h')
-rw-r--r-- | include/asm-blackfin/trace.h | 35 |
1 files changed, 20 insertions, 15 deletions
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[]; | |||
46 | 46 | ||
47 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON | 47 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON |
48 | 48 | ||
49 | #define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg) | ||
50 | #define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg) | ||
51 | |||
52 | #define trace_buffer_stop(preg, dreg) \ | 49 | #define trace_buffer_stop(preg, dreg) \ |
53 | preg.L = LO(TBUFCTL); \ | 50 | preg.L = LO(TBUFCTL); \ |
54 | preg.H = HI(TBUFCTL); \ | 51 | preg.H = HI(TBUFCTL); \ |
55 | dreg = 0x1; \ | 52 | dreg = 0x1; \ |
56 | [preg] = dreg; | 53 | [preg] = dreg; |
57 | 54 | ||
58 | #define trace_buffer_start(preg, dreg) \ | ||
59 | preg.L = LO(TBUFCTL); \ | ||
60 | preg.H = HI(TBUFCTL); \ | ||
61 | dreg = BFIN_TRACE_ON; \ | ||
62 | [preg] = dreg; | ||
63 | |||
64 | #define trace_buffer_init(preg, dreg) \ | 55 | #define trace_buffer_init(preg, dreg) \ |
65 | preg.L = LO(TBUFCTL); \ | 56 | preg.L = LO(TBUFCTL); \ |
66 | preg.H = HI(TBUFCTL); \ | 57 | preg.H = HI(TBUFCTL); \ |
67 | dreg = BFIN_TRACE_INIT; \ | 58 | dreg = BFIN_TRACE_INIT; \ |
68 | [preg] = dreg; | 59 | [preg] = dreg; |
69 | 60 | ||
61 | #define trace_buffer_save(preg, dreg) \ | ||
62 | preg.L = LO(TBUFCTL); \ | ||
63 | preg.H = HI(TBUFCTL); \ | ||
64 | dreg = [preg]; \ | ||
65 | [sp++] = dreg; \ | ||
66 | dreg = 0x1; \ | ||
67 | [preg] = dreg; | ||
68 | |||
69 | #define trace_buffer_restore(preg, dreg) \ | ||
70 | preg.L = LO(TBUFCTL); \ | ||
71 | preg.H = HI(TBUFCTL); \ | ||
72 | dreg = [sp--]; \ | ||
73 | [preg] = dreg; | ||
74 | |||
70 | #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ | 75 | #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ |
71 | 76 | ||
72 | #define trace_buffer_stop(preg, dreg) | 77 | #define trace_buffer_stop(preg, dreg) |
73 | #define trace_buffer_start(preg, dreg) | ||
74 | #define trace_buffer_init(preg, dreg) | 78 | #define trace_buffer_init(preg, dreg) |
79 | #define trace_buffer_save(preg, dreg) | ||
80 | #define trace_buffer_restore(preg, dreg) | ||
75 | 81 | ||
76 | #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ | 82 | #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ |
77 | 83 | ||
78 | #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE | 84 | #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE |
79 | # define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg) | 85 | # define DEBUG_HWTRACE_SAVE(preg, dreg) trace_buffer_save(preg, dreg) |
80 | # define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg) | 86 | # define DEBUG_HWTRACE_RESTORE(preg, dreg) trace_buffer_restore(preg, dreg) |
81 | |||
82 | #else | 87 | #else |
83 | # define DEBUG_START_HWTRACE(preg, dreg) | 88 | # define DEBUG_HWTRACE_SAVE(preg, dreg) |
84 | # define DEBUG_STOP_HWTRACE(preg, dreg) | 89 | # define DEBUG_HWTRACE_RESTORE(preg, dreg) |
85 | #endif | 90 | #endif |
86 | 91 | ||
87 | #endif /* __ASSEMBLY__ */ | 92 | #endif /* __ASSEMBLY__ */ |