diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-02-03 02:33:01 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-02-03 02:33:01 +0000 |
commit | 5e2e272cd9a89511277b655da0b0389db3b8a80b (patch) | |
tree | 70a634f8df6032293f031e6486044f4dfc991521 | |
parent | 06bbcb2dd7b9a082fb0fad39a3644f5ca5055356 (diff) | |
download | FreeBSD-src-5e2e272cd9a89511277b655da0b0389db3b8a80b.zip FreeBSD-src-5e2e272cd9a89511277b655da0b0389db3b8a80b.tar.gz |
Clear carry flag in get_mcontext so that setcontext does not
return a bogus error.
PR: misc/92110
-rw-r--r-- | sys/i386/i386/machdep.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 18e30f8..478231f 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2573,9 +2573,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; @@ -2584,7 +2586,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); |