| 328 | } |
| 329 | |
| 330 | int |
| 331 | get_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 | |
| 360 | int |
| 361 | set_mcontext(struct thread *td, mcontext_t *mcp) |
no test coverage detected