int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp, unsigned long stack_top, struct task_struct * p, struct pt_regs *regs) { void (*handler)(int); if(current->thread.forking){ memcpy(&p->thread.regs.regs.skas, ¤t->thread.regs.regs.skas, sizeof(p->thread.regs.regs.skas)); REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.skas.regs, 0); if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp; handler = fork_handler; } else { memcpy(p->thread.regs.regs.skas.regs, exec_regs, sizeof(p->thread.regs.regs.skas.regs)); memcpy(p->thread.regs.regs.skas.fp, exec_fp_regs, sizeof(p->thread.regs.regs.skas.fp)); memcpy(p->thread.regs.regs.skas.xfp, exec_fpx_regs, sizeof(p->thread.regs.regs.skas.xfp)); p->thread.request.u.thread = current->thread.request.u.thread; handler = new_thread_handler; } new_thread(p->thread_info, &p->thread.mode.skas.switch_buf, &p->thread.mode.skas.fork_buf, handler); return(0); }
int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp, unsigned long stack_top, struct task_struct * p, struct pt_regs *regs) { void (*handler)(int); if(current->thread.forking){ memcpy(&p->thread.regs.regs.skas, ®s->regs.skas, sizeof(p->thread.regs.regs.skas)); REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.skas.regs, 0); if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp; handler = fork_handler; arch_copy_thread(¤t->thread.arch, &p->thread.arch); } else { init_thread_registers(&p->thread.regs.regs); p->thread.request.u.thread = current->thread.request.u.thread; handler = new_thread_handler; } new_thread(task_stack_page(p), &p->thread.mode.skas.switch_buf, &p->thread.mode.skas.fork_buf, handler); return(0); }
void handle_syscall(struct uml_pt_regs *r) { struct pt_regs *regs = container_of(r, struct pt_regs, regs); long result; int syscall; syscall_trace(r, 0); /* * This should go in the declaration of syscall, but when I do that, * strace -f -c bash -c 'ls ; ls' breaks, sometimes not tracing * children at all, sometimes hanging when bash doesn't see the first * ls exit. * The assembly looks functionally the same to me. This is * gcc version 4.0.1 20050727 (Red Hat 4.0.1-5) * in case it's a compiler bug. */ syscall = UPT_SYSCALL_NR(r); if ((syscall >= NR_SYSCALLS) || (syscall < 0)) result = -ENOSYS; else result = EXECUTE_SYSCALL(syscall, regs); REGS_SET_SYSCALL_RETURN(r->gp, result); syscall_trace(r, 1); }
void handle_syscall(union uml_pt_regs *regs) { long result; int index; index = record_syscall_start(UPT_SYSCALL_NR(regs)); syscall_trace(); result = execute_syscall(regs); REGS_SET_SYSCALL_RETURN(regs->skas.regs, result); if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || (result == -ERESTARTNOINTR)) do_signal(result); syscall_trace(); record_syscall_end(index, result); }
void handle_syscall(union uml_pt_regs *regs) { long result; #ifdef UML_CONFIG_SYSCALL_DEBUG int index; index = record_syscall_start(UPT_SYSCALL_NR(regs)); #endif syscall_trace(regs, 0); result = execute_syscall_skas(regs); REGS_SET_SYSCALL_RETURN(regs->skas.regs, result); syscall_trace(regs, 1); #ifdef UML_CONFIG_SYSCALL_DEBUG record_syscall_end(index, result); #endif }