aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common/entry.S
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 /arch/blackfin/mach-common/entry.S
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 'arch/blackfin/mach-common/entry.S')
-rw-r--r--arch/blackfin/mach-common/entry.S33
1 files changed, 7 insertions, 26 deletions
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index c4a32ea06c4b..15603275f749 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -54,29 +54,10 @@
54#include <asm/errno.h> 54#include <asm/errno.h>
55#include <asm/thread_info.h> /* TIF_NEED_RESCHED */ 55#include <asm/thread_info.h> /* TIF_NEED_RESCHED */
56#include <asm/asm-offsets.h> 56#include <asm/asm-offsets.h>
57#include <asm/trace.h>
57 58
58#include <asm/mach-common/context.S> 59#include <asm/mach-common/context.S>
59 60
60#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
61 /*
62 * TODO: this should be proper save/restore, but for now
63 * we'll just cheat and use 0x1/0x13
64 */
65# define DEBUG_START_HWTRACE \
66 P5.l = LO(TBUFCTL); \
67 P5.h = HI(TBUFCTL); \
68 R7 = 0x13; \
69 [P5] = R7;
70# define DEBUG_STOP_HWTRACE \
71 P5.l = LO(TBUFCTL); \
72 P5.h = HI(TBUFCTL); \
73 R7 = 0x01; \
74 [P5] = R7;
75#else
76# define DEBUG_START_HWTRACE
77# define DEBUG_STOP_HWTRACE
78#endif
79
80#ifdef CONFIG_EXCPT_IRQ_SYSC_L1 61#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
81.section .l1.text 62.section .l1.text
82#else 63#else
@@ -110,7 +91,7 @@ ENTRY(_ex_icplb)
110 ASTAT = [sp++]; 91 ASTAT = [sp++];
111 SAVE_ALL_SYS 92 SAVE_ALL_SYS
112 call __cplb_hdr; 93 call __cplb_hdr;
113 DEBUG_START_HWTRACE 94 DEBUG_START_HWTRACE(p5, r7)
114 RESTORE_ALL_SYS 95 RESTORE_ALL_SYS
115 SP = RETN; 96 SP = RETN;
116 rtx; 97 rtx;
@@ -128,7 +109,7 @@ ENTRY(_ex_spinlock)
128ENDPROC(_ex_spinlock) 109ENDPROC(_ex_spinlock)
129 110
130ENTRY(_ex_syscall) 111ENTRY(_ex_syscall)
131 DEBUG_START_HWTRACE 112 DEBUG_START_HWTRACE(p5, r7)
132 (R7:6,P5:4) = [sp++]; 113 (R7:6,P5:4) = [sp++];
133 ASTAT = [sp++]; 114 ASTAT = [sp++];
134 raise 15; /* invoked by TRAP #0, for sys call */ 115 raise 15; /* invoked by TRAP #0, for sys call */
@@ -186,7 +167,7 @@ ENTRY(_ex_single_step)
186 if !cc jump _ex_trap_c; 167 if !cc jump _ex_trap_c;
187 168
188_return_from_exception: 169_return_from_exception:
189 DEBUG_START_HWTRACE 170 DEBUG_START_HWTRACE(p5, r7)
190#ifdef ANOMALY_05000257 171#ifdef ANOMALY_05000257
191 R7=LC0; 172 R7=LC0;
192 LC0=R7; 173 LC0=R7;
@@ -208,7 +189,7 @@ ENTRY(_handle_bad_cplb)
208 * need to make a CPLB exception look like a normal exception 189 * need to make a CPLB exception look like a normal exception
209 */ 190 */
210 191
211 DEBUG_START_HWTRACE 192 DEBUG_START_HWTRACE(p5, r7)
212 RESTORE_ALL_SYS 193 RESTORE_ALL_SYS
213 [--sp] = ASTAT; 194 [--sp] = ASTAT;
214 [--sp] = (R7:6, P5:4); 195 [--sp] = (R7:6, P5:4);
@@ -251,7 +232,7 @@ ENTRY(_ex_trap_c)
251 R6 = SEQSTAT; 232 R6 = SEQSTAT;
252 [P5] = R6; 233 [P5] = R6;
253 234
254 DEBUG_START_HWTRACE 235 DEBUG_START_HWTRACE(p5, r7)
255 (R7:6,P5:4) = [sp++]; 236 (R7:6,P5:4) = [sp++];
256 ASTAT = [sp++]; 237 ASTAT = [sp++];
257 SP = RETN; 238 SP = RETN;
@@ -335,7 +316,7 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
335 /* Try to deal with syscalls quickly. */ 316 /* Try to deal with syscalls quickly. */
336 [--sp] = ASTAT; 317 [--sp] = ASTAT;
337 [--sp] = (R7:6, P5:4); 318 [--sp] = (R7:6, P5:4);
338 DEBUG_STOP_HWTRACE 319 DEBUG_STOP_HWTRACE(p5, r7)
339 r7 = SEQSTAT; /* reason code is in bit 5:0 */ 320 r7 = SEQSTAT; /* reason code is in bit 5:0 */
340 r6.l = lo(SEQSTAT_EXCAUSE); 321 r6.l = lo(SEQSTAT_EXCAUSE);
341 r6.h = hi(SEQSTAT_EXCAUSE); 322 r6.h = hi(SEQSTAT_EXCAUSE);