Skip to content

Commit f04b2b7

Browse files
author
Al Viro
committed
openrisc: switch to ->regset_get()
Signed-off-by: Al Viro <[email protected]>
1 parent 2cb6cd4 commit f04b2b7

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

arch/openrisc/kernel/ptrace.c

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,15 @@
4444
*/
4545
static int genregs_get(struct task_struct *target,
4646
const struct user_regset *regset,
47-
unsigned int pos, unsigned int count,
48-
void *kbuf, void __user * ubuf)
47+
struct membuf to)
4948
{
5049
const struct pt_regs *regs = task_pt_regs(target);
51-
int ret;
5250

5351
/* r0 */
54-
ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, 0, 4);
55-
56-
if (!ret)
57-
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
58-
regs->gpr+1, 4, 4*32);
59-
if (!ret)
60-
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
61-
&regs->pc, 4*32, 4*33);
62-
if (!ret)
63-
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
64-
&regs->sr, 4*33, 4*34);
65-
if (!ret)
66-
ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
67-
4*34, -1);
68-
69-
return ret;
52+
membuf_zero(&to, 4);
53+
membuf_write(&to, regs->gpr + 1, 31 * 4);
54+
membuf_store(&to, regs->pc);
55+
return membuf_store(&to, regs->sr);
7056
}
7157

7258
/*
@@ -114,7 +100,7 @@ static const struct user_regset or1k_regsets[] = {
114100
.n = ELF_NGREG,
115101
.size = sizeof(long),
116102
.align = sizeof(long),
117-
.get = genregs_get,
103+
.regset_get = genregs_get,
118104
.set = genregs_set,
119105
},
120106
};

0 commit comments

Comments
 (0)