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

Function set_fpcontext

freebsd/amd64/amd64/machdep.c:2416–2437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2414}
2415
2416static int
2417set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,
2418 size_t xfpustate_len)
2419{
2420 int error;
2421
2422 if (mcp->mc_fpformat == _MC_FPFMT_NODEV)
2423 return (0);
2424 else if (mcp->mc_fpformat != _MC_FPFMT_XMM)
2425 return (EINVAL);
2426 else if (mcp->mc_ownedfp == _MC_FPOWNED_NONE) {
2427 /* We don't care what state is left in the FPU or PCB. */
2428 fpstate_drop(td);
2429 error = 0;
2430 } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU ||
2431 mcp->mc_ownedfp == _MC_FPOWNED_PCB) {
2432 error = fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate,
2433 xfpustate, xfpustate_len);
2434 } else
2435 return (EINVAL);
2436 return (error);
2437}
2438
2439void
2440fpstate_drop(struct thread *td)

Callers 2

sys_sigreturnFunction · 0.70
set_mcontextFunction · 0.70

Calls 2

fpusetregsFunction · 0.85
fpstate_dropFunction · 0.70

Tested by

no test coverage detected