| 567 | sizeof((struct reg *)0)->x); |
| 568 | |
| 569 | int |
| 570 | get_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 | |
| 593 | int |
| 594 | set_mcontext(struct thread *td, mcontext_t *mcp) |
no test coverage detected