Lines Matching refs:pid

27 int is_skas_winch(int pid, int fd, void *data)  in is_skas_winch()  argument
29 return pid == getpgrp(); in is_skas_winch()
80 static int ptrace_dump_regs(int pid) in ptrace_dump_regs() argument
85 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in ptrace_dump_regs()
107 void wait_stub_done(int pid) in wait_stub_done() argument
112 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in wait_stub_done()
119 err = ptrace(PTRACE_CONT, pid, 0, 0); in wait_stub_done()
131 err = ptrace_dump_regs(pid); in wait_stub_done()
136 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, in wait_stub_done()
143 static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs) in get_skas_faultinfo() argument
147 err = get_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
153 err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV); in get_skas_faultinfo()
156 "errno = %d\n", pid, errno); in get_skas_faultinfo()
159 wait_stub_done(pid); in get_skas_faultinfo()
167 err = put_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
175 static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs) in handle_segv() argument
177 get_skas_faultinfo(pid, &regs->faultinfo, aux_fp_regs); in handle_segv()
185 static void handle_trap(int pid, struct uml_pt_regs *regs, in handle_trap() argument
195 err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in handle_trap()
203 err = ptrace(PTRACE_SYSCALL, pid, 0, 0); in handle_trap()
210 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in handle_trap()
213 err = ptrace_dump_regs(pid); in handle_trap()
317 int pid, status, n, flags, err; in start_userspace() local
336 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack); in start_userspace()
337 if (pid < 0) { in start_userspace()
345 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in start_userspace()
361 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in start_userspace()
376 return pid; in start_userspace()
379 os_kill_ptraced_process(pid, 1); in start_userspace()
385 int err, status, op, pid = userspace_pid[0]; in userspace() local
405 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) { in userspace()
411 if (put_fp_registers(pid, regs->fp)) { in userspace()
423 if (ptrace(op, pid, 0, 0)) { in userspace()
429 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in userspace()
437 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) { in userspace()
443 if (get_fp_registers(pid, regs->fp)) { in userspace()
465 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si); in userspace()
472 get_skas_faultinfo(pid, in userspace()
477 else handle_segv(pid, regs, aux_fp_regs); in userspace()
480 handle_trap(pid, regs, local_using_sysemu); in userspace()
501 pid = userspace_pid[0]; in userspace()
531 int copy_context_skas0(unsigned long new_stack, int pid) in copy_context_skas0() argument
555 err = ptrace_setregs(pid, thread_regs); in copy_context_skas0()
559 "failed, pid = %d, errno = %d\n", pid, -err); in copy_context_skas0()
563 err = put_fp_registers(pid, thread_fp_regs); in copy_context_skas0()
566 "failed, pid = %d, err = %d\n", pid, err); in copy_context_skas0()
574 err = ptrace(PTRACE_CONT, pid, 0, 0); in copy_context_skas0()
578 "errno = %d\n", pid, errno); in copy_context_skas0()
582 wait_stub_done(pid); in copy_context_skas0()
584 pid = data->parent_err; in copy_context_skas0()
585 if (pid < 0) { in copy_context_skas0()
587 "error %d\n", -pid); in copy_context_skas0()
588 return pid; in copy_context_skas0()
595 wait_stub_done(pid); in copy_context_skas0()
598 "error %ld\n", pid, data->child_err); in copy_context_skas0()
603 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in copy_context_skas0()
611 return pid; in copy_context_skas0()
614 os_kill_ptraced_process(pid, 1); in copy_context_skas0()
733 userspace_pid[0] = mm_idp->u.pid; in __switch_mm()