aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/skas/process.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-02-07 15:58:43 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-07 19:12:32 -0500
commite2216feb37f1df65a29fb1e5ed41d9f7ba657b2c (patch)
tree445da277a6f0202c6de853474f846467bf2dd7b7 /arch/um/os-Linux/skas/process.c
parent43b00fdbb13bfc1b2f4a8e5b65315db6d9c479a3 (diff)
[PATCH] uml: initialize process FP registers properly
We weren't making sure that we initialized the FP registers of new processes to sane values. This patch also moves some defines in the affected area closer to where they are used. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux/skas/process.c')
-rw-r--r--arch/um/os-Linux/skas/process.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 120a21c5883f..bbf34cb91ce1 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -310,16 +310,12 @@ void userspace(union uml_pt_regs *regs)
310 } 310 }
311 } 311 }
312} 312}
313#define INIT_JMP_NEW_THREAD 0
314#define INIT_JMP_REMOVE_SIGSTACK 1
315#define INIT_JMP_CALLBACK 2
316#define INIT_JMP_HALT 3
317#define INIT_JMP_REBOOT 4
318 313
319int copy_context_skas0(unsigned long new_stack, int pid) 314int copy_context_skas0(unsigned long new_stack, int pid)
320{ 315{
321 int err; 316 int err;
322 unsigned long regs[MAX_REG_NR]; 317 unsigned long regs[HOST_FRAME_SIZE];
318 unsigned long fp_regs[HOST_FP_SIZE];
323 unsigned long current_stack = current_stub_stack(); 319 unsigned long current_stack = current_stub_stack();
324 struct stub_data *data = (struct stub_data *) current_stack; 320 struct stub_data *data = (struct stub_data *) current_stack;
325 struct stub_data *child_data = (struct stub_data *) new_stack; 321 struct stub_data *child_data = (struct stub_data *) new_stack;
@@ -334,7 +330,7 @@ int copy_context_skas0(unsigned long new_stack, int pid)
334 .timer = ((struct itimerval) 330 .timer = ((struct itimerval)
335 { { 0, 1000000 / hz() }, 331 { { 0, 1000000 / hz() },
336 { 0, 1000000 / hz() }})}); 332 { 0, 1000000 / hz() }})});
337 get_safe_registers(regs); 333 get_safe_registers(regs, fp_regs);
338 334
339 /* Set parent's instruction pointer to start of clone-stub */ 335 /* Set parent's instruction pointer to start of clone-stub */
340 regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE + 336 regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE +
@@ -350,6 +346,11 @@ int copy_context_skas0(unsigned long new_stack, int pid)
350 panic("copy_context_skas0 : PTRACE_SETREGS failed, " 346 panic("copy_context_skas0 : PTRACE_SETREGS failed, "
351 "pid = %d, errno = %d\n", pid, errno); 347 "pid = %d, errno = %d\n", pid, errno);
352 348
349 err = ptrace_setfpregs(pid, fp_regs);
350 if(err < 0)
351 panic("copy_context_skas0 : PTRACE_SETFPREGS failed, "
352 "pid = %d, errno = %d\n", pid, errno);
353
353 /* set a well known return code for detection of child write failure */ 354 /* set a well known return code for detection of child write failure */
354 child_data->err = 12345678; 355 child_data->err = 12345678;
355 356
@@ -457,6 +458,12 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
457 set_signals(flags); 458 set_signals(flags);
458} 459}
459 460
461#define INIT_JMP_NEW_THREAD 0
462#define INIT_JMP_REMOVE_SIGSTACK 1
463#define INIT_JMP_CALLBACK 2
464#define INIT_JMP_HALT 3
465#define INIT_JMP_REBOOT 4
466
460void thread_wait(void *sw, void *fb) 467void thread_wait(void *sw, void *fb)
461{ 468{
462 sigjmp_buf buf, **switch_buf = sw, *fork_buf; 469 sigjmp_buf buf, **switch_buf = sw, *fork_buf;