diff options
Diffstat (limited to 'arch/sparc64/kernel/ptrace.c')
-rw-r--r-- | arch/sparc64/kernel/ptrace.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index e9fc0aa2da38..f6c9fc92921d 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c | |||
@@ -287,11 +287,11 @@ static int genregs64_set(struct task_struct *target, | |||
287 | 32 * sizeof(u64), | 287 | 32 * sizeof(u64), |
288 | 33 * sizeof(u64)); | 288 | 33 * sizeof(u64)); |
289 | if (!ret) { | 289 | if (!ret) { |
290 | /* Only the condition codes can be modified | 290 | /* Only the condition codes and the "in syscall" |
291 | * in the %tstate register. | 291 | * state can be modified in the %tstate register. |
292 | */ | 292 | */ |
293 | tstate &= (TSTATE_ICC | TSTATE_XCC); | 293 | tstate &= (TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL); |
294 | regs->tstate &= ~(TSTATE_ICC | TSTATE_XCC); | 294 | regs->tstate &= ~(TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL); |
295 | regs->tstate |= tstate; | 295 | regs->tstate |= tstate; |
296 | } | 296 | } |
297 | } | 297 | } |
@@ -657,8 +657,10 @@ static int genregs32_set(struct task_struct *target, | |||
657 | switch (pos) { | 657 | switch (pos) { |
658 | case 32: /* PSR */ | 658 | case 32: /* PSR */ |
659 | tstate = regs->tstate; | 659 | tstate = regs->tstate; |
660 | tstate &= ~(TSTATE_ICC | TSTATE_XCC); | 660 | tstate &= ~(TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL); |
661 | tstate |= psr_to_tstate_icc(reg); | 661 | tstate |= psr_to_tstate_icc(reg); |
662 | if (reg & PSR_SYSCALL) | ||
663 | tstate |= TSTATE_SYSCALL; | ||
662 | regs->tstate = tstate; | 664 | regs->tstate = tstate; |
663 | break; | 665 | break; |
664 | case 33: /* PC */ | 666 | case 33: /* PC */ |
@@ -944,6 +946,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
944 | break; | 946 | break; |
945 | 947 | ||
946 | default: | 948 | default: |
949 | if (request == PTRACE_SPARC_DETACH) | ||
950 | request = PTRACE_DETACH; | ||
947 | ret = compat_ptrace_request(child, request, addr, data); | 951 | ret = compat_ptrace_request(child, request, addr, data); |
948 | break; | 952 | break; |
949 | } | 953 | } |
@@ -1036,6 +1040,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
1036 | break; | 1040 | break; |
1037 | 1041 | ||
1038 | default: | 1042 | default: |
1043 | if (request == PTRACE_SPARC_DETACH) | ||
1044 | request = PTRACE_DETACH; | ||
1039 | ret = ptrace_request(child, request, addr, data); | 1045 | ret = ptrace_request(child, request, addr, data); |
1040 | break; | 1046 | break; |
1041 | } | 1047 | } |