Blame view
include/asm-blackfin/trace.h
2.2 KB
669b792c7
|
1 2 3 4 5 6 7 |
/* * Common header file for blackfin family of processors. * */ #ifndef _BLACKFIN_TRACE_ #define _BLACKFIN_TRACE_ |
518039bc2
|
8 9 10 11 12 13 14 15 16 17 |
/* Normally, we use ON, but you can't turn on software expansion until * interrupts subsystem is ready */ #define BFIN_TRACE_INIT ((CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION << 4) | 0x03) #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND #define BFIN_TRACE_ON (BFIN_TRACE_INIT | (CONFIG_DEBUG_BFIN_HWTRACE_EXPAND << 2)) #else #define BFIN_TRACE_ON (BFIN_TRACE_INIT) #endif |
669b792c7
|
18 |
#ifndef __ASSEMBLY__ |
518039bc2
|
19 20 |
extern unsigned long trace_buff_offset; extern unsigned long software_trace_buff[]; |
669b792c7
|
21 |
/* Trace Macros for C files */ |
518039bc2
|
22 |
#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON |
669b792c7
|
23 |
#define trace_buffer_save(x) \ |
518039bc2
|
24 25 26 27 |
do { \ (x) = bfin_read_TBUFCTL(); \ bfin_write_TBUFCTL((x) & ~TBUFEN); \ } while (0) |
669b792c7
|
28 29 |
#define trace_buffer_restore(x) \ |
518039bc2
|
30 31 32 33 34 35 36 37 |
do { \ bfin_write_TBUFCTL((x)); \ } while (0) #else /* DEBUG_BFIN_HWTRACE_ON */ #define trace_buffer_save(x) #define trace_buffer_restore(x) #endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ |
669b792c7
|
38 39 40 |
#else /* Trace Macros for Assembly files */ |
518039bc2
|
41 |
#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON |
669b792c7
|
42 43 44 45 46 |
#define trace_buffer_stop(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ dreg = 0x1; \ [preg] = dreg; |
518039bc2
|
47 48 49 50 |
#define trace_buffer_init(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ dreg = BFIN_TRACE_INIT; \ |
669b792c7
|
51 |
[preg] = dreg; |
80f31c8a0
|
52 53 54 55 |
#define trace_buffer_save(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ dreg = [preg]; \ |
2a0c4fdb6
|
56 |
[--sp] = dreg; \ |
80f31c8a0
|
57 58 59 60 61 62 |
dreg = 0x1; \ [preg] = dreg; #define trace_buffer_restore(preg, dreg) \ preg.L = LO(TBUFCTL); \ preg.H = HI(TBUFCTL); \ |
2a0c4fdb6
|
63 |
dreg = [sp++]; \ |
80f31c8a0
|
64 |
[preg] = dreg; |
518039bc2
|
65 66 67 |
#else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ #define trace_buffer_stop(preg, dreg) |
518039bc2
|
68 |
#define trace_buffer_init(preg, dreg) |
80f31c8a0
|
69 70 |
#define trace_buffer_save(preg, dreg) #define trace_buffer_restore(preg, dreg) |
518039bc2
|
71 72 |
#endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */ |
669b792c7
|
73 |
#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE |
80f31c8a0
|
74 75 |
# define DEBUG_HWTRACE_SAVE(preg, dreg) trace_buffer_save(preg, dreg) # define DEBUG_HWTRACE_RESTORE(preg, dreg) trace_buffer_restore(preg, dreg) |
669b792c7
|
76 |
#else |
80f31c8a0
|
77 78 |
# define DEBUG_HWTRACE_SAVE(preg, dreg) # define DEBUG_HWTRACE_RESTORE(preg, dreg) |
669b792c7
|
79 80 81 82 83 |
#endif #endif /* __ASSEMBLY__ */ #endif /* _BLACKFIN_TRACE_ */ |