Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/vm_machdep.c
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | if ((td2->td_pflags & TDP_KTHREAD) == 0) { | ||||
if (PCPU_GET(fpcurthread) == td1) | if (PCPU_GET(fpcurthread) == td1) | ||||
npxsave(td1->td_pcb->pcb_save); | npxsave(td1->td_pcb->pcb_save); | ||||
critical_exit(); | critical_exit(); | ||||
} | } | ||||
/* Copy td1's pcb */ | /* Copy td1's pcb */ | ||||
bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); | bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); | ||||
/* But reset debug registers in the new thread */ | |||||
pcb2->pcb_dr0 = 0; | |||||
pcb2->pcb_dr1 = 0; | |||||
pcb2->pcb_dr2 = 0; | |||||
pcb2->pcb_dr3 = 0; | |||||
pcb2->pcb_dr6 = 0; | |||||
pcb2->pcb_dr7 = 0; | |||||
/* Properly initialize pcb_save */ | /* Properly initialize pcb_save */ | ||||
pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); | pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); | ||||
/* Kernel threads start with clean NPX and segment bases. */ | /* Kernel threads start with clean NPX and segment bases. */ | ||||
if ((td2->td_pflags & TDP_KTHREAD) != 0) { | if ((td2->td_pflags & TDP_KTHREAD) != 0) { | ||||
pcb2->pcb_gs = _udatasel; | pcb2->pcb_gs = _udatasel; | ||||
set_fsbase(td2, 0); | set_fsbase(td2, 0); | ||||
set_gsbase(td2, 0); | set_gsbase(td2, 0); | ||||
▲ Show 20 Lines • Show All 507 Lines • Show Last 20 Lines |