| 614 | } |
| 615 | |
| 616 | static void |
| 617 | get_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 | |
| 649 | static void |
| 650 | set_fpcontext(struct thread *td, mcontext_t *mcp) |
no test coverage detected