• Home
  • Raw
  • Download

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()
32 static int ptrace_dump_regs(int pid) in ptrace_dump_regs() argument
37 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in ptrace_dump_regs()
56 void wait_stub_done(int pid) in wait_stub_done() argument
61 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in wait_stub_done()
68 err = ptrace(PTRACE_CONT, pid, 0, 0); in wait_stub_done()
80 err = ptrace_dump_regs(pid); in wait_stub_done()
85 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, in wait_stub_done()
92 static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs) in get_skas_faultinfo() argument
96 err = get_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
102 err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV); in get_skas_faultinfo()
105 "errno = %d\n", pid, errno); in get_skas_faultinfo()
108 wait_stub_done(pid); in get_skas_faultinfo()
116 err = put_fp_registers(pid, aux_fp_regs); in get_skas_faultinfo()
124 static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs) in handle_segv() argument
126 get_skas_faultinfo(pid, &regs->faultinfo, aux_fp_regs); in handle_segv()
134 static void handle_trap(int pid, struct uml_pt_regs *regs, in handle_trap() argument
144 err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, in handle_trap()
152 err = ptrace(PTRACE_SYSCALL, pid, 0, 0); in handle_trap()
159 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in handle_trap()
162 err = ptrace_dump_regs(pid); in handle_trap()
270 int pid, status, n, flags, err; in start_userspace() local
289 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack); in start_userspace()
290 if (pid < 0) { in start_userspace()
298 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in start_userspace()
314 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in start_userspace()
329 return pid; in start_userspace()
332 os_kill_ptraced_process(pid, 1); in start_userspace()
338 int err, status, op, pid = userspace_pid[0]; in userspace() local
358 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) { in userspace()
364 if (put_fp_registers(pid, regs->fp)) { in userspace()
376 if (ptrace(op, pid, 0, 0)) { in userspace()
382 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); in userspace()
390 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) { in userspace()
396 if (get_fp_registers(pid, regs->fp)) { in userspace()
407 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si); in userspace()
412 get_skas_faultinfo(pid, in userspace()
417 else handle_segv(pid, regs, aux_fp_regs); in userspace()
420 handle_trap(pid, regs, local_using_sysemu); in userspace()
441 pid = userspace_pid[0]; in userspace()
471 int copy_context_skas0(unsigned long new_stack, int pid) in copy_context_skas0() argument
489 err = ptrace_setregs(pid, thread_regs); in copy_context_skas0()
493 "failed, pid = %d, errno = %d\n", pid, -err); in copy_context_skas0()
497 err = put_fp_registers(pid, thread_fp_regs); in copy_context_skas0()
500 "failed, pid = %d, err = %d\n", pid, err); in copy_context_skas0()
511 err = ptrace(PTRACE_CONT, pid, 0, 0); in copy_context_skas0()
515 "errno = %d\n", pid, errno); in copy_context_skas0()
519 wait_stub_done(pid); in copy_context_skas0()
521 pid = data->err; in copy_context_skas0()
522 if (pid < 0) { in copy_context_skas0()
524 "error %d\n", -pid); in copy_context_skas0()
525 return pid; in copy_context_skas0()
532 wait_stub_done(pid); in copy_context_skas0()
540 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, in copy_context_skas0()
548 return pid; in copy_context_skas0()
551 os_kill_ptraced_process(pid, 1); in copy_context_skas0()
670 userspace_pid[0] = mm_idp->u.pid; in __switch_mm()