MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_fpcontext

Function get_fpcontext

freebsd/arm64/arm64/machdep.c:616–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616static void
617get_fpcontext(struct thread *td, mcontext_t *mcp)
618{
619#ifdef VFP
620 struct pcb *curpcb;
621
622 critical_enter();
623
624 curpcb = curthread->td_pcb;
625
626 if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
627 /*
628 * If we have just been running VFP instructions we will
629 * need to save the state to memcpy it below.
630 */
631 vfp_save_state(td, curpcb);
632
633 KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate,
634 ("Called get_fpcontext while the kernel is using the VFP"));
635 KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0,
636 ("Non-userspace FPU flags set in get_fpcontext"));
637 memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_fpustate.vfp_regs,
638 sizeof(mcp->mc_fpregs));
639 mcp->mc_fpregs.fp_cr = curpcb->pcb_fpustate.vfp_fpcr;
640 mcp->mc_fpregs.fp_sr = curpcb->pcb_fpustate.vfp_fpsr;
641 mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags;
642 mcp->mc_flags |= _MC_FP_VALID;
643 }
644
645 critical_exit();
646#endif
647}
648
649static void
650set_fpcontext(struct thread *td, mcontext_t *mcp)

Callers 1

get_mcontextFunction · 0.70

Calls 4

vfp_save_stateFunction · 0.85
critical_enterFunction · 0.50
memcpyFunction · 0.50
critical_exitFunction · 0.50

Tested by

no test coverage detected