aboutsummaryrefslogtreecommitdiff
path: root/include/asm-blackfin/trace.h
blob: 9c2474c9a589694adb54a9b5726fc92f4bf6497d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Common header file for blackfin family of processors.
 *
 */

#ifndef _BLACKFIN_TRACE_
#define _BLACKFIN_TRACE_

#ifndef __ASSEMBLY__
/* Trace Macros for C files */

#define trace_buffer_save(x) \
        do { \
                (x) = bfin_read_TBUFCTL(); \
                bfin_write_TBUFCTL((x) & ~TBUFEN); \
        } while (0)

#define trace_buffer_restore(x) \
        do { \
                bfin_write_TBUFCTL((x));        \
        } while (0)

#else
/* Trace Macros for Assembly files */

#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 = 0x13;			\
	[preg] = dreg;

#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)

#else
# define DEBUG_START_HWTRACE(preg, dreg)
# define DEBUG_STOP_HWTRACE(preg, dreg)
#endif

#endif /* __ASSEMBLY__ */

#endif				/* _BLACKFIN_TRACE_ */