summaryrefslogtreecommitdiffstats
path: root/sys/amd64/ia32
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-04-21 11:17:16 +0000
committerkib <kib@FreeBSD.org>2010-04-21 11:17:16 +0000
commit250ce040895eb4ffdeb276a85cf41d3b576d26a7 (patch)
treefda88118b289848c2ba6c348258f5de72bc5f931 /sys/amd64/ia32
parentb883f7a391f4c0701e1c731511a2a6a35ab62588 (diff)
downloadFreeBSD-src-250ce040895eb4ffdeb276a85cf41d3b576d26a7.zip
FreeBSD-src-250ce040895eb4ffdeb276a85cf41d3b576d26a7.tar.gz
As was done in r155238 for i386 and in r155239 for amd64, clear the carry
flag for ia32 binary executed on amd64 host in get_mcontext(). PR: kern/92110 (one more time) Reported by: stas MFC after: 1 week
Diffstat (limited to 'sys/amd64/ia32')
-rw-r--r--sys/amd64/ia32/ia32_signal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c
index 8033443..859b9923 100644
--- a/sys/amd64/ia32/ia32_signal.c
+++ b/sys/amd64/ia32/ia32_signal.c
@@ -141,9 +141,11 @@ ia32_get_mcontext(struct thread *td, struct ia32_mcontext *mcp, int flags)
mcp->mc_esi = tp->tf_rsi;
mcp->mc_ebp = tp->tf_rbp;
mcp->mc_isp = tp->tf_rsp;
+ mcp->mc_eflags = tp->tf_rflags;
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_rax;
mcp->mc_edx = tp->tf_rdx;
@@ -152,7 +154,6 @@ ia32_get_mcontext(struct thread *td, struct ia32_mcontext *mcp, int flags)
mcp->mc_ecx = tp->tf_rcx;
mcp->mc_eip = tp->tf_rip;
mcp->mc_cs = tp->tf_cs;
- mcp->mc_eflags = tp->tf_rflags;
mcp->mc_esp = tp->tf_rsp;
mcp->mc_ss = tp->tf_ss;
mcp->mc_len = sizeof(*mcp);
OpenPOWER on IntegriCloud