Deleted Added
full compact
vm_machdep.c (282684) vm_machdep.c (283735)
1/*-
2 * Copyright (c) 1982, 1986 The Regents of the University of California.
3 * Copyright (c) 1989, 1990 William Jolitz
4 * Copyright (c) 1994 John Dyson
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer

--- 27 unchanged lines hidden (view full) ---

36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
40 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
41 */
42
43#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986 The Regents of the University of California.
3 * Copyright (c) 1989, 1990 William Jolitz
4 * Copyright (c) 1994 John Dyson
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer

--- 27 unchanged lines hidden (view full) ---

36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
40 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/amd64/amd64/vm_machdep.c 282684 2015-05-09 19:11:01Z kib $");
44__FBSDID("$FreeBSD: head/sys/amd64/amd64/vm_machdep.c 283735 2015-05-29 13:24:17Z kib $");
45
46#include "opt_isa.h"
47#include "opt_cpu.h"
48#include "opt_compat.h"
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/bio.h>

--- 97 unchanged lines hidden (view full) ---

150 register struct proc *p2;
151 struct thread *td2;
152 int flags;
153{
154 register struct proc *p1;
155 struct pcb *pcb2;
156 struct mdproc *mdp1, *mdp2;
157 struct proc_ldt *pldt;
45
46#include "opt_isa.h"
47#include "opt_cpu.h"
48#include "opt_compat.h"
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/bio.h>

--- 97 unchanged lines hidden (view full) ---

150 register struct proc *p2;
151 struct thread *td2;
152 int flags;
153{
154 register struct proc *p1;
155 struct pcb *pcb2;
156 struct mdproc *mdp1, *mdp2;
157 struct proc_ldt *pldt;
158 pmap_t pmap2;
159
160 p1 = td1->td_proc;
161 if ((flags & RFPROC) == 0) {
162 if ((flags & RFMEM) == 0) {
163 /* unshare user LDT */
164 mdp1 = &p1->p_md;
165 mtx_lock(&dt_lock);
166 if ((pldt = mdp1->md_ldt) != NULL &&

--- 46 unchanged lines hidden (view full) ---

213 */
214 if ((p1->p_pfsflags & PF_FORK) == 0)
215 td2->td_frame->tf_rflags &= ~PSL_T;
216
217 /*
218 * Set registers for trampoline to user mode. Leave space for the
219 * return address on stack. These are the kernel mode register values.
220 */
158
159 p1 = td1->td_proc;
160 if ((flags & RFPROC) == 0) {
161 if ((flags & RFMEM) == 0) {
162 /* unshare user LDT */
163 mdp1 = &p1->p_md;
164 mtx_lock(&dt_lock);
165 if ((pldt = mdp1->md_ldt) != NULL &&

--- 46 unchanged lines hidden (view full) ---

212 */
213 if ((p1->p_pfsflags & PF_FORK) == 0)
214 td2->td_frame->tf_rflags &= ~PSL_T;
215
216 /*
217 * Set registers for trampoline to user mode. Leave space for the
218 * return address on stack. These are the kernel mode register values.
219 */
221 pmap2 = vmspace_pmap(p2->p_vmspace);
222 pcb2->pcb_r12 = (register_t)fork_return; /* fork_trampoline argument */
223 pcb2->pcb_rbp = 0;
224 pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *);
225 pcb2->pcb_rbx = (register_t)td2; /* fork_trampoline argument */
226 pcb2->pcb_rip = (register_t)fork_trampoline;
227 /*-
228 * pcb2->pcb_dr*: cloned above.
229 * pcb2->pcb_savefpu: cloned above.

--- 503 unchanged lines hidden ---
220 pcb2->pcb_r12 = (register_t)fork_return; /* fork_trampoline argument */
221 pcb2->pcb_rbp = 0;
222 pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *);
223 pcb2->pcb_rbx = (register_t)td2; /* fork_trampoline argument */
224 pcb2->pcb_rip = (register_t)fork_trampoline;
225 /*-
226 * pcb2->pcb_dr*: cloned above.
227 * pcb2->pcb_savefpu: cloned above.

--- 503 unchanged lines hidden ---