sigutil_64.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) sigutil_64.c (d11c2a0de2824395656cf8ed15811580c9dd38aa)
1#include <linux/kernel.h>
2#include <linux/types.h>
3#include <linux/thread_info.h>
4#include <linux/uaccess.h>
5#include <linux/errno.h>
6
7#include <asm/sigcontext.h>
8#include <asm/fpumacro.h>

--- 23 unchanged lines hidden (view full) ---

32}
33
34int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
35{
36 unsigned long *fpregs = current_thread_info()->fpregs;
37 unsigned long fprs;
38 int err;
39
1#include <linux/kernel.h>
2#include <linux/types.h>
3#include <linux/thread_info.h>
4#include <linux/uaccess.h>
5#include <linux/errno.h>
6
7#include <asm/sigcontext.h>
8#include <asm/fpumacro.h>

--- 23 unchanged lines hidden (view full) ---

32}
33
34int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
35{
36 unsigned long *fpregs = current_thread_info()->fpregs;
37 unsigned long fprs;
38 int err;
39
40 err = __get_user(fprs, &fpu->si_fprs);
40 if (((unsigned long) fpu) & 7)
41 return -EFAULT;
42
43 err = get_user(fprs, &fpu->si_fprs);
41 fprs_write(0);
42 regs->tstate &= ~TSTATE_PEF;
43 if (fprs & FPRS_DL)
44 err |= copy_from_user(fpregs, &fpu->si_float_regs[0],
45 (sizeof(unsigned int) * 32));
46 if (fprs & FPRS_DU)
47 err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32],
48 (sizeof(unsigned int) * 32));

--- 18 unchanged lines hidden (view full) ---

67 return err;
68}
69
70int restore_rwin_state(__siginfo_rwin_t __user *rp)
71{
72 struct thread_info *t = current_thread_info();
73 int i, wsaved, err;
74
44 fprs_write(0);
45 regs->tstate &= ~TSTATE_PEF;
46 if (fprs & FPRS_DL)
47 err |= copy_from_user(fpregs, &fpu->si_float_regs[0],
48 (sizeof(unsigned int) * 32));
49 if (fprs & FPRS_DU)
50 err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32],
51 (sizeof(unsigned int) * 32));

--- 18 unchanged lines hidden (view full) ---

70 return err;
71}
72
73int restore_rwin_state(__siginfo_rwin_t __user *rp)
74{
75 struct thread_info *t = current_thread_info();
76 int i, wsaved, err;
77
75 __get_user(wsaved, &rp->wsaved);
78 if (((unsigned long) rp) & 7)
79 return -EFAULT;
80
81 get_user(wsaved, &rp->wsaved);
76 if (wsaved > NSWINS)
77 return -EFAULT;
78
79 err = 0;
80 for (i = 0; i < wsaved; i++) {
81 err |= copy_from_user(&t->reg_window[i],
82 &rp->reg_window[i],
83 sizeof(struct reg_window));

--- 12 unchanged lines hidden ---
82 if (wsaved > NSWINS)
83 return -EFAULT;
84
85 err = 0;
86 for (i = 0; i < wsaved; i++) {
87 err |= copy_from_user(&t->reg_window[i],
88 &rp->reg_window[i],
89 sizeof(struct reg_window));

--- 12 unchanged lines hidden ---