aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2008-08-05 05:33:38 -0400
committerBryan Wu <cooloney@kernel.org>2008-08-05 05:33:38 -0400
commit5400c5aa2de41501be7529831c9df36c729bf371 (patch)
treebc2e0a6c0d8a88484b946e4989c07b27901a70d0 /arch/blackfin
parent0f0625d895bc5b3c3d7352486a94e5a75f10fd35 (diff)
Blackfin arch: Fix bug - This change eliminates impact on application debugging
Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-common/entry.S20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index eceb484d90f9..3db2f4df261b 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -158,6 +158,7 @@ ENTRY(_ex_single_step)
158 cc = r7 == r6; 158 cc = r7 == r6;
159 if cc jump _bfin_return_from_exception; 159 if cc jump _bfin_return_from_exception;
160 160
161#ifdef CONFIG_KGDB
161 /* Don't do single step in hardware exception handler */ 162 /* Don't do single step in hardware exception handler */
162 p5.l = lo(IPEND); 163 p5.l = lo(IPEND);
163 p5.h = hi(IPEND); 164 p5.h = hi(IPEND);
@@ -165,7 +166,6 @@ ENTRY(_ex_single_step)
165 cc = bittst(r6, 5); 166 cc = bittst(r6, 5);
166 if cc jump _bfin_return_from_exception; 167 if cc jump _bfin_return_from_exception;
167 168
168#ifdef CONFIG_KGDB
169 /* skip single step if current interrupt priority is higher than 169 /* skip single step if current interrupt priority is higher than
170 * that of the first instruction, from which gdb starts single step */ 170 * that of the first instruction, from which gdb starts single step */
171 r6 >>= 6; 171 r6 >>= 6;
@@ -191,12 +191,22 @@ ENTRY(_ex_single_step)
191#endif 191#endif
192 192
193 /* If we were in user mode, do the single step normally. */ 193 /* If we were in user mode, do the single step normally. */
194 p5.l = lo(IPEND);
195 p5.h = hi(IPEND);
194 r6 = [p5]; 196 r6 = [p5];
195 r7 = 0xffe0 (z); 197 r7 = 0xffe0 (z);
196 r7 = r7 & r6; 198 r7 = r7 & r6;
197 cc = r7 == 0; 199 cc = r7 == 0;
198 if cc jump 1f; 200 if !cc jump 1f;
199 201
202 /* Single stepping only a single instruction, so clear the trace
203 * bit here. */
204 r7 = syscfg;
205 bitclr (r7, 0);
206 syscfg = R7;
207 jump _ex_trap_c;
208
2091:
200 /* 210 /*
201 * We were in an interrupt handler. By convention, all of them save 211 * We were in an interrupt handler. By convention, all of them save
202 * SYSCFG with their first instruction, so by checking whether our 212 * SYSCFG with their first instruction, so by checking whether our
@@ -224,15 +234,11 @@ ENTRY(_ex_single_step)
224 cc = R7 == R6; 234 cc = R7 == R6;
225 if !cc jump _bfin_return_from_exception; 235 if !cc jump _bfin_return_from_exception;
226 236
2271:
228 /* Single stepping only a single instruction, so clear the trace
229 * bit here. */
230 r7 = syscfg; 237 r7 = syscfg;
231 bitclr (r7, 0); 238 bitclr (r7, 0);
232 syscfg = R7; 239 syscfg = R7;
233 240
234 jump _ex_trap_c; 241 /* Fall through to _bfin_return_from_exception. */
235
236ENDPROC(_ex_single_step) 242ENDPROC(_ex_single_step)
237 243
238ENTRY(_bfin_return_from_exception) 244ENTRY(_bfin_return_from_exception)