Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/vm_machdep.c
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
#include <sys/sysent.h> | #include <sys/sysent.h> | ||||
#include <sys/unistd.h> | #include <sys/unistd.h> | ||||
#include <machine/cpu.h> | #include <machine/cpu.h> | ||||
#include <machine/fpu.h> | #include <machine/fpu.h> | ||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#include <machine/reg.h> | |||||
#include <dev/ofw/openfirm.h> | #include <dev/ofw/openfirm.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_param.h> | #include <vm/vm_param.h> | ||||
#include <vm/vm_kern.h> | #include <vm/vm_kern.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/vm_map.h> | #include <vm/vm_map.h> | ||||
Show All 13 Lines | cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) | ||||
KASSERT(td1 == curthread || td1 == &thread0, | KASSERT(td1 == curthread || td1 == &thread0, | ||||
("cpu_fork: p1 not curproc and not proc0")); | ("cpu_fork: p1 not curproc and not proc0")); | ||||
CTR3(KTR_PROC, "cpu_fork: called td1=%p p2=%p flags=%x", | CTR3(KTR_PROC, "cpu_fork: called td1=%p p2=%p flags=%x", | ||||
td1, p2, flags); | td1, p2, flags); | ||||
if ((flags & RFPROC) == 0) | if ((flags & RFPROC) == 0) | ||||
return; | return; | ||||
/* Ensure td1 is up to date before copy. */ | |||||
bdragon: I need to skip this when td1 != curthread, just got a boot panic on a dual processor G4. I had… | |||||
if (td1 == curthread) | |||||
cpu_save_thread_regs(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)) & ~0x2fUL); | ||||
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)); | ||||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |
I need to skip this when td1 != curthread, just got a boot panic on a dual processor G4. I had missed the part where we could also be here because we're cloning off of thread0.