Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/vm_machdep.c
Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) | ||||
} | } | ||||
/* Point the pcb to the top of the stack */ | /* Point the pcb to the top of the stack */ | ||||
pcb2 = get_pcb_td(td2); | pcb2 = get_pcb_td(td2); | ||||
td2->td_pcb = pcb2; | td2->td_pcb = pcb2; | ||||
copy_thread(td1, td2); | copy_thread(td1, td2); | ||||
/* Reset debug registers in the new process */ | |||||
pcb2->pcb_dr0 = 0; | |||||
pcb2->pcb_dr1 = 0; | |||||
pcb2->pcb_dr2 = 0; | |||||
pcb2->pcb_dr3 = 0; | |||||
pcb2->pcb_dr6 = 0; | |||||
pcb2->pcb_dr7 = 0; | |||||
/* Point mdproc and then copy over td1's contents */ | /* Point mdproc and then copy over td1's contents */ | ||||
mdp2 = &p2->p_md; | mdp2 = &p2->p_md; | ||||
bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); | bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); | ||||
/* | /* | ||||
* Copy the trap frame for the return to user mode as if from a | * Copy the trap frame for the return to user mode as if from a | ||||
* syscall. This copies most of the user mode register values. | * syscall. This copies most of the user mode register values. | ||||
* The -VM86_STACK_SPACE (-16) is so we can expand the trapframe | * The -VM86_STACK_SPACE (-16) is so we can expand the trapframe | ||||
▲ Show 20 Lines • Show All 424 Lines • Show Last 20 Lines |