]> err.no Git - linux-2.6/commitdiff
[AVR32] Fix bogus ti->flags manipulation in debug handler
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Thu, 1 Mar 2007 09:37:35 +0000 (10:37 +0100)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Wed, 7 Mar 2007 09:50:28 +0000 (10:50 +0100)
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: Haavard Skinnemoen <hskinnemoen@atmel.com>
arch/avr32/kernel/ptrace.c

index f2e81cd7900223cc3e112fa0b1c40eeb8319ff13..6f4388f7c20be5d57726dfcd01fe94fc962fda3b 100644 (file)
@@ -313,7 +313,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
                __mtdr(DBGREG_DC, dc);
 
                ti = current_thread_info();
-               ti->flags |= _TIF_BREAKPOINT;
+               set_ti_thread_flag(ti, TIF_BREAKPOINT);
 
                /* The TLB miss handlers don't check thread flags */
                if ((regs->pc >= (unsigned long)&itlb_miss)
@@ -328,7 +328,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
                 * single step.
                 */
                if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR)
-                       ti->flags |= TIF_SINGLE_STEP;
+                       set_ti_thread_flag(ti, TIF_SINGLE_STEP);
        } else {
                panic("Unable to handle debug trap at pc = %08lx\n",
                      regs->pc);