Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/exec_machdep.c
Show First 20 Lines • Show All 449 Lines • ▼ Show 20 Lines | get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) | ||||
} | } | ||||
memcpy(&mcp->mc_gpregs.gp_x[1], &tf->tf_x[1], | memcpy(&mcp->mc_gpregs.gp_x[1], &tf->tf_x[1], | ||||
sizeof(mcp->mc_gpregs.gp_x[1]) * (nitems(mcp->mc_gpregs.gp_x) - 1)); | sizeof(mcp->mc_gpregs.gp_x[1]) * (nitems(mcp->mc_gpregs.gp_x) - 1)); | ||||
mcp->mc_gpregs.gp_sp = tf->tf_sp; | mcp->mc_gpregs.gp_sp = tf->tf_sp; | ||||
mcp->mc_gpregs.gp_lr = tf->tf_lr; | mcp->mc_gpregs.gp_lr = tf->tf_lr; | ||||
mcp->mc_gpregs.gp_elr = tf->tf_elr; | mcp->mc_gpregs.gp_elr = tf->tf_elr; | ||||
mcp->mc_flags = _MC_TLS_VALID; | |||||
mcp->mc_tpidr = READ_SPECIALREG(tpidr_el0); | |||||
get_fpcontext(td, mcp); | get_fpcontext(td, mcp); | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
set_mcontext(struct thread *td, mcontext_t *mcp) | set_mcontext(struct thread *td, mcontext_t *mcp) | ||||
{ | { | ||||
Show All 33 Lines | #endif | ||||
tf->tf_spsr = spsr; | tf->tf_spsr = spsr; | ||||
if ((tf->tf_spsr & PSR_SS) != 0) { | if ((tf->tf_spsr & PSR_SS) != 0) { | ||||
td->td_pcb->pcb_flags |= PCB_SINGLE_STEP; | td->td_pcb->pcb_flags |= PCB_SINGLE_STEP; | ||||
WRITE_SPECIALREG(mdscr_el1, | WRITE_SPECIALREG(mdscr_el1, | ||||
READ_SPECIALREG(mdscr_el1) | MDSCR_SS); | READ_SPECIALREG(mdscr_el1) | MDSCR_SS); | ||||
isb(); | isb(); | ||||
} | } | ||||
if ((mcp->mc_flags & _MC_TLS_VALID) != 0) | |||||
WRITE_SPECIALREG(tpidr_el0, mcp->mc_tpidr); | |||||
set_fpcontext(td, mcp); | set_fpcontext(td, mcp); | ||||
return (0); | return (0); | ||||
#undef PSR_13_MASK | #undef PSR_13_MASK | ||||
} | } | ||||
static void | static void | ||||
get_fpcontext(struct thread *td, mcontext_t *mcp) | get_fpcontext(struct thread *td, mcontext_t *mcp) | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |