aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-blackfin
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2007-06-21 04:34:08 -0400
committerBryan Wu <bryan.wu@analog.com>2007-06-21 04:34:08 -0400
commit669b792c77bbc30e9f4d9c95dbc918dc348c49c2 (patch)
tree2d8403e9e3cf998eda8465a322261d45e24cd26a /include/asm-blackfin
parent29440a2b4cd37e32dfe0fa60ef1665775b24dab1 (diff)
Blackfin arch: Clean up trace buffer handling, No major functional changes.
Turns on trace earlier, so crashes at kernel start should print out a trace, making things easier to debug. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin')
-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_ */