diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2017-01-21 05:42:05 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2017-01-21 05:42:05 +0000 |
commit | 9a302bd2ce6b791c5c6ebe5666355ec437ac1d03 (patch) | |
tree | 9195deecdf0ac1af03e69b4df6433353d6454326 /sys/arch | |
parent | 6c1f34eaf54d82d737e660ad764b624602f89481 (diff) |
p_comm is the process's command and isn't per thread, so move it from
struct proc to struct process.
ok deraadt@ kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/interrupt.c | 4 | ||||
-rw-r--r-- | sys/arch/alpha/alpha/trap.c | 9 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 14 | ||||
-rw-r--r-- | sys/arch/arm/arm/fault.c | 6 | ||||
-rw-r--r-- | sys/arch/armv7/exynos/exesdhc.c | 4 | ||||
-rw-r--r-- | sys/arch/armv7/imx/imxesdhc.c | 4 | ||||
-rw-r--r-- | sys/arch/armv7/omap/ommmc.c | 4 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/fp_emulate.c | 6 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/pmap.c | 6 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/trap.c | 10 | ||||
-rw-r--r-- | sys/arch/sh/sh/db_interface.c | 13 | ||||
-rw-r--r-- | sys/arch/sh/sh/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/fpu/fpu.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/trap.c | 4 |
15 files changed, 48 insertions, 50 deletions
diff --git a/sys/arch/alpha/alpha/interrupt.c b/sys/arch/alpha/alpha/interrupt.c index d179c1309df..868be573661 100644 --- a/sys/arch/alpha/alpha/interrupt.c +++ b/sys/arch/alpha/alpha/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.39 2016/10/08 05:49:08 guenther Exp $ */ +/* $OpenBSD: interrupt.c,v 1.40 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $ */ /*- @@ -348,7 +348,7 @@ fatal: printf(" curproc = %p\n", curproc); if (curproc != NULL) printf(" pid = %d, comm = %s\n", curproc->p_p->ps_pid, - curproc->p_comm); + curproc->p_p->ps_comm); printf("\n"); panic("machine check"); } diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index abab88d9240..27f269393b1 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.82 2016/10/08 05:49:08 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.83 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -206,7 +206,7 @@ printtrap(const unsigned long a0, const unsigned long a1, printf(" curproc = %p\n", curproc); if (curproc != NULL) printf(" pid = %d, comm = %s\n", - curproc->p_p->ps_pid, curproc->p_comm); + curproc->p_p->ps_pid, curproc->p_p->ps_comm); printf("\n"); } @@ -459,7 +459,8 @@ do_fault: typ = SEGV_MAPERR; if (rv == ENOMEM) { printf("UVM: pid %u (%s), uid %d killed: " - "out of swap\n", p->p_p->ps_pid, p->p_comm, + "out of swap\n", p->p_p->ps_pid, + p->p_p->ps_comm, p->p_ucred ? (int)p->p_ucred->cr_uid : -1); i = SIGKILL; } else { @@ -982,7 +983,7 @@ unaligned_fixup(va, opcode, reg, p) if (doprint) { uprintf( "pid %u (%s): unaligned access: va=0x%lx pc=0x%lx ra=0x%lx op=", - p->p_p->ps_pid, p->p_comm, va, + p->p_p->ps_pid, p->p_p->ps_comm, va, p->p_md.md_tf->tf_regs[FRAME_PC] - 4, p->p_md.md_tf->tf_regs[FRAME_RA]); uprintf(selected_tab->type,opcode); diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 2fe0a90d458..237803c0d48 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.51 2016/10/08 05:49:08 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.52 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -245,7 +245,8 @@ copyfault: case T_NMI|T_USER: #ifdef TRAP_SIGDEBUG printf("pid %d (%s): %s at rip %llx addr %llx\n", - p->p_p->ps_pid, p->p_comm, "BUS", frame->tf_rip, rcr2()); + p->p_p->ps_pid, p->p_p->ps_comm, "BUS", + frame->tf_rip, rcr2()); frame_dump(frame); #endif sv.sival_ptr = (void *)frame->tf_rip; @@ -269,7 +270,8 @@ copyfault: case T_FPOPFLT|T_USER: /* coprocessor operand fault */ #ifdef TRAP_SIGDEBUG printf("pid %d (%s): %s at rip %llx addr %llx\n", - p->p_p->ps_pid, p->p_comm, "ILL", frame->tf_rip, rcr2()); + p->p_p->ps_pid, p->p_p->ps_comm, "ILL", + frame->tf_rip, rcr2()); frame_dump(frame); #endif sv.sival_ptr = (void *)frame->tf_rip; @@ -394,15 +396,15 @@ faultcommon: } if (error == ENOMEM) { printf("UVM: pid %d (%s), uid %d killed:" - " out of swap\n", p->p_p->ps_pid, p->p_comm, + " out of swap\n", p->p_p->ps_pid, p->p_p->ps_comm, p->p_ucred ? (int)p->p_ucred->cr_uid : -1); sv.sival_ptr = (void *)fa; trapsignal(p, SIGKILL, T_PAGEFLT, SEGV_MAPERR, sv); } else { #ifdef TRAP_SIGDEBUG printf("pid %d (%s): %s at rip %llx addr %llx\n", - p->p_p->ps_pid, p->p_comm, "SEGV", frame->tf_rip, - rcr2()); + p->p_p->ps_pid, p->p_p->ps_comm, "SEGV", + frame->tf_rip, rcr2()); frame_dump(frame); #endif sv.sival_ptr = (void *)fa; diff --git a/sys/arch/arm/arm/fault.c b/sys/arch/arm/arm/fault.c index 9d86ceca986..9ff47c590ba 100644 --- a/sys/arch/arm/arm/fault.c +++ b/sys/arch/arm/arm/fault.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fault.c,v 1.26 2017/01/06 00:06:02 jsg Exp $ */ +/* $OpenBSD: fault.c,v 1.27 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: fault.c,v 1.46 2004/01/21 15:39:21 skrll Exp $ */ /* @@ -348,7 +348,7 @@ data_abort_handler(trapframe_t *tf) sv.sival_ptr = (u_int32_t *)far; if (error == ENOMEM) { printf("UVM: pid %d (%s), uid %d killed: " - "out of swap\n", p->p_p->ps_pid, p->p_comm, + "out of swap\n", p->p_p->ps_pid, p->p_p->ps_comm, p->p_ucred ? (int)p->p_ucred->cr_uid : -1); sd.signo = SIGKILL; } else @@ -621,7 +621,7 @@ prefetch_abort_handler(trapframe_t *tf) sv.sival_ptr = (u_int32_t *)far; if (error == ENOMEM) { printf("UVM: pid %d (%s), uid %d killed: " - "out of swap\n", p->p_p->ps_pid, p->p_comm, + "out of swap\n", p->p_p->ps_pid, p->p_p->ps_comm, p->p_ucred ? (int)p->p_ucred->cr_uid : -1); trapsignal(p, SIGKILL, 0, SEGV_MAPERR, sv); } else diff --git a/sys/arch/armv7/exynos/exesdhc.c b/sys/arch/armv7/exynos/exesdhc.c index 9f63345a6d7..8f61bc9a442 100644 --- a/sys/arch/armv7/exynos/exesdhc.c +++ b/sys/arch/armv7/exynos/exesdhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exesdhc.c,v 1.8 2016/07/26 22:10:10 patrick Exp $ */ +/* $OpenBSD: exesdhc.c,v 1.9 2017/01/21 05:42:03 guenther Exp $ */ /* * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -679,7 +679,7 @@ exesdhc_start_command(struct exesdhc_softc *sc, struct sdmmc_command *cmd) DPRINTF(1,("%s: start cmd %u arg=%#x data=%p dlen=%d flags=%#x " "proc=\"%s\"\n", HDEVNAME(sc), cmd->c_opcode, cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags, curproc ? - curproc->p_comm : "")); + curproc->p_p->ps_comm : "")); /* * The maximum block length for commands should be the minimum diff --git a/sys/arch/armv7/imx/imxesdhc.c b/sys/arch/armv7/imx/imxesdhc.c index 6cec0554de6..0022de6c682 100644 --- a/sys/arch/armv7/imx/imxesdhc.c +++ b/sys/arch/armv7/imx/imxesdhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxesdhc.c,v 1.35 2016/12/28 22:45:24 kettenis Exp $ */ +/* $OpenBSD: imxesdhc.c,v 1.36 2017/01/21 05:42:03 guenther Exp $ */ /* * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -857,7 +857,7 @@ imxesdhc_start_command(struct imxesdhc_softc *sc, struct sdmmc_command *cmd) DPRINTF(1,("%s: start cmd %u arg=%#x data=%p dlen=%d flags=%#x " "proc=\"%s\"\n", HDEVNAME(sc), cmd->c_opcode, cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags, curproc ? - curproc->p_comm : "")); + curproc->p_p->ps_comm : "")); /* * The maximum block length for commands should be the minimum diff --git a/sys/arch/armv7/omap/ommmc.c b/sys/arch/armv7/omap/ommmc.c index 184f182d8cf..ee25c31a42e 100644 --- a/sys/arch/armv7/omap/ommmc.c +++ b/sys/arch/armv7/omap/ommmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ommmc.c,v 1.30 2016/10/08 03:42:20 jsg Exp $ */ +/* $OpenBSD: ommmc.c,v 1.31 2017/01/21 05:42:03 guenther Exp $ */ /* * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org> @@ -908,7 +908,7 @@ ommmc_start_command(struct ommmc_softc *sc, struct sdmmc_command *cmd) DPRINTF(1,("%s: start cmd %u arg=%#x data=%p dlen=%d flags=%#x " "proc=\"%s\"\n", DEVNAME(sc), cmd->c_opcode, cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags, curproc ? - curproc->p_comm : "")); + curproc->p_p->ps_comm : "")); /* * The maximum block length for commands should be the minimum diff --git a/sys/arch/mips64/mips64/fp_emulate.c b/sys/arch/mips64/mips64/fp_emulate.c index a7e0d213c8e..50251be956f 100644 --- a/sys/arch/mips64/mips64/fp_emulate.c +++ b/sys/arch/mips64/mips64/fp_emulate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fp_emulate.c,v 1.14 2016/03/06 19:42:27 mpi Exp $ */ +/* $OpenBSD: fp_emulate.c,v 1.15 2017/01/21 05:42:03 guenther Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -201,11 +201,11 @@ MipsFPTrap(struct trapframe *tf) #ifdef DEBUG #ifdef DDB printf("%s: unimplemented FPU completion, fsr 0x%08x\n0x%lx: ", - p->p_comm, fsr, pc); + p->p_p->ps_comm, fsr, pc); dbmd_print_insn(insn, pc, printf); #else printf("%s: unimplemented FPU completion, insn 0x%08x fsr 0x%08x\n", - p->p_comm, insn, fsr); + p->p_p->ps_comm, insn, fsr); #endif #endif diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c index 89692551ffd..6b82703f250 100644 --- a/sys/arch/mips64/mips64/pmap.c +++ b/sys/arch/mips64/mips64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.100 2017/01/02 18:19:34 visa Exp $ */ +/* $OpenBSD: pmap.c,v 1.101 2017/01/21 05:42:03 guenther Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -1822,13 +1822,13 @@ pmap_alloc_tlbpid(struct proc *p) if (curproc) { DPRINTF(PDB_FOLLOW|PDB_TLBPID, ("pmap_alloc_tlbpid: curproc %d '%s' ", - curproc->p_p->ps_pid, curproc->p_comm)); + curproc->p_p->ps_pid, curproc->p_p->ps_comm)); } else { DPRINTF(PDB_FOLLOW|PDB_TLBPID, ("pmap_alloc_tlbpid: curproc <none> ")); } DPRINTF(PDB_FOLLOW|PDB_TLBPID, ("segtab %p tlbpid %u pid %d '%s'\n", - pmap->pm_segtab, id, p->p_p->ps_pid, p->p_comm)); + pmap->pm_segtab, id, p->p_p->ps_pid, p->p_p->ps_comm)); return (id); } diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index 7539154a7a1..817686c30e1 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.121 2016/10/19 08:28:20 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.122 2017/01/21 05:42:03 guenther Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -614,7 +614,7 @@ fault_common_no_miss: #ifdef DEBUG printf("trap: %s (%d): breakpoint at %p " "(insn %08x)\n", - p->p_comm, p->p_p->ps_pid, + p->p_p->ps_comm, p->p_p->ps_pid, (void *)p->p_md.md_ss_addr, p->p_md.md_ss_instr); #endif @@ -1075,7 +1075,7 @@ process_sstep(struct proc *p, int sstep) if (rc != 0) printf("WARNING: %s (%d): can't restore " "instruction at %p: %08x\n", - p->p_comm, p->p_p->ps_pid, + p->p_p->ps_comm, p->p_p->ps_pid, (void *)p->p_md.md_ss_addr, p->p_md.md_ss_instr); #endif @@ -1101,7 +1101,7 @@ process_sstep(struct proc *p, int sstep) if (p->p_md.md_ss_addr != 0) { printf("WARNING: %s (%d): breakpoint request " "at %p, already set at %p\n", - p->p_comm, p->p_p->ps_pid, (void *)va, + p->p_p->ps_comm, p->p_p->ps_pid, (void *)va, (void *)p->p_md.md_ss_addr); return EFAULT; } @@ -1121,7 +1121,7 @@ process_sstep(struct proc *p, int sstep) #ifdef DEBUG printf("%s (%d): breakpoint set at %p: %08x (pc %p %08x)\n", - p->p_comm, p->p_p->ps_pid, (void *)p->p_md.md_ss_addr, + p->p_p->ps_comm, p->p_p->ps_pid, (void *)p->p_md.md_ss_addr, p->p_md.md_ss_instr, (void *)locr0->pc, curinstr); #endif return 0; diff --git a/sys/arch/sh/sh/db_interface.c b/sys/arch/sh/sh/db_interface.c index 2f518091531..6c0de3baf2e 100644 --- a/sys/arch/sh/sh/db_interface.c +++ b/sys/arch/sh/sh/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.8 2016/05/18 20:21:13 guenther Exp $ */ +/* $OpenBSD: db_interface.c,v 1.9 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: db_interface.c,v 1.37 2006/09/06 00:11:49 uwe Exp $ */ /*- @@ -368,15 +368,10 @@ __db_procname_by_asid(int asid) { static char notfound[] = "---"; struct process *pr; - struct proc *p; LIST_FOREACH(pr, &allprocess, ps_list) { - /* find a thread that still has the process vmspace attached */ - TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) - if (p->p_vmspace != NULL) - break; - if (p != NULL && p->p_vmspace->vm_map.pmap->pm_asid == asid) - return (p->p_comm); + if (pr->ps_vmspace->vm_map.pmap->pm_asid == asid) + return (pr->ps_comm); } return (notfound); @@ -643,7 +638,7 @@ db_stackcheck_cmd(db_expr_t addr, int have_addr, db_expr_t count, pcb->pcb_sf.sf_r7_bank, i, i * 100 / MAX_STACK, (vaddr_t)pcb + PAGE_SIZE, j, j * 100 / MAX_FRAME, j / sizeof(struct trapframe), - p->p_comm); + p->p_p->ps_comm); } #undef MAX_STACK #undef MAX_FRAME diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c index 37f9cc9a748..bf0bd8415c9 100644 --- a/sys/arch/sh/sh/trap.c +++ b/sys/arch/sh/sh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.36 2016/10/08 05:49:09 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.37 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */ /* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */ @@ -437,7 +437,7 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va) sv.sival_ptr = (void *)va; if (err == ENOMEM) { printf("UVM: pid %d (%s), uid %d killed: out of swap\n", - p->p_p->ps_pid, p->p_comm, + p->p_p->ps_pid, p->p_p->ps_comm, p->p_ucred ? (int)p->p_ucred->cr_uid : -1); trapsignal(p, SIGKILL, tf->tf_expevt, SEGV_MAPERR, sv); } else diff --git a/sys/arch/sparc64/fpu/fpu.c b/sys/arch/sparc64/fpu/fpu.c index 5961219f580..db0b0bd51eb 100644 --- a/sys/arch/sparc64/fpu/fpu.c +++ b/sys/arch/sparc64/fpu/fpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu.c,v 1.19 2016/10/08 05:49:09 guenther Exp $ */ +/* $OpenBSD: fpu.c,v 1.20 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */ /* @@ -237,9 +237,9 @@ fpu_cleanup(p, fs) case FSR_TT_HWERR: log(LOG_ERR, "fpu hardware error (%s[%d])\n", - p->p_comm, p->p_p->ps_pid); + p->p_p->ps_comm, p->p_p->ps_pid); uprintf("%s[%d]: fpu hardware error\n", - p->p_comm, p->p_p->ps_pid); + p->p_p->ps_comm, p->p_p->ps_pid); KERNEL_LOCK(); trapsignal(p, SIGFPE, -1, FPE_FLTINV, sv); /* ??? */ KERNEL_UNLOCK(); diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 53d0e08bf8c..3c66d8e772c 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.182 2017/01/13 09:18:11 fcambus Exp $ */ +/* $OpenBSD: machdep.c,v 1.183 2017/01/21 05:42:03 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -496,7 +496,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, #ifdef DEBUG if (sigdebug & SDB_FOLLOW) { printf("sendsig: %s[%d] sig %d scp %p\n", - p->p_comm, p->p_p->ps_pid, sig, &fp->sf_sc); + p->p_p->ps_comm, p->p_p->ps_pid, sig, &fp->sf_sc); } #endif diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 107831b43cc..b19fd57df07 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.96 2016/12/20 13:47:38 jsg Exp $ */ +/* $OpenBSD: trap.c,v 1.97 2017/01/21 05:42:04 guenther Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -866,7 +866,7 @@ kfault: if (rv == ENOMEM) { printf("UVM: pid %d (%s), uid %d killed: out of swap\n", - p->p_p->ps_pid, p->p_comm, + p->p_p->ps_pid, p->p_p->ps_comm, p->p_ucred ? (int)p->p_ucred->cr_uid : -1); trapsignal(p, SIGKILL, access_type, SEGV_MAPERR, sv); } else { |