aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-blackfin/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-blackfin/trace.h')
-rw-r--r--include/asm-blackfin/trace.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/asm-blackfin/trace.h b/include/asm-blackfin/trace.h
new file mode 100644
index 000000000000..9c2474c9a589
--- /dev/null
+++ b/include/asm-blackfin/trace.h
@@ -0,0 +1,52 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _BLACKFIN_TRACE_
7#define _BLACKFIN_TRACE_
8
9#ifndef __ASSEMBLY__
10/* Trace Macros for C files */
11
12#define trace_buffer_save(x) \
13 do { \
14 (x) = bfin_read_TBUFCTL(); \
15 bfin_write_TBUFCTL((x) & ~TBUFEN); \
16 } while (0)
17
18#define trace_buffer_restore(x) \
19 do { \
20 bfin_write_TBUFCTL((x)); \
21 } while (0)
22
23#else
24/* Trace Macros for Assembly files */
25
26#define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg)
27#define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg)
28
29#define trace_buffer_stop(preg, dreg) \
30 preg.L = LO(TBUFCTL); \
31 preg.H = HI(TBUFCTL); \
32 dreg = 0x1; \
33 [preg] = dreg;
34
35#define trace_buffer_start(preg, dreg) \
36 preg.L = LO(TBUFCTL); \
37 preg.H = HI(TBUFCTL); \
38 dreg = 0x13; \
39 [preg] = dreg;
40
41#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
42# define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg)
43# define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg)
44
45#else
46# define DEBUG_START_HWTRACE(preg, dreg)
47# define DEBUG_STOP_HWTRACE(preg, dreg)
48#endif
49
50#endif /* __ASSEMBLY__ */
51
52#endif /* _BLACKFIN_TRACE_ */