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

Function get_fpcontext

freebsd/amd64/amd64/machdep.c:2393–2414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2391}
2392
2393static void
2394get_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpusave,
2395 size_t xfpusave_len)
2396{
2397 size_t max_len, len;
2398
2399 mcp->mc_ownedfp = fpugetregs(td);
2400 bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0],
2401 sizeof(mcp->mc_fpstate));
2402 mcp->mc_fpformat = fpuformat();
2403 if (!use_xsave || xfpusave_len == 0)
2404 return;
2405 max_len = cpu_max_ext_state_size - sizeof(struct savefpu);
2406 len = xfpusave_len;
2407 if (len > max_len) {
2408 len = max_len;
2409 bzero(xfpusave + max_len, len - max_len);
2410 }
2411 mcp->mc_flags |= _MC_HASFPXSTATE;
2412 mcp->mc_xfpustate_len = len;
2413 bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len);
2414}
2415
2416static int
2417set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,

Callers 2

sendsigFunction · 0.70
get_mcontextFunction · 0.70

Calls 4

fpugetregsFunction · 0.85
fpuformatFunction · 0.85
bzeroFunction · 0.85
get_pcb_user_save_tdFunction · 0.70

Tested by

no test coverage detected