diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-03-26 05:23:43 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-03-26 05:23:43 +0000 |
commit | 87c550209612d49384b0a8f1177ea278fc14bbc7 (patch) | |
tree | b3a354d29c205e40b172f436bbd2f6299a6aef4f /sys/arch | |
parent | f11198840aef6a17a2ba3d8668ef653d8adb535f (diff) |
Move p_emul and p_sigcode from proc to process.
Tweak the handling of ktrace EMUL when changing ktracing: only
generate one per process (not one per thread) and pass the correct
proc pointer down to the VFS layer. Permit generating of NAMI and
CSW records inside ktrace(2) itself.
ok deraadt@ millert@
Diffstat (limited to 'sys/arch')
30 files changed, 106 insertions, 104 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index a806c5f8a46..55c135ee2d1 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.151 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.152 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */ /*- @@ -1524,7 +1524,7 @@ trash: /* * Set up the registers to return to sigcode. */ - frame->tf_regs[FRAME_PC] = p->p_sigcode; + frame->tf_regs[FRAME_PC] = p->p_p->ps_sigcode; frame->tf_regs[FRAME_A0] = sig; frame->tf_regs[FRAME_A1] = (u_int64_t)sip; frame->tf_regs[FRAME_A2] = (u_int64_t)scp; diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 4c945408157..4187e09b57b 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.69 2014/02/06 05:14:12 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.70 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -549,8 +549,8 @@ syscall(code, framep) p->p_md.md_tf = framep; opc = framep->tf_regs[FRAME_PC] - 4; - callp = p->p_emul->e_sysent; - numsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + numsys = p->p_p->ps_emul->e_nsysent; switch(code) { case SYS_syscall: @@ -570,7 +570,7 @@ syscall(code, framep) if (code < numsys) callp += code; else - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; nargs = callp->sy_narg + hidden; switch (nargs) { diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index f8b43ad877d..bf473a4d68e 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.175 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.176 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -608,7 +608,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->tf_rsi = sip; tf->tf_rdx = scp; - tf->tf_rip = (u_int64_t)p->p_sigcode; + tf->tf_rip = (u_int64_t)p->p_p->ps_sigcode; tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); tf->tf_rflags &= ~(PSL_T|PSL_D|PSL_VM|PSL_AC); tf->tf_rsp = scp; diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 52e32c5a5ad..0478cd12e99 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.33 2014/02/13 23:11:06 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.34 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -507,8 +507,8 @@ syscall(struct trapframe *frame) p = curproc; code = frame->tf_rax; - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; argp = &args[0]; argoff = 0; @@ -527,7 +527,7 @@ syscall(struct trapframe *frame) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else callp += code; diff --git a/sys/arch/arm/arm/sig_machdep.c b/sys/arch/arm/arm/sig_machdep.c index 87ce5695107..77f19178d33 100644 --- a/sys/arch/arm/arm/sig_machdep.c +++ b/sys/arch/arm/arm/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.10 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.11 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: sig_machdep.c,v 1.22 2003/10/08 00:28:41 thorpej Exp $ */ /* @@ -162,7 +162,7 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, tf->tf_pc = (int)frame.sf_handler; tf->tf_usr_sp = (int)fp; - tf->tf_usr_lr = (int)p->p_sigcode; + tf->tf_usr_lr = (int)p->p_p->ps_sigcode; } /* diff --git a/sys/arch/arm/arm/syscall.c b/sys/arch/arm/arm/syscall.c index 45ec8ebcfe5..4e808e329cf 100644 --- a/sys/arch/arm/arm/syscall.c +++ b/sys/arch/arm/arm/syscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.c,v 1.15 2012/08/07 05:16:53 guenther Exp $ */ +/* $OpenBSD: syscall.c,v 1.16 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: syscall.c,v 1.24 2003/11/14 19:03:17 scw Exp $ */ /*- @@ -112,7 +112,7 @@ swi_handler(trapframe_t *frame) code = frame->tf_r12; ap = &frame->tf_r0; - callp = p->p_emul->e_sysent; + callp = p->p_p->ps_emul->e_sysent; switch (code) { case SYS_syscall: @@ -126,8 +126,8 @@ swi_handler(trapframe_t *frame) break; } - if (code < 0 || code >= p->p_emul->e_nsysent) { - callp += p->p_emul->e_nosys; + if (code < 0 || code >= p->p_p->ps_emul->e_nsysent) { + callp += p->p_p->ps_emul->e_nosys; } else { callp += code; } diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index 7b8670f650b..ae373be5f2d 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.215 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.216 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -1302,7 +1302,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->tf_arg2 = tf->tf_r4 = scp; tf->tf_arg3 = (register_t)catcher; tf->tf_ipsw &= ~(PSL_N|PSL_B|PSL_T); - tf->tf_iioq_head = HPPA_PC_PRIV_USER | p->p_sigcode; + tf->tf_iioq_head = HPPA_PC_PRIV_USER | p->p_p->ps_sigcode; tf->tf_iioq_tail = tf->tf_iioq_head + 4; tf->tf_iisq_tail = tf->tf_iisq_head = pcb->pcb_space; /* disable tracing in the trapframe */ diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 66f6c5b6e28..ae6384a8e44 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.127 2013/04/10 20:55:34 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.128 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -798,8 +798,8 @@ syscall(struct trapframe *frame) panic("syscall"); p->p_md.md_regs = frame; - nsys = p->p_emul->e_nsysent; - callp = p->p_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; argoff = 4; retq = 0; switch (code = frame->tf_t1) { @@ -833,7 +833,7 @@ syscall(struct trapframe *frame) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; /* bad syscall # */ + callp += p->p_p->ps_emul->e_nosys; /* bad syscall # */ else callp += code; diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index 724b82edc27..b9b5427fcc0 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.55 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.56 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -900,7 +900,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->tf_args[2] = tf->tf_r4 = scp; tf->tf_args[3] = (register_t)catcher; tf->tf_ipsw &= ~(PSL_N|PSL_B|PSL_T); - tf->tf_iioq[0] = HPPA_PC_PRIV_USER | p->p_sigcode; + tf->tf_iioq[0] = HPPA_PC_PRIV_USER | p->p_p->ps_sigcode; tf->tf_iioq[1] = tf->tf_iioq[0] + 4; tf->tf_iisq[0] = tf->tf_iisq[1] = pcb->pcb_space; /* disable tracing in the trapframe */ diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c index 8646247343c..acd1c5948da 100644 --- a/sys/arch/hppa64/hppa64/trap.c +++ b/sys/arch/hppa64/hppa64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.33 2012/12/31 06:46:13 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.34 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -574,8 +574,8 @@ syscall(struct trapframe *frame) panic("syscall"); p->p_md.md_regs = frame; - nsys = p->p_emul->e_nsysent; - callp = p->p_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; switch (code = frame->tf_r1) { case SYS_syscall: @@ -602,7 +602,7 @@ syscall(struct trapframe *frame) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; /* bad syscall # */ + callp += p->p_p->ps_emul->e_nosys; /* bad syscall # */ else callp += code; diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c index ffa82f656f4..81d4081d6f0 100644 --- a/sys/arch/i386/i386/linux_machdep.c +++ b/sys/arch/i386/i386/linux_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_machdep.c,v 1.44 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: linux_machdep.c,v 1.45 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */ /* @@ -179,7 +179,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, */ tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL); tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL); - tf->tf_eip = p->p_sigcode; + tf->tf_eip = p->p_p->ps_sigcode; tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); tf->tf_eflags &= ~(PSL_T|PSL_D|PSL_VM|PSL_AC); tf->tf_esp = (int)fp; @@ -283,7 +283,7 @@ linux_read_ldt(struct proc *p, struct linux_sys_modify_ldt_args *uap, if (user_ldt_enable == 0) return (ENOSYS); - sg = stackgap_init(p->p_emul); + sg = stackgap_init(p); gl.start = 0; gl.desc = SCARG(uap, ptr); @@ -333,7 +333,7 @@ linux_write_ldt(struct proc *p, struct linux_sys_modify_ldt_args *uap, if (ldt_info.contents == 3) return (EINVAL); - sg = stackgap_init(p->p_emul); + sg = stackgap_init(p); sd.sd_lobase = ldt_info.base_addr & 0xffffff; sd.sd_hibase = (ldt_info.base_addr >> 24) & 0xff; @@ -529,7 +529,7 @@ linux_machdepioctl(struct proc *p, void *v, register_t *retval) return error; lvt.frsig = sig; - sg = stackgap_init(p->p_emul); + sg = stackgap_init(p); bvtp = stackgap_alloc(&sg, sizeof (struct vt_mode)); if ((error = copyout(&lvt, bvtp, sizeof (struct vt_mode)))) return error; diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 26c177d02f9..fca0ad8b2b0 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.534 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.535 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -2401,7 +2401,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->tf_gs = GSEL(GUGS_SEL, SEL_UPL); tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL); tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL); - tf->tf_eip = p->p_sigcode; + tf->tf_eip = p->p_p->ps_sigcode; tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); tf->tf_eflags &= ~(PSL_T|PSL_D|PSL_VM|PSL_AC); tf->tf_esp = (int)fp; diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 73f4d190ebd..216d16656fa 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.112 2014/03/07 07:47:14 gerhard Exp $ */ +/* $OpenBSD: trap.c,v 1.113 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -562,8 +562,8 @@ syscall(struct trapframe *frame) opc = frame->tf_eip; code = frame->tf_eax; - nsys = p->p_emul->e_nsysent; - callp = p->p_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; params = (caddr_t)frame->tf_esp + sizeof(int); @@ -582,7 +582,7 @@ syscall(struct trapframe *frame) case SYS_syscall: #ifdef COMPAT_LINUX /* Linux has a special system setup call as number 0 */ - if (p->p_emul == &emul_linux_elf) + if (p->p_p->ps_emul == &emul_linux_elf) break; #endif /* @@ -605,13 +605,13 @@ syscall(struct trapframe *frame) break; } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; /* illegal */ + callp += p->p_p->ps_emul->e_nosys; /* illegal */ else callp += code; argsize = callp->sy_argsize; #ifdef COMPAT_LINUX /* XXX extra if() for every emul type.. */ - if (p->p_emul == &emul_linux_elf) { + if (p->p_p->ps_emul == &emul_linux_elf) { /* * Linux passes the args in ebx, ecx, edx, esi, edi, ebp, in * increasing order. @@ -666,8 +666,8 @@ syscall(struct trapframe *frame) break; default: bad: - if (p->p_emul->e_errno && error >= 0 && error <= ELAST) - frame->tf_eax = p->p_emul->e_errno[error]; + if (p->p_p->ps_emul->e_errno && error >= 0 && error <= ELAST) + frame->tf_eax = p->p_p->ps_emul->e_errno[error]; else frame->tf_eax = error; frame->tf_eflags |= PSL_C; /* carry bit */ diff --git a/sys/arch/m88k/m88k/sig_machdep.c b/sys/arch/m88k/m88k/sig_machdep.c index 518dad599e6..95a558177c9 100644 --- a/sys/arch/m88k/m88k/sig_machdep.c +++ b/sys/arch/m88k/m88k/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.17 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.18 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -154,7 +154,7 @@ sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type, /* * Set up registers for the signal handler invocation. */ - tf->tf_r[1] = p->p_sigcode; /* return to sigcode */ + tf->tf_r[1] = p->p_p->ps_sigcode; /* return to sigcode */ tf->tf_r[2] = sig; /* first arg is signo */ tf->tf_r[3] = psp->ps_siginfo & sigmask(sig) ? (vaddr_t)&fp->sf_si : 0; tf->tf_r[4] = (vaddr_t)&fp->sf_sc; diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index d5207d50c51..e9c90127a41 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.88 2013/09/05 20:40:32 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.89 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -1181,8 +1181,8 @@ m88100_syscall(register_t code, struct trapframe *tf) uvmexp.syscalls++; - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; p->p_md.md_tf = tf; @@ -1211,7 +1211,7 @@ m88100_syscall(register_t code, struct trapframe *tf) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else callp += code; @@ -1302,8 +1302,8 @@ m88110_syscall(register_t code, struct trapframe *tf) uvmexp.syscalls++; - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; p->p_md.md_tf = tf; @@ -1332,7 +1332,7 @@ m88110_syscall(register_t code, struct trapframe *tf) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else callp += code; diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index dcb9058cd41..344e2e83593 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.146 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.147 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -571,11 +571,12 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->fixreg[3] = (int)sig; tf->fixreg[4] = (psp->ps_siginfo & sigmask(sig)) ? (int)&fp->sf_si : 0; tf->fixreg[5] = (int)&fp->sf_sc; - tf->srr0 = p->p_sigcode; + tf->srr0 = p->p_p->ps_sigcode; #if WHEN_WE_ONLY_FLUSH_DATA_WHEN_DOING_PMAP_ENTER pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map),tf->srr0, &pa); - syncicache(pa, (p->p_emul->e_esigcode - p->p_emul->e_sigcode)); + syncicache(pa, (p->p_p->ps_emul->e_esigcode - + p->p_p->ps_emul->e_sigcode)); #endif } diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c index 826cf2157ff..48bfcb1bd4b 100644 --- a/sys/arch/mips64/mips64/sendsig.c +++ b/sys/arch/mips64/mips64/sendsig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendsig.c,v 1.21 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: sendsig.c,v 1.22 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -191,7 +191,7 @@ bail: regs->t9 = (register_t)catcher; regs->sp = (register_t)fp; - regs->ra = p->p_sigcode; + regs->ra = p->p_p->ps_sigcode; #ifdef DEBUG if ((sigdebug & SDB_FOLLOW) || ((sigdebug & SDB_KSTACK) && (p->p_pid == sigpid))) diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index 100dc2a647d..24d345a72b9 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.89 2014/03/22 00:01:04 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.90 2014/03/26 05:23:42 guenther Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -490,8 +490,8 @@ fault_common_no_miss: trapframe->pc, 0, 0); else locr0->pc += 4; - callp = p->p_emul->e_sysent; - numsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + numsys = p->p_p->ps_emul->e_nsysent; code = locr0->v0; switch (code) { case SYS_syscall: @@ -504,7 +504,7 @@ fault_common_no_miss: */ code = locr0->a0; if (code >= numsys) - callp += p->p_emul->e_nosys; /* (illegal) */ + callp += p->p_p->ps_emul->e_nosys; /* (illegal) */ else callp += code; i = callp->sy_argsize / sizeof(register_t); @@ -524,7 +524,7 @@ fault_common_no_miss: break; default: if (code >= numsys) - callp += p->p_emul->e_nosys; /* (illegal) */ + callp += p->p_p->ps_emul->e_nosys; /* (illegal) */ else callp += code; diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c index 584c98fc2df..7d4e23d7222 100644 --- a/sys/arch/powerpc/powerpc/trap.c +++ b/sys/arch/powerpc/powerpc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.94 2012/12/31 06:46:13 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.95 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */ /* @@ -402,8 +402,8 @@ printf("isi iar %x lr %x\n", frame->srr0, frame->lr); uvmexp.syscalls++; - nsys = p->p_emul->e_nsysent; - callp = p->p_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; code = frame->fixreg[0]; params = frame->fixreg + FIRSTARG; @@ -431,7 +431,7 @@ printf("isi iar %x lr %x\n", frame->srr0, frame->lr); break; } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else callp += code; argsize = callp->sy_argsize; diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c index f0033bacb79..ff2a40384dc 100644 --- a/sys/arch/sh/sh/sh_machdep.c +++ b/sys/arch/sh/sh/sh_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sh_machdep.c,v 1.35 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: sh_machdep.c,v 1.36 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */ /* @@ -506,7 +506,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->tf_r6 = (int)&fp->sf_uc; /* "ucp" argument for handler */ tf->tf_spc = (int)catcher; tf->tf_r15 = (int)fp; - tf->tf_pr = (int)p->p_sigcode; + tf->tf_pr = (int)p->p_p->ps_sigcode; } /* diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c index f013f866f50..da2be62bb9c 100644 --- a/sys/arch/sh/sh/trap.c +++ b/sys/arch/sh/sh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.21 2012/12/31 06:46:14 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.22 2014/03/26 05:23:42 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 $ */ @@ -528,8 +528,8 @@ syscall(struct proc *p, struct trapframe *tf) opc = tf->tf_spc; ocode = code = tf->tf_r0; - nsys = p->p_emul->e_nsysent; - callp = p->p_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; params = (caddr_t)tf->tf_r15; @@ -557,13 +557,13 @@ syscall(struct proc *p, struct trapframe *tf) break; } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; /* illegal */ + callp += p->p_p->ps_emul->e_nosys; /* illegal */ else callp += code; argsize = callp->sy_argsize; #ifdef DIAGNOSTIC if (argsize > sizeof args) { - callp += p->p_emul->e_nosys - code; + callp += p->p_p->ps_emul->e_nosys - code; argsize = callp->sy_argsize; } #endif diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c index 86cacdadbe5..0848597ab1f 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.42 2014/03/23 15:28:10 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.43 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -927,11 +927,12 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, tf->fixreg[3] = (int)sig; tf->fixreg[4] = (psp->ps_siginfo & sigmask(sig)) ? (int)&fp->sf_si : 0; tf->fixreg[5] = (int)&fp->sf_sc; - tf->srr0 = p->p_sigcode; + tf->srr0 = p->p_p->ps_sigcode; #if WHEN_WE_ONLY_FLUSH_DATA_WHEN_DOING_PMAP_ENTER pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map),tf->srr0, &pa); - syncicache(pa, (p->p_emul->e_esigcode - p->p_emul->e_sigcode)); + syncicache(pa, (p->p_p->ps_emul->e_esigcode - + p->p_p->ps_emul->e_sigcode)); #endif } diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c index d408d37f222..145f0e4401d 100644 --- a/sys/arch/solbourne/solbourne/machdep.c +++ b/sys/arch/solbourne/solbourne/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.29 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.30 2014/03/26 05:23:42 guenther Exp $ */ /* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */ /* @@ -447,7 +447,7 @@ sendsig(catcher, sig, mask, code, type, val) * Arrange to continue execution at the code copied out in exec(). * It needs the function to call in %g1, and a new stack pointer. */ - caddr = p->p_sigcode; + caddr = p->p_p->ps_sigcode; tf->tf_global[1] = (int)catcher; tf->tf_pc = caddr; tf->tf_npc = caddr + 4; diff --git a/sys/arch/solbourne/solbourne/trap.c b/sys/arch/solbourne/solbourne/trap.c index 14fe1445b3a..1796ae3a74b 100644 --- a/sys/arch/solbourne/solbourne/trap.c +++ b/sys/arch/solbourne/solbourne/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.17 2012/12/31 06:46:14 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.18 2014/03/26 05:23:42 guenther Exp $ */ /* OpenBSD: trap.c,v 1.42 2004/12/06 20:12:25 miod Exp */ /* @@ -788,8 +788,8 @@ syscall(code, tf, pc) new = code & (SYSCALL_G7RFLAG | SYSCALL_G2RFLAG); code &= ~(SYSCALL_G7RFLAG | SYSCALL_G2RFLAG); - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; /* * The first six system call arguments are in the six %o registers. @@ -820,7 +820,7 @@ syscall(code, tf, pc) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else { callp += code; i = callp->sy_argsize / sizeof(register_t); diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 42efbeccbfd..130149abda7 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.149 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.150 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -456,7 +456,7 @@ sendsig(catcher, sig, mask, code, type, val) * Arrange to continue execution at the code copied out in exec(). * It needs the function to call in %g1, and a new stack pointer. */ - caddr = p->p_sigcode; + caddr = p->p_p->ps_sigcode; tf->tf_global[1] = (int)catcher; tf->tf_pc = caddr; tf->tf_npc = caddr + 4; diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index e17766cc8be..8c65ce5f30e 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.63 2013/06/03 18:46:02 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.64 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -971,8 +971,8 @@ syscall(code, tf, pc) new = code & SYSCALL_G2RFLAG; code &= ~SYSCALL_G2RFLAG; - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; /* * The first six system call arguments are in the six %o registers. @@ -1003,7 +1003,7 @@ syscall(code, tf, pc) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else { callp += code; i = callp->sy_argsize / sizeof(register_t); diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 4f3dca565ad..a18a9c03a64 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.152 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.153 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -510,7 +510,7 @@ sendsig(catcher, sig, mask, code, type, val) * Arrange to continue execution at the code copied out in exec(). * It needs the function to call in %g1, and a new stack pointer. */ - addr = p->p_sigcode; + addr = p->p_p->ps_sigcode; tf->tf_global[1] = (vaddr_t)catcher; tf->tf_pc = addr; tf->tf_npc = addr + 4; diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 75c11621e25..51eab3abc0d 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.78 2013/04/02 13:24:57 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.79 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -1241,8 +1241,8 @@ syscall(tf, code, pc) new = code & SYSCALL_G2RFLAG; code &= ~SYSCALL_G2RFLAG; - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; /* * The first six system call arguments are in the six %o registers. @@ -1264,8 +1264,8 @@ syscall(tf, code, pc) nap--; break; case SYS___syscall: - if (code < nsys && - callp[code].sy_call != callp[p->p_emul->e_nosys].sy_call) + if (code < nsys && callp[code].sy_call != + callp[p->p_p->ps_emul->e_nosys].sy_call) break; /* valid system call */ if (tf->tf_out[6] & 1L) { /* longs *are* quadwords */ @@ -1281,7 +1281,7 @@ syscall(tf, code, pc) } if (code < 0 || code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else if (tf->tf_out[6] & 1L) { register_t *argp; diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index be2017947a6..38103d863c9 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.132 2014/03/22 06:05:45 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.133 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -493,7 +493,7 @@ sendsig(catcher, sig, mask, code, type, val) if (copyout(&gsigf, sigf, sizeof(gsigf))) sigexit(p, SIGILL); - syscf->pc = p->p_sigcode; + syscf->pc = p->p_p->ps_sigcode; syscf->psl = PSL_U | PSL_PREVU; /* * Place sp at the beginning of sigf; this ensures that possible diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 4a04db7c0b8..c20b397b083 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.48 2013/11/24 22:08:25 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.49 2014/03/26 05:23:42 guenther Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -336,8 +336,8 @@ if(startsysc)printf("trap syscall %s pc %lx, psl %lx, sp %lx, pid %d, frame %p\n uvmexp.syscalls++; exptr = p->p_addr->u_pcb.framep = frame; - callp = p->p_emul->e_sysent; - nsys = p->p_emul->e_nsysent; + callp = p->p_p->ps_emul->e_sysent; + nsys = p->p_p->ps_emul->e_nsysent; if(frame->code == SYS___syscall){ int g = *(int *)(frame->ap); @@ -348,7 +348,7 @@ if(startsysc)printf("trap syscall %s pc %lx, psl %lx, sp %lx, pid %d, frame %p\n } if(frame->code < 0 || frame->code >= nsys) - callp += p->p_emul->e_nosys; + callp += p->p_p->ps_emul->e_nosys; else callp += frame->code; |