diff options
author | phk <phk@FreeBSD.org> | 1996-04-18 21:34:53 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-04-18 21:34:53 +0000 |
commit | d01137f090b01f346e04dbf2c2e2d20f9ea7f98b (patch) | |
tree | e56a307788eb4ffa01ccdd9153f4bbab8e6e903e | |
parent | 6eb9f2ef253282406c885fcf9f59f6b6a68d23c3 (diff) | |
download | FreeBSD-src-d01137f090b01f346e04dbf2c2e2d20f9ea7f98b.zip FreeBSD-src-d01137f090b01f346e04dbf2c2e2d20f9ea7f98b.tar.gz |
Fix a bogon. cpu_fork & savectx ecpected cpu_switch to restore %eax,
they shouldn't.
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 6 | ||||
-rw-r--r-- | sys/amd64/amd64/swtch.s | 6 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 6 | ||||
-rw-r--r-- | sys/amd64/include/pcb.h | 4 | ||||
-rw-r--r-- | sys/i386/i386/swtch.s | 6 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 6 | ||||
-rw-r--r-- | sys/i386/include/pcb.h | 4 |
7 files changed, 24 insertions, 14 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index ab7e497..960c2cf 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: swtch.s,v 1.31 1996/03/19 04:40:03 nate Exp $ + * $Id: swtch.s,v 1.32 1996/04/13 11:24:13 bde Exp $ */ #include "apm.h" @@ -476,7 +476,9 @@ ENTRY(savectx) movl (%esp),%eax movl %eax,PCB_EIP(%ecx) - movl $1,PCB_EAX(%ecx) /* return 1 in child */ + movl 8(%esp), %eax /* In parent we put zero */ + movl $0,(%eax) + movl %ebx,PCB_EBX(%ecx) movl %esp,PCB_ESP(%ecx) movl %ebp,PCB_EBP(%ecx) diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s index ab7e497..960c2cf 100644 --- a/sys/amd64/amd64/swtch.s +++ b/sys/amd64/amd64/swtch.s @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: swtch.s,v 1.31 1996/03/19 04:40:03 nate Exp $ + * $Id: swtch.s,v 1.32 1996/04/13 11:24:13 bde Exp $ */ #include "apm.h" @@ -476,7 +476,9 @@ ENTRY(savectx) movl (%esp),%eax movl %eax,PCB_EIP(%ecx) - movl $1,PCB_EAX(%ecx) /* return 1 in child */ + movl 8(%esp), %eax /* In parent we put zero */ + movl $0,(%eax) + movl %ebx,PCB_EBX(%ecx) movl %esp,PCB_ESP(%ecx) movl %ebp,PCB_EBP(%ecx) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index ba93458..42b1140 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.57 1996/03/03 01:57:45 jkh Exp $ + * $Id: vm_machdep.c,v 1.58 1996/04/07 17:39:28 bde Exp $ */ #include "npx.h" @@ -588,7 +588,9 @@ cpu_fork(p1, p2) /* * Returns (0) in parent, (1) in child. */ - return (savectx(pcb2)); + sp = 1; + savectx(pcb2,&sp); + return (sp); } void diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h index a3f2005..2fe3d8a 100644 --- a/sys/amd64/include/pcb.h +++ b/sys/amd64/include/pcb.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)pcb.h 5.10 (Berkeley) 5/12/91 - * $Id: pcb.h,v 1.10 1996/01/23 02:39:24 davidg Exp $ + * $Id: pcb.h,v 1.11 1996/03/02 19:37:45 peter Exp $ */ #ifndef _I386_PCB_H_ @@ -79,7 +79,7 @@ struct md_coredump { #ifdef KERNEL extern struct pcb *curpcb; /* our current running pcb */ -int savectx __P((struct pcb*)); +int savectx __P((struct pcb*, int *)); #endif #endif /* _I386_PCB_H_ */ diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index ab7e497..960c2cf 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: swtch.s,v 1.31 1996/03/19 04:40:03 nate Exp $ + * $Id: swtch.s,v 1.32 1996/04/13 11:24:13 bde Exp $ */ #include "apm.h" @@ -476,7 +476,9 @@ ENTRY(savectx) movl (%esp),%eax movl %eax,PCB_EIP(%ecx) - movl $1,PCB_EAX(%ecx) /* return 1 in child */ + movl 8(%esp), %eax /* In parent we put zero */ + movl $0,(%eax) + movl %ebx,PCB_EBX(%ecx) movl %esp,PCB_ESP(%ecx) movl %ebp,PCB_EBP(%ecx) diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index ba93458..42b1140 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.57 1996/03/03 01:57:45 jkh Exp $ + * $Id: vm_machdep.c,v 1.58 1996/04/07 17:39:28 bde Exp $ */ #include "npx.h" @@ -588,7 +588,9 @@ cpu_fork(p1, p2) /* * Returns (0) in parent, (1) in child. */ - return (savectx(pcb2)); + sp = 1; + savectx(pcb2,&sp); + return (sp); } void diff --git a/sys/i386/include/pcb.h b/sys/i386/include/pcb.h index a3f2005..2fe3d8a 100644 --- a/sys/i386/include/pcb.h +++ b/sys/i386/include/pcb.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)pcb.h 5.10 (Berkeley) 5/12/91 - * $Id: pcb.h,v 1.10 1996/01/23 02:39:24 davidg Exp $ + * $Id: pcb.h,v 1.11 1996/03/02 19:37:45 peter Exp $ */ #ifndef _I386_PCB_H_ @@ -79,7 +79,7 @@ struct md_coredump { #ifdef KERNEL extern struct pcb *curpcb; /* our current running pcb */ -int savectx __P((struct pcb*)); +int savectx __P((struct pcb*, int *)); #endif #endif /* _I386_PCB_H_ */ |