Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/linux/linux_sysvec.c
Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Reset registers to default values on exec. | * Reset registers to default values on exec. | ||||
*/ | */ | ||||
static void | static void | ||||
linux_exec_setregs(struct thread *td, struct image_params *imgp, | linux_exec_setregs(struct thread *td, struct image_params *imgp, | ||||
uintptr_t stack) | uintptr_t stack) | ||||
{ | { | ||||
struct trapframe *regs = td->td_frame; | struct trapframe *regs = td->td_frame; | ||||
struct pcb *pcb = td->td_pcb; | |||||
/* LINUXTODO: validate */ | /* LINUXTODO: validate */ | ||||
LIN_SDT_PROBE0(sysvec, linux_exec_setregs, todo); | LIN_SDT_PROBE0(sysvec, linux_exec_setregs, todo); | ||||
memset(regs, 0, sizeof(*regs)); | memset(regs, 0, sizeof(*regs)); | ||||
/* glibc start.S registers function pointer in x0 with atexit. */ | /* glibc start.S registers function pointer in x0 with atexit. */ | ||||
regs->tf_sp = stack; | regs->tf_sp = stack; | ||||
#if 0 /* LINUXTODO: See if this is used. */ | #if 0 /* LINUXTODO: See if this is used. */ | ||||
regs->tf_lr = imgp->entry_addr; | regs->tf_lr = imgp->entry_addr; | ||||
#else | #else | ||||
regs->tf_lr = 0xffffffffffffffff; | regs->tf_lr = 0xffffffffffffffff; | ||||
#endif | #endif | ||||
regs->tf_elr = imgp->entry_addr; | regs->tf_elr = imgp->entry_addr; | ||||
td->td_pcb->pcb_tpidr_el0 = 0; | pcb->pcb_tpidr_el0 = 0; | ||||
td->td_pcb->pcb_tpidrro_el0 = 0; | pcb->pcb_tpidrro_el0 = 0; | ||||
WRITE_SPECIALREG(tpidrro_el0, 0); | WRITE_SPECIALREG(tpidrro_el0, 0); | ||||
WRITE_SPECIALREG(tpidr_el0, 0); | WRITE_SPECIALREG(tpidr_el0, 0); | ||||
#ifdef VFP | #ifdef VFP | ||||
vfp_reset_state(td, td->td_pcb); | vfp_reset_state(td, pcb); | ||||
#endif | #endif | ||||
/* | |||||
* Clear debug register state. It is not applicable to the new process. | |||||
*/ | |||||
bzero(&pcb->pcb_dbg_regs, sizeof(pcb->pcb_dbg_regs)); | |||||
} | } | ||||
int | int | ||||
linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) | linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) | ||||
{ | { | ||||
/* LINUXTODO: implement */ | /* LINUXTODO: implement */ | ||||
LIN_SDT_PROBE0(sysvec, linux_rt_sigreturn, todo); | LIN_SDT_PROBE0(sysvec, linux_rt_sigreturn, todo); | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |