MFC amd64/amd64/machdep.c revision 1.646, i386/i386/machdep.c
revision 1.622 > > Clear carry flag in get_mcontext so that setcontext does not > return a bogus error. > > PR: misc/92110 Approved by: re (scottl)
This commit is contained in:
parent
e7e9bb50b6
commit
7bd3a09a50
@ -1579,16 +1579,17 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
|
||||
mcp->mc_rbp = tp->tf_rbp;
|
||||
mcp->mc_rbx = tp->tf_rbx;
|
||||
mcp->mc_rcx = tp->tf_rcx;
|
||||
mcp->mc_rflags = tp->tf_rflags;
|
||||
if (flags & GET_MC_CLEAR_RET) {
|
||||
mcp->mc_rax = 0;
|
||||
mcp->mc_rdx = 0;
|
||||
mcp->mc_rflags &= ~PSL_C;
|
||||
} else {
|
||||
mcp->mc_rax = tp->tf_rax;
|
||||
mcp->mc_rdx = tp->tf_rdx;
|
||||
}
|
||||
mcp->mc_rip = tp->tf_rip;
|
||||
mcp->mc_cs = tp->tf_cs;
|
||||
mcp->mc_rflags = tp->tf_rflags;
|
||||
mcp->mc_rsp = tp->tf_rsp;
|
||||
mcp->mc_ss = tp->tf_ss;
|
||||
mcp->mc_len = sizeof(*mcp);
|
||||
|
@ -2527,9 +2527,11 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
|
||||
mcp->mc_esi = tp->tf_esi;
|
||||
mcp->mc_ebp = tp->tf_ebp;
|
||||
mcp->mc_isp = tp->tf_isp;
|
||||
mcp->mc_eflags = tp->tf_eflags;
|
||||
if (flags & GET_MC_CLEAR_RET) {
|
||||
mcp->mc_eax = 0;
|
||||
mcp->mc_edx = 0;
|
||||
mcp->mc_eflags &= ~PSL_C;
|
||||
} else {
|
||||
mcp->mc_eax = tp->tf_eax;
|
||||
mcp->mc_edx = tp->tf_edx;
|
||||
@ -2538,7 +2540,6 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
|
||||
mcp->mc_ecx = tp->tf_ecx;
|
||||
mcp->mc_eip = tp->tf_eip;
|
||||
mcp->mc_cs = tp->tf_cs;
|
||||
mcp->mc_eflags = tp->tf_eflags;
|
||||
mcp->mc_esp = tp->tf_esp;
|
||||
mcp->mc_ss = tp->tf_ss;
|
||||
mcp->mc_len = sizeof(*mcp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user