Bias the placement of kernel pages at lower PFNs
[linux-2.6/openmoko-kernel/knife-kernel.git] / include / asm-blackfin / trace.h
blob6313aace9d5915991aa55c438fa45914a561e809
1 /*
2 * Common header file for blackfin family of processors.
4 */
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))
16 #else
17 #define BFIN_TRACE_ON (BFIN_TRACE_INIT)
18 #endif
20 #ifndef __ASSEMBLY__
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) \
29 do { \
30 (x) = bfin_read_TBUFCTL(); \
31 bfin_write_TBUFCTL((x) & ~TBUFEN); \
32 } while (0)
34 #define trace_buffer_restore(x) \
35 do { \
36 bfin_write_TBUFCTL((x)); \
37 } while (0)
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 */
44 #else
45 /* Trace Macros for Assembly files */
47 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
49 #define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg)
50 #define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg)
52 #define trace_buffer_stop(preg, dreg) \
53 preg.L = LO(TBUFCTL); \
54 preg.H = HI(TBUFCTL); \
55 dreg = 0x1; \
56 [preg] = dreg;
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;
64 #define trace_buffer_init(preg, dreg) \
65 preg.L = LO(TBUFCTL); \
66 preg.H = HI(TBUFCTL); \
67 dreg = BFIN_TRACE_INIT; \
68 [preg] = dreg;
70 #else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
72 #define trace_buffer_stop(preg, dreg)
73 #define trace_buffer_start(preg, dreg)
74 #define trace_buffer_init(preg, dreg)
76 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
78 #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
79 # define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg)
80 # define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg)
82 #else
83 # define DEBUG_START_HWTRACE(preg, dreg)
84 # define DEBUG_STOP_HWTRACE(preg, dreg)
85 #endif
87 #endif /* __ASSEMBLY__ */
89 #endif /* _BLACKFIN_TRACE_ */