#include "sysdep/ptrace.h"
#include "sysdep/archsetjmp.h"
-extern void init_thread_registers(struct uml_pt_regs *to);
extern int save_fp_registers(int pid, unsigned long *fp_regs);
extern int restore_fp_registers(int pid, unsigned long *fp_regs);
extern int save_fpx_registers(int pid, unsigned long *fp_regs);
arch_copy_thread(¤t->thread.arch, &p->thread.arch);
}
else {
- init_thread_registers(&p->thread.regs.regs);
+ get_safe_registers(p->thread.regs.regs.gp);
p->thread.request.u.thread = current->thread.request.u.thread;
handler = new_thread_handler;
}
#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;
"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;
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();
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)) {
break;
case SIGVTALRM:
now = os_nsecs();
- if(now < nsecs)
+ if (now < nsecs)
break;
block_signals();
(*sig_info[sig])(sig, regs);