uml: use ptrace directly in libc code

Some register accessor cleanups -
	userspace() was calling restore_registers and save_registers for no
reason, since userspace() is on the libc side of the house, and these
add no value over calling ptrace directly
	init_thread_registers and get_safe_registers were the same thing,
so init_thread_registers is gone

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jeff Dike
2008-02-04 22:30:57 -08:00
committed by Linus Torvalds
parent ee3d9bd4de
commit d25f2e1235
4 changed files with 13 additions and 14 deletions

View File

@ -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);