diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2001-09-19 05:44:12 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2001-09-19 05:44:12 +0000 |
| commit | e5a860ebb4afd65ca7871e99ac614398b8d885c0 (patch) | |
| tree | e2f560bc055ca5782d3a6130e96aa22320a30853 | |
| parent | 2f01a0c097b4930fd4610ae00c69a40545c450d3 (diff) | |
Notes
| -rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 3 | ||||
| -rw-r--r-- | sys/i386/i386/vm_machdep.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 83ddc21031b0..573e1f11e7df 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -169,8 +169,9 @@ cpu_fork(td1, p2, flags) * Create a new fresh stack for the new process. * Copy the trap frame for the return to user mode as if from a * syscall. This copies most of the user mode register values. + * The -16 is so we can expand the trapframe if we go to vm86. */ - td2->td_frame = (struct trapframe *)td2->td_pcb - 1; + td2->td_frame = (struct trapframe *)((caddr_t)td2->td_pcb - 16) - 1; bcopy(td1->td_frame, td2->td_frame, sizeof(struct trapframe)); td2->td_frame->tf_eax = 0; /* Child returns zero */ diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 83ddc21031b0..573e1f11e7df 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -169,8 +169,9 @@ cpu_fork(td1, p2, flags) * Create a new fresh stack for the new process. * Copy the trap frame for the return to user mode as if from a * syscall. This copies most of the user mode register values. + * The -16 is so we can expand the trapframe if we go to vm86. */ - td2->td_frame = (struct trapframe *)td2->td_pcb - 1; + td2->td_frame = (struct trapframe *)((caddr_t)td2->td_pcb - 16) - 1; bcopy(td1->td_frame, td2->td_frame, sizeof(struct trapframe)); td2->td_frame->tf_eax = 0; /* Child returns zero */ |
