Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/powerpc/exec_machdep.c
Show First 20 Lines • Show All 965 Lines • ▼ Show 20 Lines | cpu_copy_thread(struct thread *td, struct thread *td0) | ||||
#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) | #if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) | ||||
pcb2->pcb_lr = ((register_t *)fork_trampoline)[0]; | pcb2->pcb_lr = ((register_t *)fork_trampoline)[0]; | ||||
pcb2->pcb_toc = ((register_t *)fork_trampoline)[1]; | pcb2->pcb_toc = ((register_t *)fork_trampoline)[1]; | ||||
#else | #else | ||||
pcb2->pcb_lr = (register_t)fork_trampoline; | pcb2->pcb_lr = (register_t)fork_trampoline; | ||||
pcb2->pcb_context[0] = pcb2->pcb_lr; | pcb2->pcb_context[0] = pcb2->pcb_lr; | ||||
#endif | #endif | ||||
pcb2->pcb_cpu.aim.usr_vsid = 0; | pcb2->pcb_cpu.aim.usr_vsid = 0; | ||||
#ifdef __SPE__ | |||||
pcb2->pcb_vec.vscr = SPEFSCR_FINVE | SPEFSCR_FDBZE | | |||||
SPEFSCR_FUNFE | SPEFSCR_FOVFE; | |||||
#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_msr = psl_kernset; | td->td_md.md_saved_msr = psl_kernset; | ||||
} | } | ||||
void | void | ||||
cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | ||||
Show All 29 Lines | if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { | ||||
tf->srr0 = entry_desc[0]; | tf->srr0 = entry_desc[0]; | ||||
tf->fixreg[2] = entry_desc[1]; | tf->fixreg[2] = entry_desc[1]; | ||||
tf->fixreg[11] = entry_desc[2]; | tf->fixreg[11] = entry_desc[2]; | ||||
tf->srr1 = psl_userset | PSL_FE_DFLT; | tf->srr1 = psl_userset | PSL_FE_DFLT; | ||||
#endif | #endif | ||||
} | } | ||||
td->td_pcb->pcb_flags = 0; | td->td_pcb->pcb_flags = 0; | ||||
#ifdef __SPE__ | |||||
td->td_pcb->pcb_vec.vscr = SPEFSCR_FINVE | SPEFSCR_FDBZE | | |||||
SPEFSCR_FUNFE | SPEFSCR_FOVFE; | |||||
#endif | |||||
td->td_retval[0] = (register_t)entry; | td->td_retval[0] = (register_t)entry; | ||||
td->td_retval[1] = 0; | td->td_retval[1] = 0; | ||||
} | } | ||||
static int | static int | ||||
emulate_mfspr(int spr, int reg, struct trapframe *frame){ | emulate_mfspr(int spr, int reg, struct trapframe *frame){ | ||||
struct thread *td; | struct thread *td; | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |