diff options
author | 2012-12-31 06:46:13 +0000 | |
---|---|---|
committer | 2012-12-31 06:46:13 +0000 | |
commit | 9417b0e6a10b0c72b2a33114fd9759161dba5fa1 (patch) | |
tree | c6c40310a28dfeb810e9094e146fe83f7ea0be4e | |
parent | Eliminate orig_errno, which could be uninitialized in one case, by doing (diff) | |
download | wireguard-openbsd-9417b0e6a10b0c72b2a33114fd9759161dba5fa1.tar.xz wireguard-openbsd-9417b0e6a10b0c72b2a33114fd9759161dba5fa1.zip |
Remove emulation errno mapping code from platforms that no longer have
non-native emulations.
ok miod@
-rw-r--r-- | sys/arch/alpha/alpha/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 8 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 10 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/trap.c | 10 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sh/sh/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/solbourne/solbourne/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/trap.c | 4 |
12 files changed, 21 insertions, 45 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 386921b472f..e8862390934 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.63 2012/11/02 19:10:51 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.64 2012/12/31 06:46:13 guenther Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -601,8 +601,6 @@ syscall(code, framep) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; framep->tf_regs[FRAME_V0] = error; framep->tf_regs[FRAME_A3] = 1; break; diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 6bbeda1b2e8..fe952f90f28 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.31 2012/10/31 03:30:22 jsg Exp $ */ +/* $OpenBSD: trap.c,v 1.32 2012/12/31 06:46:13 guenther Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -367,7 +367,7 @@ faultcommon: #ifdef DIAGNOSTIC if (map == kernel_map && va == 0) { - printf("trap: bad kernel access at %lx\n", va); + printf("trap: bad kernel access at %lx\n", fa); goto we_re_toast; } #endif @@ -399,7 +399,7 @@ faultcommon: goto copyfault; } printf("uvm_fault(%p, 0x%lx, 0, %d) -> %x\n", - map, va, ftype, error); + map, fa, ftype, error); goto we_re_toast; } if (error == ENOMEM) { @@ -412,7 +412,7 @@ faultcommon: } else { #ifdef TRAP_SIGDEBUG printf("pid %d (%s): SEGV at rip %lx addr %lx\n", - p->p_pid, p->p_comm, frame->tf_rip, va); + p->p_pid, p->p_comm, frame->tf_rip, fa); frame_dump(frame); #endif sv.sival_ptr = (void *)fa; diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index 79dd088277f..f33c678e5bb 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.61 2012/08/07 05:16:53 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.62 2012/12/31 06:46:13 guenther Exp $ */ /* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */ /* @@ -1001,8 +1001,6 @@ syscall(code, frame) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; frame.f_regs[D0] = error; frame.f_sr |= PSL_C; /* carry bit */ break; diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 319c5b2085a..37990feb834 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.125 2012/08/29 18:49:56 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.126 2012/12/31 06:46:13 guenther Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -774,7 +774,7 @@ syscall(struct trapframe *frame) { register struct proc *p = curproc; register const struct sysent *callp; - int retq, nsys, code, argsize, argoff, oerror, error; + int retq, nsys, code, argsize, argoff, error; register_t args[8], rval[2]; #ifdef DIAGNOSTIC int oldcpl = curcpu()->ci_cpl; @@ -871,7 +871,7 @@ syscall(struct trapframe *frame) rval[0] = 0; rval[1] = frame->tf_ret1; - oerror = error = mi_syscall(p, code, callp, args, rval); + error = mi_syscall(p, code, callp, args, rval); switch (error) { case 0: @@ -886,8 +886,6 @@ syscall(struct trapframe *frame) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; frame->tf_t1 = error; frame->tf_ret0 = error; frame->tf_ret1 = 0; @@ -896,7 +894,7 @@ syscall(struct trapframe *frame) ast(p); - mi_syscall_return(p, code, oerror, rval); + mi_syscall_return(p, code, error, rval); #ifdef DIAGNOSTIC if (curcpu()->ci_cpl != oldcpl) { diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c index c961defaf49..8646247343c 100644 --- a/sys/arch/hppa64/hppa64/trap.c +++ b/sys/arch/hppa64/hppa64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.32 2012/08/07 17:17:46 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.33 2012/12/31 06:46:13 guenther Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -562,7 +562,7 @@ syscall(struct trapframe *frame) { register struct proc *p = curproc; register const struct sysent *callp; - int nsys, code, oerror, error; + int nsys, code, error; register_t args[8], rval[2]; #ifdef DIAGNOSTIC long oldcpl = curcpu()->ci_cpl; @@ -609,7 +609,7 @@ syscall(struct trapframe *frame) rval[0] = 0; rval[1] = frame->tf_ret1; - oerror = error = mi_syscall(p, code, callp, args, rval); + error = mi_syscall(p, code, callp, args, rval); switch (error) { case 0: @@ -623,8 +623,6 @@ syscall(struct trapframe *frame) case EJUSTRETURN: break; default: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; frame->tf_r1 = error; frame->tf_ret0 = error; frame->tf_ret1 = 0; @@ -633,7 +631,7 @@ syscall(struct trapframe *frame) ast(p); - mi_syscall_return(p, code, oerror, rval); + mi_syscall_return(p, code, error, rval); #ifdef DIAGNOSTIC if (curcpu()->ci_cpl != oldcpl) { diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 4bafc17b4df..e8cca8c357e 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.82 2012/08/07 17:17:46 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.83 2012/12/31 06:46:13 guenther Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -1235,8 +1235,6 @@ m88100_syscall(register_t code, struct trapframe *tf) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; tf->tf_r[2] = error; tf->tf_epsr |= PSR_C; /* fail */ tf->tf_snip = tf->tf_snip & ~NIP_E; @@ -1360,8 +1358,6 @@ m88110_syscall(register_t code, struct trapframe *tf) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; tf->tf_r[2] = error; tf->tf_epsr |= PSR_C; /* fail */ /* skip one instruction */ diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index 1a3cefe82fd..7e57638a220 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.76 2012/08/07 05:16:54 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.77 2012/12/31 06:46:13 guenther Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -927,8 +927,6 @@ syscall(code, frame) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; frame.f_regs[D0] = error; frame.f_sr |= PSL_C; /* carry bit */ break; diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c index b1cf43796a3..584c98fc2df 100644 --- a/sys/arch/powerpc/powerpc/trap.c +++ b/sys/arch/powerpc/powerpc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.93 2012/08/08 04:11:08 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.94 2012/12/31 06:46:13 guenther Exp $ */ /* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */ /* @@ -469,8 +469,6 @@ printf("isi iar %x lr %x\n", frame->srr0, frame->lr); break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; frame->fixreg[0] = error; frame->fixreg[FIRSTARG] = error; frame->fixreg[FIRSTARG + 1] = rval[1]; diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c index f3b2dee761f..f013f866f50 100644 --- a/sys/arch/sh/sh/trap.c +++ b/sys/arch/sh/sh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.20 2012/08/07 05:16:54 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.21 2012/12/31 06:46:14 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 $ */ @@ -630,8 +630,6 @@ syscall(struct proc *p, struct trapframe *tf) break; default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; tf->tf_r0 = error; tf->tf_ssr &= ~PSL_TBIT; /* T bit */ break; diff --git a/sys/arch/solbourne/solbourne/trap.c b/sys/arch/solbourne/solbourne/trap.c index 26be7192169..14fe1445b3a 100644 --- a/sys/arch/solbourne/solbourne/trap.c +++ b/sys/arch/solbourne/solbourne/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.16 2012/08/07 05:16:54 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.17 2012/12/31 06:46:14 guenther Exp $ */ /* OpenBSD: trap.c,v 1.42 2004/12/06 20:12:25 miod Exp */ /* @@ -870,8 +870,6 @@ syscall(code, tf, pc) default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; tf->tf_out[0] = error; tf->tf_psr |= PSR_C; /* fail */ i = tf->tf_npc; diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index e63b0acc5b5..1c46e332fdc 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.61 2012/08/08 04:46:25 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.62 2012/12/31 06:46:14 guenther Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -1052,8 +1052,6 @@ syscall(code, tf, pc) default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; tf->tf_out[0] = error; tf->tf_psr |= PSR_C; /* fail */ i = tf->tf_npc; diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 4e770305213..80209b7ac84 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.76 2012/08/07 05:16:54 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.77 2012/12/31 06:46:14 guenther Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -1342,8 +1342,6 @@ syscall(tf, code, pc) default: bad: - if (p->p_emul->e_errno) - error = p->p_emul->e_errno[error]; tf->tf_out[0] = error; tf->tf_tstate |= (((int64_t)(ICC_C|XCC_C))<<TSTATE_CCR_SHIFT); /* fail */ dest = tf->tf_npc; |