summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-09-15 21:14:28 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-09-15 21:14:28 +0000
commit8febb36b3c2de4173ea6dfcd221fe8d00eaadce8 (patch)
treecedd3975bf805bd83930892b072f4287426434ec
parent7a9949a766efb61c185c9bf2f8f4c6b31008d9b5 (diff)
In syscall(), do not recompute the struct proc * after the syscall has
succeeded. This used to be necessary for fork(), when returning in the child, but we return in the child in child_return() which does TRT. ok art@
-rw-r--r--sys/arch/alpha/alpha/trap.c8
-rw-r--r--sys/arch/hppa/hppa/trap.c4
-rw-r--r--sys/arch/hppa64/hppa64/trap.c4
-rw-r--r--sys/arch/i386/i386/trap.c7
-rw-r--r--sys/arch/m88k/m88k/trap.c13
-rw-r--r--sys/arch/mips64/mips64/trap.c10
-rw-r--r--sys/arch/vax/vax/trap.c3
7 files changed, 7 insertions, 42 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c
index 9212ffa8f47..78cc4274060 100644
--- a/sys/arch/alpha/alpha/trap.c
+++ b/sys/arch/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.47 2005/09/15 21:09:27 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.48 2005/09/15 21:14:25 miod Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
@@ -694,15 +694,9 @@ syscall(code, framep)
break;
}
- /*
- * Reinitialize proc pointer `p' as it may be different
- * if this is a child returning from fork syscall.
- */
- p = curproc;
#ifdef SYSCALL_DEBUG
scdebug_ret(p, code, error, rval);
#endif
-
userret(p, framep->tf_regs[FRAME_PC], sticks);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index 47256b857fa..b421c9a1989 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.89 2005/09/15 21:09:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.90 2005/09/15 21:14:27 miod Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -812,8 +812,6 @@ syscall(struct trapframe *frame)
else
#endif
oerror = error = (*callp->sy_call)(p, args, rval);
- p = curproc;
- frame = p->p_md.md_regs;
switch (error) {
case 0:
frame->tf_ret0 = rval[0];
diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c
index cc47c39b967..04d6c00312a 100644
--- a/sys/arch/hppa64/hppa64/trap.c
+++ b/sys/arch/hppa64/hppa64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.4 2005/09/15 21:09:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.5 2005/09/15 21:14:27 miod Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -683,8 +683,6 @@ syscall(struct trapframe *frame)
else
#endif
oerror = error = (*callp->sy_call)(p, args, rval);
- p = curproc;
- frame = p->p_md.md_regs;
switch (error) {
case 0:
frame->tf_ret0 = rval[0];
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index 6880a4e4290..27f7b7e0850 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.70 2005/09/15 21:09:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.71 2005/09/15 21:14:27 miod Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
@@ -771,11 +771,6 @@ syscall(frame)
KERNEL_PROC_UNLOCK(p);
switch (error) {
case 0:
- /*
- * Reinitialize proc pointer `p' as it may be different
- * if this is a child returning from fork syscall.
- */
- p = curproc;
frame.tf_eax = rval[0];
frame.tf_edx = rval[1];
frame.tf_eflags &= ~PSL_C; /* carry bit */
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c
index 160b407fe60..1ec8c5d0973 100644
--- a/sys/arch/m88k/m88k/trap.c
+++ b/sys/arch/m88k/m88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.20 2005/09/15 21:09:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.21 2005/09/15 21:14:27 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -1206,15 +1206,6 @@ m88100_syscall(register_t code, struct trapframe *tf)
switch (error) {
case 0:
- /*
- * If fork succeeded and we are the child, our stack
- * has moved and the pointer tf is no longer valid,
- * and p is wrong. Compute the new trapframe pointer.
- * (The trap frame invariably resides at the
- * tippity-top of the u. area.)
- */
- p = curproc;
- tf = (struct trapframe *)USER_REGS(p);
tf->tf_r[2] = rval[0];
tf->tf_r[3] = rval[1];
tf->tf_epsr &= ~PSR_C;
@@ -1378,8 +1369,6 @@ m88110_syscall(register_t code, struct trapframe *tf)
* (The trap frame invariably resides at the
* tippity-top of the u. area.)
*/
- p = curproc;
- tf = (struct trapframe *)USER_REGS(p);
tf->tf_r[2] = rval[0];
tf->tf_r[3] = rval[1];
tf->tf_epsr &= ~PSR_C;
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index f1e9da6caac..6feb27c7b19 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.23 2005/09/15 21:09:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.24 2005/09/15 21:14:27 miod Exp $ */
/* tracked to 1.23 */
/*
@@ -529,14 +529,6 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
else
#endif
i = (*callp->sy_call)(p, &args, rval);
- /*
- * Reinitialize proc pointer `p' as it may be different
- * if this is a child returning from fork syscall.
- */
- p = curproc;
- locr0 = p->p_md.md_regs;
-
- trapdebug_enter(locr0, -code);
switch (i) {
case 0:
diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c
index 23a50c3128a..f6893793036 100644
--- a/sys/arch/vax/vax/trap.c
+++ b/sys/arch/vax/vax/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.31 2005/09/15 21:09:30 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.32 2005/09/15 21:14:27 miod Exp $ */
/* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -430,7 +430,6 @@ if(startsysc)printf("trap syscall %s pc %lx, psl %lx, sp %lx, pid %d, frame %p\n
else
#endif
err = (*callp->sy_call)(curproc, args, rval);
- exptr = curproc->p_addr->u_pcb.framep;
#ifdef TRAPDEBUG
if(startsysc)