Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/vm_machdep.c
| Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | #endif | ||||
| */ | */ | ||||
| pmap_set_pcb_pagedir(vmspace_pmap(p2->p_vmspace), pcb2); | pmap_set_pcb_pagedir(vmspace_pmap(p2->p_vmspace), pcb2); | ||||
| pcb2->pcb_regs.sf_r4 = (register_t)fork_return; | pcb2->pcb_regs.sf_r4 = (register_t)fork_return; | ||||
| pcb2->pcb_regs.sf_r5 = (register_t)td2; | pcb2->pcb_regs.sf_r5 = (register_t)td2; | ||||
| pcb2->pcb_regs.sf_lr = (register_t)fork_trampoline; | pcb2->pcb_regs.sf_lr = (register_t)fork_trampoline; | ||||
| pcb2->pcb_regs.sf_sp = STACKALIGN(td2->td_frame); | pcb2->pcb_regs.sf_sp = STACKALIGN(td2->td_frame); | ||||
| pcb2->pcb_regs.sf_tpidrurw = (register_t)get_tls(); | pcb2->pcb_regs.sf_tpidrurw = (register_t)get_tls(); | ||||
| pcb2->pcb_vfpcpu = -1; | #ifdef VFP | ||||
| pcb2->pcb_vfpsaved = &pcb2->pcb_vfpstate; | vfp_new_thread(td2, td1, true); | ||||
| pcb2->pcb_vfpstate.fpscr = initial_fpscr; | #endif | ||||
mmel: Where has initialization of pcb_vfpstate.fpscr moved to? | |||||
Not Done Inline ActionsDoes this work in a kernel config without VFP andrew: Does this work in a kernel config without `VFP` | |||||
Done Inline ActionsGood find, it does not. kd: Good find, it does not.
I've fixed that in the latest version. | |||||
| tf = td2->td_frame; | tf = td2->td_frame; | ||||
| tf->tf_spsr &= ~PSR_C; | tf->tf_spsr &= ~PSR_C; | ||||
| tf->tf_r0 = 0; | tf->tf_r0 = 0; | ||||
| tf->tf_r1 = 0; | tf->tf_r1 = 0; | ||||
| /* Setup to release spin count in fork_exit(). */ | /* Setup to release spin count in fork_exit(). */ | ||||
| td2->td_md.md_spinlock_count = 1; | td2->td_md.md_spinlock_count = 1; | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | cpu_copy_thread(struct thread *td, struct thread *td0) | ||||
| td->td_pcb->pcb_regs.sf_r4 = (register_t)fork_return; | td->td_pcb->pcb_regs.sf_r4 = (register_t)fork_return; | ||||
| td->td_pcb->pcb_regs.sf_r5 = (register_t)td; | td->td_pcb->pcb_regs.sf_r5 = (register_t)td; | ||||
| td->td_pcb->pcb_regs.sf_lr = (register_t)fork_trampoline; | td->td_pcb->pcb_regs.sf_lr = (register_t)fork_trampoline; | ||||
| td->td_pcb->pcb_regs.sf_sp = STACKALIGN(td->td_frame); | td->td_pcb->pcb_regs.sf_sp = STACKALIGN(td->td_frame); | ||||
| td->td_frame->tf_spsr &= ~PSR_C; | td->td_frame->tf_spsr &= ~PSR_C; | ||||
| td->td_frame->tf_r0 = 0; | td->td_frame->tf_r0 = 0; | ||||
| #ifdef VFP | |||||
| vfp_new_thread(td, td0, false); | |||||
| #endif | |||||
| /* Setup to release spin count in fork_exit(). */ | /* Setup to release spin count in fork_exit(). */ | ||||
| td->td_md.md_spinlock_count = 1; | td->td_md.md_spinlock_count = 1; | ||||
| td->td_md.md_saved_cspr = PSR_SVC32_MODE; | td->td_md.md_saved_cspr = PSR_SVC32_MODE; | ||||
| } | } | ||||
| /* | /* | ||||
| * Set that machine state for performing an upcall that starts | * Set that machine state for performing an upcall that starts | ||||
| * the entry function with the given argument. | * the entry function with the given argument. | ||||
| ▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines | |||||
Where has initialization of pcb_vfpstate.fpscr moved to?