diff options
Diffstat (limited to 'arch/powerpc/kernel/ptrace.c')
-rw-r--r-- | arch/powerpc/kernel/ptrace.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 3635be61f899..9fa2c7dcd05a 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -704,15 +704,34 @@ void user_enable_single_step(struct task_struct *task) | |||
704 | 704 | ||
705 | if (regs != NULL) { | 705 | if (regs != NULL) { |
706 | #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) | 706 | #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) |
707 | task->thread.dbcr0 &= ~DBCR0_BT; | ||
707 | task->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC; | 708 | task->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC; |
708 | regs->msr |= MSR_DE; | 709 | regs->msr |= MSR_DE; |
709 | #else | 710 | #else |
711 | regs->msr &= ~MSR_BE; | ||
710 | regs->msr |= MSR_SE; | 712 | regs->msr |= MSR_SE; |
711 | #endif | 713 | #endif |
712 | } | 714 | } |
713 | set_tsk_thread_flag(task, TIF_SINGLESTEP); | 715 | set_tsk_thread_flag(task, TIF_SINGLESTEP); |
714 | } | 716 | } |
715 | 717 | ||
718 | void user_enable_block_step(struct task_struct *task) | ||
719 | { | ||
720 | struct pt_regs *regs = task->thread.regs; | ||
721 | |||
722 | if (regs != NULL) { | ||
723 | #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) | ||
724 | task->thread.dbcr0 &= ~DBCR0_IC; | ||
725 | task->thread.dbcr0 = DBCR0_IDM | DBCR0_BT; | ||
726 | regs->msr |= MSR_DE; | ||
727 | #else | ||
728 | regs->msr &= ~MSR_SE; | ||
729 | regs->msr |= MSR_BE; | ||
730 | #endif | ||
731 | } | ||
732 | set_tsk_thread_flag(task, TIF_SINGLESTEP); | ||
733 | } | ||
734 | |||
716 | void user_disable_single_step(struct task_struct *task) | 735 | void user_disable_single_step(struct task_struct *task) |
717 | { | 736 | { |
718 | struct pt_regs *regs = task->thread.regs; | 737 | struct pt_regs *regs = task->thread.regs; |
@@ -726,10 +745,10 @@ void user_disable_single_step(struct task_struct *task) | |||
726 | 745 | ||
727 | if (regs != NULL) { | 746 | if (regs != NULL) { |
728 | #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) | 747 | #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) |
729 | task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_IDM); | 748 | task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); |
730 | regs->msr &= ~MSR_DE; | 749 | regs->msr &= ~MSR_DE; |
731 | #else | 750 | #else |
732 | regs->msr &= ~MSR_SE; | 751 | regs->msr &= ~(MSR_SE | MSR_BE); |
733 | #endif | 752 | #endif |
734 | } | 753 | } |
735 | clear_tsk_thread_flag(task, TIF_SINGLESTEP); | 754 | clear_tsk_thread_flag(task, TIF_SINGLESTEP); |