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()
31 static int ptrace_dump_regs(int pid) in ptrace_dump_regs() argument
36 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in ptrace_dump_regs()
55 void wait_stub_done(int pid) in wait_stub_done() argument
60 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in wait_stub_done()
67 err = ptrace(PTRACE_CONT, pid, 0, 0); in wait_stub_done()
79 err = ptrace_dump_regs(pid); in wait_stub_done()
84 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, in wait_stub_done()
91 static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs) in get_skas_faultinfo() argument
95 err = get_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
101 err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV); in get_skas_faultinfo()
104 "errno = %d\n", pid, errno); in get_skas_faultinfo()
107 wait_stub_done(pid); in get_skas_faultinfo()
115 err = put_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
123 static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs) in handle_segv() argument
125 get_skas_faultinfo(pid, ®s->faultinfo, aux_fp_regs); in handle_segv()
133 static void handle_trap(int pid, struct uml_pt_regs *regs, in handle_trap() argument
143 err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in handle_trap()
151 err = ptrace(PTRACE_SYSCALL, pid, 0, 0); in handle_trap()
158 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in handle_trap()
161 err = ptrace_dump_regs(pid); in handle_trap()
268 int pid, status, n, flags, err; in start_userspace() local
287 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack); in start_userspace()
288 if (pid < 0) { in start_userspace()
296 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in start_userspace()
312 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in start_userspace()
327 return pid; in start_userspace()
330 os_kill_ptraced_process(pid, 1); in start_userspace()
336 int err, status, op, pid = userspace_pid[0]; in userspace() local
354 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) { in userspace()
360 if (put_fp_registers(pid, regs->fp)) { in userspace()
372 if (ptrace(op, pid, 0, 0)) { in userspace()
378 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in userspace()
386 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) { in userspace()
392 if (get_fp_registers(pid, regs->fp)) { in userspace()
403 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si); in userspace()
408 get_skas_faultinfo(pid, in userspace()
413 else handle_segv(pid, regs, aux_fp_regs); in userspace()
416 handle_trap(pid, regs, local_using_sysemu); in userspace()
437 pid = userspace_pid[0]; in userspace()
467 int copy_context_skas0(unsigned long new_stack, int pid) in copy_context_skas0() argument
485 err = ptrace_setregs(pid, thread_regs); in copy_context_skas0()
489 "failed, pid = %d, errno = %d\n", pid, -err); in copy_context_skas0()
493 err = put_fp_registers(pid, thread_fp_regs); in copy_context_skas0()
496 "failed, pid = %d, err = %d\n", pid, err); in copy_context_skas0()
507 err = ptrace(PTRACE_CONT, pid, 0, 0); in copy_context_skas0()
511 "errno = %d\n", pid, errno); in copy_context_skas0()
515 wait_stub_done(pid); in copy_context_skas0()
517 pid = data->err; in copy_context_skas0()
518 if (pid < 0) { in copy_context_skas0()
520 "error %d\n", -pid); in copy_context_skas0()
521 return pid; in copy_context_skas0()
528 wait_stub_done(pid); in copy_context_skas0()
536 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in copy_context_skas0()
544 return pid; in copy_context_skas0()
547 os_kill_ptraced_process(pid, 1); in copy_context_skas0()
652 userspace_pid[0] = mm_idp->u.pid; in __switch_mm()