|
44 | 44 | */
|
45 | 45 | static int genregs_get(struct task_struct *target,
|
46 | 46 | const struct user_regset *regset,
|
47 |
| - unsigned int pos, unsigned int count, |
48 |
| - void *kbuf, void __user * ubuf) |
| 47 | + struct membuf to) |
49 | 48 | {
|
50 | 49 | const struct pt_regs *regs = task_pt_regs(target);
|
51 |
| - int ret; |
52 | 50 |
|
53 | 51 | /* 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 |
| - ®s->pc, 4*32, 4*33); |
62 |
| - if (!ret) |
63 |
| - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, |
64 |
| - ®s->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); |
70 | 56 | }
|
71 | 57 |
|
72 | 58 | /*
|
@@ -114,7 +100,7 @@ static const struct user_regset or1k_regsets[] = {
|
114 | 100 | .n = ELF_NGREG,
|
115 | 101 | .size = sizeof(long),
|
116 | 102 | .align = sizeof(long),
|
117 |
| - .get = genregs_get, |
| 103 | + .regset_get = genregs_get, |
118 | 104 | .set = genregs_set,
|
119 | 105 | },
|
120 | 106 | };
|
|
0 commit comments