Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=62b14c24b10033591bbab16dea165d696a616f37
Commit:     62b14c24b10033591bbab16dea165d696a616f37
Parent:     26c288f82c74dba08da6321c626c101a7aa8575b
Author:     Atsushi Nemoto <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 26 00:53:02 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Mon Oct 29 19:35:36 2007 +0000

    [MIPS] Store sign-extend register values for PTRACE_GETREGS
    
    A comment on ptrace_getregs() states "Registers are sign extended to
    fill the available space." but it is not true.  Fix code to match the
    comment.  Also fix casts on each caller to get rid of some warnings.
    
    Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]>
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/ptrace.c   |   18 +++++++++---------
 arch/mips/kernel/ptrace32.c |    4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 999f785..35234b9 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -65,13 +65,13 @@ int ptrace_getregs(struct task_struct *child, __s64 __user 
*data)
        regs = task_pt_regs(child);
 
        for (i = 0; i < 32; i++)
-               __put_user(regs->regs[i], data + i);
-       __put_user(regs->lo, data + EF_LO - EF_R0);
-       __put_user(regs->hi, data + EF_HI - EF_R0);
-       __put_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
-       __put_user(regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
-       __put_user(regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
-       __put_user(regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
+               __put_user((long)regs->regs[i], data + i);
+       __put_user((long)regs->lo, data + EF_LO - EF_R0);
+       __put_user((long)regs->hi, data + EF_HI - EF_R0);
+       __put_user((long)regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
+       __put_user((long)regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
+       __put_user((long)regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
+       __put_user((long)regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
 
        return 0;
 }
@@ -390,11 +390,11 @@ long arch_ptrace(struct task_struct *child, long request, 
long addr, long data)
                }
 
        case PTRACE_GETREGS:
-               ret = ptrace_getregs(child, (__u64 __user *) data);
+               ret = ptrace_getregs(child, (__s64 __user *) data);
                break;
 
        case PTRACE_SETREGS:
-               ret = ptrace_setregs(child, (__u64 __user *) data);
+               ret = ptrace_setregs(child, (__s64 __user *) data);
                break;
 
        case PTRACE_GETFPREGS:
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index f2bffed..76818be 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -346,11 +346,11 @@ asmlinkage int sys32_ptrace(int request, int pid, int 
addr, int data)
                }
 
        case PTRACE_GETREGS:
-               ret = ptrace_getregs(child, (__u64 __user *) (__u64) data);
+               ret = ptrace_getregs(child, (__s64 __user *) (__u64) data);
                break;
 
        case PTRACE_SETREGS:
-               ret = ptrace_setregs(child, (__u64 __user *) (__u64) data);
+               ret = ptrace_setregs(child, (__s64 __user *) (__u64) data);
                break;
 
        case PTRACE_GETFPREGS:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to