Commit 08cca5ac authored by Jeff Dike's avatar Jeff Dike

Fixed a couple of buglets in the signal frame merge.

parent fd3f9c88
...@@ -25,15 +25,6 @@ static int copy_restorer(void (*restorer)(void), unsigned long start, ...@@ -25,15 +25,6 @@ static int copy_restorer(void (*restorer)(void), unsigned long start,
sizeof(restorer))); sizeof(restorer)));
} }
static int copy_sc_to_user(void *to, struct pt_regs *from)
{
return(CHOOSE_MODE(copy_sc_to_user_tt(to, from->regs.mode.tt,
&signal_frame_sc_sr.arch),
copy_sc_to_user_skas(to, &from->regs,
current->thread.cr2,
current->thread.err)));
}
int setup_signal_stack_si(unsigned long stack_top, int sig, int setup_signal_stack_si(unsigned long stack_top, int sig,
unsigned long handler, void (*restorer)(void), unsigned long handler, void (*restorer)(void),
struct pt_regs *regs, siginfo_t *info, struct pt_regs *regs, siginfo_t *info,
...@@ -52,7 +43,8 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, ...@@ -52,7 +43,8 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
if(restorer == NULL) if(restorer == NULL)
panic("setup_signal_stack_si - no restorer"); panic("setup_signal_stack_si - no restorer");
if(copy_sc_to_user((void *) sc, regs) || if(copy_sc_to_user((void *) sc, regs->regs.sc,
&signal_frame_sc.arch) ||
copy_to_user((void *) start, signal_frame_si.common.data, copy_to_user((void *) start, signal_frame_si.common.data,
signal_frame_si.common.len) || signal_frame_si.common.len) ||
copy_to_user((void *) (start + signal_frame_si.common.sig_index), copy_to_user((void *) (start + signal_frame_si.common.sig_index),
...@@ -94,7 +86,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig, ...@@ -94,7 +86,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
if(copy_to_user((void *) start, frame->data, frame->len) || if(copy_to_user((void *) start, frame->data, frame->len) ||
copy_to_user((void *) (start + frame->sig_index), &sig, copy_to_user((void *) (start + frame->sig_index), &sig,
sizeof(sig)) || sizeof(sig)) ||
copy_sc_to_user(user_sc, regs) || copy_sc_to_user(user_sc, regs->regs.sc, &signal_frame_sc.arch) ||
copy_to_user(sc_sigmask(user_sc), mask, sizeof(mask->sig[0])) || copy_to_user(sc_sigmask(user_sc), mask, sizeof(mask->sig[0])) ||
copy_to_user((void *) sigs, &mask->sig[1], sig_size) || copy_to_user((void *) sigs, &mask->sig[1], sig_size) ||
copy_restorer(restorer, start, frame->sr_index, frame->sr_relative)) copy_restorer(restorer, start, frame->sr_index, frame->sr_relative))
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include "os.h" #include "os.h"
#include "user.h" #include "user.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment