Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/machdep.c
Show First 20 Lines • Show All 546 Lines • ▼ Show 20 Lines | ptrace_clear_single_step(struct thread *td) | ||||
td->td_pcb->pcb_flags &= ~PCB_SINGLE_STEP; | td->td_pcb->pcb_flags &= ~PCB_SINGLE_STEP; | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) | exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) | ||||
{ | { | ||||
struct trapframe *tf = td->td_frame; | struct trapframe *tf = td->td_frame; | ||||
struct pcb *pcb = td->td_pcb; | |||||
memset(tf, 0, sizeof(struct trapframe)); | memset(tf, 0, sizeof(struct trapframe)); | ||||
andrew: This should be in `vfp.c` and should probably call `vfp_discard` to ensure the hardware state… | |||||
Done Inline ActionsI just tried moving it to vfp.c but that makes things really ugly if I want to handle !VFP cases. Can't I just add #ifdef VFP vfp_discard(td); #endif to the end of this function? arichardson: I just tried moving it to vfp.c but that makes things really ugly if I want to handle !VFP… | |||||
tf->tf_x[0] = stack; | tf->tf_x[0] = stack; | ||||
tf->tf_sp = STACKALIGN(stack); | tf->tf_sp = STACKALIGN(stack); | ||||
tf->tf_lr = imgp->entry_addr; | tf->tf_lr = imgp->entry_addr; | ||||
tf->tf_elr = imgp->entry_addr; | tf->tf_elr = imgp->entry_addr; | ||||
#ifdef VFP | |||||
vfp_reset_state(td, pcb); | |||||
#endif | |||||
/* TODO: Shouldn't we also reset pcb_dbg_regs? */ | |||||
} | } | ||||
/* Sanity check these are the same size, they will be memcpy'd to and fro */ | /* Sanity check these are the same size, they will be memcpy'd to and fro */ | ||||
CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | ||||
sizeof((struct gpregs *)0)->gp_x); | sizeof((struct gpregs *)0)->gp_x); | ||||
CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | ||||
sizeof((struct reg *)0)->x); | sizeof((struct reg *)0)->x); | ||||
▲ Show 20 Lines • Show All 892 Lines • Show Last 20 Lines |
This should be in vfp.c and should probably call vfp_discard to ensure the hardware state is updated if it's enabled.