|
@@ -45,8 +45,7 @@
|
|
int restore_sigcontext(struct pt_regs *regs,
|
|
int restore_sigcontext(struct pt_regs *regs,
|
|
struct sigcontext __user *sc)
|
|
struct sigcontext __user *sc)
|
|
{
|
|
{
|
|
- int err = 0;
|
|
|
|
- int i;
|
|
|
|
|
|
+ int err;
|
|
|
|
|
|
/* Always make any pending restarted system calls return -EINTR */
|
|
/* Always make any pending restarted system calls return -EINTR */
|
|
current_thread_info()->restart_block.fn = do_no_restart_syscall;
|
|
current_thread_info()->restart_block.fn = do_no_restart_syscall;
|
|
@@ -57,9 +56,7 @@ int restore_sigcontext(struct pt_regs *regs,
|
|
*/
|
|
*/
|
|
BUILD_BUG_ON(sizeof(struct sigcontext) != sizeof(struct pt_regs));
|
|
BUILD_BUG_ON(sizeof(struct sigcontext) != sizeof(struct pt_regs));
|
|
BUILD_BUG_ON(sizeof(struct sigcontext) % 8 != 0);
|
|
BUILD_BUG_ON(sizeof(struct sigcontext) % 8 != 0);
|
|
-
|
|
|
|
- for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
|
|
|
|
- err |= __get_user(regs->regs[i], &sc->gregs[i]);
|
|
|
|
|
|
+ err = __copy_from_user(regs, sc, sizeof(*regs));
|
|
|
|
|
|
/* Ensure that the PL is always set to USER_PL. */
|
|
/* Ensure that the PL is always set to USER_PL. */
|
|
regs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(regs->ex1));
|
|
regs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(regs->ex1));
|
|
@@ -110,12 +107,7 @@ badframe:
|
|
|
|
|
|
int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
|
|
int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
|
|
{
|
|
{
|
|
- int i, err = 0;
|
|
|
|
-
|
|
|
|
- for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
|
|
|
|
- err |= __put_user(regs->regs[i], &sc->gregs[i]);
|
|
|
|
-
|
|
|
|
- return err;
|
|
|
|
|
|
+ return __copy_to_user(sc, regs, sizeof(*regs));
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|