Blackfin arch: Fix bug - This change eliminates impact on application debugging
[deliverable/linux.git] / arch / blackfin / mach-common / entry.S
index 038f70e0be65cb4adcb1ada19b07f6d75eba7d8b..3db2f4df261bfc89b7310c272496fc304123c211 100644 (file)
@@ -158,6 +158,38 @@ ENTRY(_ex_single_step)
        cc = r7 == r6;
        if cc jump _bfin_return_from_exception;
 
+#ifdef CONFIG_KGDB
+       /* Don't do single step in hardware exception handler */
+        p5.l = lo(IPEND);
+        p5.h = hi(IPEND);
+       r6 = [p5];
+       cc = bittst(r6, 5);
+       if cc jump _bfin_return_from_exception;
+
+       /* skip single step if current interrupt priority is higher than
+        * that of the first instruction, from which gdb starts single step */
+       r6 >>= 6;
+       r7 = 10;
+.Lfind_priority_start:
+       cc = bittst(r6, 0);
+       if cc jump .Lfind_priority_done;
+       r6 >>= 1;
+       r7 += -1;
+       cc = r7 == 0;
+       if cc jump .Lfind_priority_done;
+       jump.s .Lfind_priority_start;
+.Lfind_priority_done:
+       p4.l = _debugger_step;
+       p4.h = _debugger_step;
+       r6 = [p4];
+       cc = r6 == 0;
+       if cc jump .Ldo_single_step;
+       r6 += -1;
+       cc = r6 < r7;
+       if cc jump _bfin_return_from_exception;
+.Ldo_single_step:
+#endif
+
        /* If we were in user mode, do the single step normally.  */
        p5.l = lo(IPEND);
        p5.h = hi(IPEND);
This page took 0.027577 seconds and 5 git commands to generate.