Lines Matching refs:pid
26 int is_skas_winch(int pid, int fd, void *data) in is_skas_winch() argument
28 return pid == getpgrp(); in is_skas_winch()
79 static int ptrace_dump_regs(int pid) in ptrace_dump_regs() argument
84 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in ptrace_dump_regs()
106 void wait_stub_done(int pid) in wait_stub_done() argument
111 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in wait_stub_done()
118 err = ptrace(PTRACE_CONT, pid, 0, 0); in wait_stub_done()
130 err = ptrace_dump_regs(pid); in wait_stub_done()
135 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, in wait_stub_done()
142 static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs) in get_skas_faultinfo() argument
146 err = get_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
152 err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV); in get_skas_faultinfo()
155 "errno = %d\n", pid, errno); in get_skas_faultinfo()
158 wait_stub_done(pid); in get_skas_faultinfo()
166 err = put_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
174 static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs) in handle_segv() argument
176 get_skas_faultinfo(pid, ®s->faultinfo, aux_fp_regs); in handle_segv()
184 static void handle_trap(int pid, struct uml_pt_regs *regs, in handle_trap() argument
194 err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in handle_trap()
202 err = ptrace(PTRACE_SYSCALL, pid, 0, 0); in handle_trap()
209 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in handle_trap()
212 err = ptrace_dump_regs(pid); in handle_trap()
316 int pid, status, n, flags, err; in start_userspace() local
335 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack); in start_userspace()
336 if (pid < 0) { in start_userspace()
344 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in start_userspace()
360 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in start_userspace()
375 return pid; in start_userspace()
378 os_kill_ptraced_process(pid, 1); in start_userspace()
384 int err, status, op, pid = userspace_pid[0]; in userspace() local
404 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) { in userspace()
410 if (put_fp_registers(pid, regs->fp)) { in userspace()
422 if (ptrace(op, pid, 0, 0)) { in userspace()
428 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in userspace()
436 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) { in userspace()
442 if (get_fp_registers(pid, regs->fp)) { in userspace()
464 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si); in userspace()
471 get_skas_faultinfo(pid, in userspace()
476 else handle_segv(pid, regs, aux_fp_regs); in userspace()
479 handle_trap(pid, regs, local_using_sysemu); in userspace()
500 pid = userspace_pid[0]; in userspace()
530 int copy_context_skas0(unsigned long new_stack, int pid) in copy_context_skas0() argument
554 err = ptrace_setregs(pid, thread_regs); in copy_context_skas0()
558 "failed, pid = %d, errno = %d\n", pid, -err); in copy_context_skas0()
562 err = put_fp_registers(pid, thread_fp_regs); in copy_context_skas0()
565 "failed, pid = %d, err = %d\n", pid, err); in copy_context_skas0()
573 err = ptrace(PTRACE_CONT, pid, 0, 0); in copy_context_skas0()
577 "errno = %d\n", pid, errno); in copy_context_skas0()
581 wait_stub_done(pid); in copy_context_skas0()
583 pid = data->parent_err; in copy_context_skas0()
584 if (pid < 0) { in copy_context_skas0()
586 "error %d\n", -pid); in copy_context_skas0()
587 return pid; in copy_context_skas0()
594 wait_stub_done(pid); in copy_context_skas0()
597 "error %ld\n", pid, data->child_err); in copy_context_skas0()
602 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in copy_context_skas0()
610 return pid; in copy_context_skas0()
613 os_kill_ptraced_process(pid, 1); in copy_context_skas0()
718 userspace_pid[0] = mm_idp->u.pid; in __switch_mm()