diff options
author | David S. Miller <davem@davemloft.net> | 2010-03-31 18:05:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-31 18:05:05 -0700 |
commit | b857bd292223f54aaae3693c82fa7299a99991cd (patch) | |
tree | d1df20123185c44c4dbac7c82720b71721f82255 /arch/sparc/kernel/ptrace_32.c | |
parent | c4a3987fa075b2d15ebc3d59b01fb7ed403cd3e1 (diff) | |
download | blackbird-obmc-linux-b857bd292223f54aaae3693c82fa7299a99991cd.tar.gz blackbird-obmc-linux-b857bd292223f54aaae3693c82fa7299a99991cd.zip |
sparc: Fix regset register window handling.
We have to adjust 'reg_window' down by 16 becuase the 'pos' iterator
we'll use to index into the stack slots will be between 16 and 32.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/ptrace_32.c')
-rw-r--r-- | arch/sparc/kernel/ptrace_32.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c index 7e3dfd9bb97e..e608f397e11f 100644 --- a/arch/sparc/kernel/ptrace_32.c +++ b/arch/sparc/kernel/ptrace_32.c @@ -65,6 +65,7 @@ static int genregs32_get(struct task_struct *target, *k++ = regs->u_regs[pos++]; reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; + reg_window -= 16; for (; count > 0 && pos < 32; count--) { if (get_user(*k++, ®_window[pos++])) return -EFAULT; @@ -76,6 +77,7 @@ static int genregs32_get(struct task_struct *target, } reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; + reg_window -= 16; for (; count > 0 && pos < 32; count--) { if (get_user(reg, ®_window[pos++]) || put_user(reg, u++)) @@ -141,6 +143,7 @@ static int genregs32_set(struct task_struct *target, regs->u_regs[pos++] = *k++; reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; + reg_window -= 16; for (; count > 0 && pos < 32; count--) { if (put_user(*k++, ®_window[pos++])) return -EFAULT; @@ -153,6 +156,7 @@ static int genregs32_set(struct task_struct *target, } reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; + reg_window -= 16; for (; count > 0 && pos < 32; count--) { if (get_user(reg, u++) || put_user(reg, ®_window[pos++])) |