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

Function get_mcontext

freebsd/arm64/arm64/machdep.c:569–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567 sizeof((struct reg *)0)->x);
568
569int
570get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
571{
572 struct trapframe *tf = td->td_frame;
573
574 if (clear_ret & GET_MC_CLEAR_RET) {
575 mcp->mc_gpregs.gp_x[0] = 0;
576 mcp->mc_gpregs.gp_spsr = tf->tf_spsr & ~PSR_C;
577 } else {
578 mcp->mc_gpregs.gp_x[0] = tf->tf_x[0];
579 mcp->mc_gpregs.gp_spsr = tf->tf_spsr;
580 }
581
582 memcpy(&mcp->mc_gpregs.gp_x[1], &tf->tf_x[1],
583 sizeof(mcp->mc_gpregs.gp_x[1]) * (nitems(mcp->mc_gpregs.gp_x) - 1));
584
585 mcp->mc_gpregs.gp_sp = tf->tf_sp;
586 mcp->mc_gpregs.gp_lr = tf->tf_lr;
587 mcp->mc_gpregs.gp_elr = tf->tf_elr;
588 get_fpcontext(td, mcp);
589
590 return (0);
591}
592
593int
594set_mcontext(struct thread *td, mcontext_t *mcp)

Callers 1

sendsigFunction · 0.70

Calls 2

get_fpcontextFunction · 0.70
memcpyFunction · 0.50

Tested by

no test coverage detected