Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/vm_machdep.c
Show First 20 Lines • Show All 431 Lines • ▼ Show 20 Lines | cpu_copy_thread(struct thread *td, struct thread *td0) | ||||
* Copy the upcall pcb. This loads kernel regs. | * Copy the upcall pcb. This loads kernel regs. | ||||
* Those not loaded individually below get their default | * Those not loaded individually below get their default | ||||
* values here. | * values here. | ||||
*/ | */ | ||||
bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); | bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); | ||||
pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | | pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | | ||||
PCB_KERNNPX); | PCB_KERNNPX); | ||||
pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); | pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); | ||||
bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, | |||||
cpu_max_ext_state_size); | |||||
/* | /* | ||||
* Create a new fresh stack for the new thread. | * Create a new fresh stack for the new thread. | ||||
*/ | */ | ||||
bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); | bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); | ||||
/* If the current thread has the trap bit set (i.e. a debugger had | /* If the current thread has the trap bit set (i.e. a debugger had | ||||
* single stepped the process to the system call), we need to clear | * single stepped the process to the system call), we need to clear | ||||
Show All 13 Lines | cpu_copy_thread(struct thread *td, struct thread *td0) | ||||
pcb2->pcb_esp = (int)td->td_frame - sizeof(void *); /* trampoline arg */ | pcb2->pcb_esp = (int)td->td_frame - sizeof(void *); /* trampoline arg */ | ||||
pcb2->pcb_ebx = (int)td; /* trampoline arg */ | pcb2->pcb_ebx = (int)td; /* trampoline arg */ | ||||
pcb2->pcb_eip = (int)fork_trampoline + setidt_disp; | pcb2->pcb_eip = (int)fork_trampoline + setidt_disp; | ||||
pcb2->pcb_gs = rgs(); | pcb2->pcb_gs = rgs(); | ||||
/* | /* | ||||
* If we didn't copy the pcb, we'd need to do the following registers: | * If we didn't copy the pcb, we'd need to do the following registers: | ||||
* pcb2->pcb_cr3: cloned above. | * pcb2->pcb_cr3: cloned above. | ||||
* pcb2->pcb_dr*: cloned above. | * pcb2->pcb_dr*: cloned above. | ||||
* pcb2->pcb_savefpu: cloned above. | |||||
* pcb2->pcb_flags: cloned above. | * pcb2->pcb_flags: cloned above. | ||||
* pcb2->pcb_onfault: cloned above (always NULL here?). | * pcb2->pcb_onfault: cloned above (always NULL here?). | ||||
* pcb2->pcb_gs: cloned above. | * pcb2->pcb_gs: cloned above. | ||||
* pcb2->pcb_ext: cleared below. | * pcb2->pcb_ext: cleared below. | ||||
*/ | */ | ||||
pcb2->pcb_ext = NULL; | pcb2->pcb_ext = NULL; | ||||
/* Setup to release spin count in fork_exit(). */ | /* Setup to release spin count in fork_exit(). */ | ||||
▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines |