Commit a19b4a14 authored by Haavard Skinnemoen's avatar Haavard Skinnemoen

[AVR32] Fix bogus ti->flags manipulation in debug handler

We should OR in a bitmask, not a bit offset, into ti->flags. This
might fix some strange behaviour when single stepping.

Also, use set_ti_thread_flag() to manipulate the flags to avoid
surprises in the future.
Signed-off-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent bfa4f55c
...@@ -313,7 +313,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs) ...@@ -313,7 +313,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
__mtdr(DBGREG_DC, dc); __mtdr(DBGREG_DC, dc);
ti = current_thread_info(); ti = current_thread_info();
ti->flags |= _TIF_BREAKPOINT; set_ti_thread_flag(ti, TIF_BREAKPOINT);
/* The TLB miss handlers don't check thread flags */ /* The TLB miss handlers don't check thread flags */
if ((regs->pc >= (unsigned long)&itlb_miss) if ((regs->pc >= (unsigned long)&itlb_miss)
...@@ -328,7 +328,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs) ...@@ -328,7 +328,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
* single step. * single step.
*/ */
if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR) if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR)
ti->flags |= TIF_SINGLE_STEP; set_ti_thread_flag(ti, TIF_SINGLE_STEP);
} else { } else {
panic("Unable to handle debug trap at pc = %08lx\n", panic("Unable to handle debug trap at pc = %08lx\n",
regs->pc); regs->pc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment