lkml.org 
[lkml]   [2020]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 22/41] sparc: switch to ->get2()
On Mon, Jun 29, 2020 at 07:26:09PM +0100, Al Viro wrote:

> static int getregs64_get(struct task_struct *target,
> const struct user_regset *regset,
> - unsigned int pos, unsigned int count,
> - void *kbuf, void __user *ubuf)
> + struct membuf to)
> {
> const struct pt_regs *regs = task_pt_regs(target);
> - int ret;
>
> if (target == current)
> flushw_user();
>
> - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> - regs->u_regs + 1,
> - 0, 15 * sizeof(u64));
> - if (!ret)
> - ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
> - 15 * sizeof(u64), 16 * sizeof(u64));
> - if (!ret) {
> - /* TSTATE, TPC, TNPC */
> - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> - &regs->tstate,
> - 16 * sizeof(u64),
> - 19 * sizeof(u64));
> - }
> - if (!ret) {
> - unsigned long y = regs->y;
> -
> - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> - &y,
> - 19 * sizeof(u64),
> - 20 * sizeof(u64));
> - }
> - return ret;
> + membuf_write(&to, regs->u_regs + 1, 15 * sizeof(u64));
> + return membuf_store(&to, (u64)0);
^^^^^^
Er... That should be simply

+ membuf_store(&to, (u64)0);

> + membuf_write(&to, &regs->tstate, 3 * sizeof(u64));
> + return membuf_store(&to, (u64)regs->y);
> }

\
 
 \ /
  Last update: 2020-06-30 15:17    [W:0.166 / U:5.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site