Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83190
b: refs/heads/master
c: d25f2e1
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 5, 2008
1 parent 4670700 commit 95a8ef4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee3d9bd4de1ed93d2a7ee41c331ed30a1c7b8acd
refs/heads/master: d25f2e1235aab716c9fd6ba36c42503627a3a0e3
1 change: 0 additions & 1 deletion trunk/arch/um/include/registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
arch_copy_thread(&current->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;
}
Expand Down
13 changes: 4 additions & 9 deletions trunk/arch/um/os-Linux/registers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
11 changes: 8 additions & 3 deletions trunk/arch/um/os-Linux/skas/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)) {
Expand All @@ -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);
Expand Down

0 comments on commit 95a8ef4

Please sign in to comment.