Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/vm_machdep.c
| Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) | ||||
| if ((flags & RFPROC) == 0) | if ((flags & RFPROC) == 0) | ||||
| return; | return; | ||||
| /* Ensure td1 is up to date before copy. */ | /* Ensure td1 is up to date before copy. */ | ||||
| if (td1 == curthread) | if (td1 == curthread) | ||||
| cpu_update_pcb(td1); | cpu_update_pcb(td1); | ||||
| pcb = (struct pcb *)((td2->td_kstack + | pcb = (struct pcb *)((td2->td_kstack + | ||||
| td2->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb)) & ~0x2fUL); | td2->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb)) & ~0x3fUL); | ||||
| td2->td_pcb = pcb; | td2->td_pcb = pcb; | ||||
| /* Copy the pcb */ | /* Copy the pcb */ | ||||
| bcopy(td1->td_pcb, pcb, sizeof(struct pcb)); | bcopy(td1->td_pcb, pcb, sizeof(struct pcb)); | ||||
| /* | /* | ||||
| * Create a fresh stack for the new process. | * Create a fresh stack for the new process. | ||||
| * 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 | ||||
| ▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines | |||||