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

Function get_mcontext

freebsd/mips/mips/pm_machdep.c:330–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330int
331get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
332{
333 struct trapframe *tp;
334
335 tp = td->td_frame;
336 PROC_LOCK(curthread->td_proc);
337 mcp->mc_onstack = sigonstack(tp->sp);
338 PROC_UNLOCK(curthread->td_proc);
339 bcopy((void *)&td->td_frame->zero, (void *)&mcp->mc_regs,
340 sizeof(mcp->mc_regs));
341
342 mcp->mc_fpused = td->td_md.md_flags & MDTD_FPUSED;
343 if (mcp->mc_fpused) {
344 bcopy((void *)&td->td_frame->f0, (void *)&mcp->mc_fpregs,
345 sizeof(mcp->mc_fpregs));
346 }
347 if (flags & GET_MC_CLEAR_RET) {
348 mcp->mc_regs[V0] = 0;
349 mcp->mc_regs[V1] = 0;
350 mcp->mc_regs[A3] = 0;
351 }
352
353 mcp->mc_pc = td->td_frame->pc;
354 mcp->mullo = td->td_frame->mullo;
355 mcp->mulhi = td->td_frame->mulhi;
356 mcp->mc_tls = td->td_md.md_tls;
357 return (0);
358}
359
360int
361set_mcontext(struct thread *td, mcontext_t *mcp)

Callers 1

get_mcontext32Function · 0.70

Calls 1

sigonstackFunction · 0.85

Tested by

no test coverage detected