diff options
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r-- | arch/um/os-Linux/registers.c | 13 | ||||
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 11 |
2 files changed, 12 insertions, 12 deletions
diff --git a/arch/um/os-Linux/registers.c b/arch/um/os-Linux/registers.c index a32ba6ab1211..c78fae3aba81 100644 --- a/arch/um/os-Linux/registers.c +++ b/arch/um/os-Linux/registers.c @@ -10,15 +10,6 @@ #include "sysdep/ptrace.h" #include "user.h" -/* This is set once at boot time and not changed thereafter */ - -static unsigned long exec_regs[MAX_REG_NR]; - -void init_thread_registers(struct uml_pt_regs *to) -{ - memcpy(to->gp, exec_regs, sizeof(to->gp)); -} - void save_registers(int pid, struct uml_pt_regs *regs) { int err; @@ -39,6 +30,10 @@ void restore_registers(int pid, struct uml_pt_regs *regs) "errno = %d\n", errno); } +/* This is set once at boot time and not changed thereafter */ + +static unsigned long exec_regs[MAX_REG_NR]; + void init_registers(int pid) { int err; diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 2cc2071112bc..7dc24e3cb190 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -300,7 +300,9 @@ void userspace(struct uml_pt_regs *regs) nsecs += os_nsecs(); while (1) { - restore_registers(pid, regs); + if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) + panic("userspace - PTRACE_SETREGS failed, " + "errno = %d\n", errno); /* Now we set local_using_sysemu to be used for one loop */ local_using_sysemu = get_using_sysemu(); @@ -320,7 +322,10 @@ void userspace(struct uml_pt_regs *regs) errno); regs->is_user = 1; - save_registers(pid, regs); + if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) + panic("userspace - saving registers failed, " + "errno = %d\n", errno); + UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ if (WIFSTOPPED(status)) { @@ -343,7 +348,7 @@ void userspace(struct uml_pt_regs *regs) break; case SIGVTALRM: now = os_nsecs(); - if(now < nsecs) + if (now < nsecs) break; block_signals(); (*sig_info[sig])(sig, regs); |