From: Ben Gras Date: Tue, 20 Jul 2010 17:10:09 +0000 (+0000) Subject: kernel: fix case of EAX getting clobbered after sigreturn. X-Git-Tag: v3.1.8~181 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.3.html?a=commitdiff_plain;h=c0074d3aa9a90089a36bc539750736241cc3507d;p=minix.git kernel: fix case of EAX getting clobbered after sigreturn. --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 8305df8c0..88054dff9 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -612,7 +612,9 @@ PUBLIC void delivermsg(struct proc *rp) r = OK; } - rp->p_reg.retreg = r; + if(!(rp->p_misc_flags & MF_CONTEXT_SET)) { + rp->p_reg.retreg = r; + } } PRIVATE char *flagstr(u32_t e, const int dir) diff --git a/kernel/proc.h b/kernel/proc.h index 5ce97d379..dc70a806c 100644 --- a/kernel/proc.h +++ b/kernel/proc.h @@ -224,6 +224,7 @@ struct proc { #define MF_FPU_INITIALIZED 0x1000 /* process already used math, so fpu * regs are significant (initialized)*/ #define MF_SENDING_FROM_KERNEL 0x2000 /* message of this process is from kernel */ +#define MF_CONTEXT_SET 0x4000 /* don't touch context */ /* Magic process table addresses. */ #define BEG_PROC_ADDR (&proc[0]) diff --git a/kernel/system/do_sigreturn.c b/kernel/system/do_sigreturn.c index 6e8e1abe1..7f91a0a34 100644 --- a/kernel/system/do_sigreturn.c +++ b/kernel/system/do_sigreturn.c @@ -65,6 +65,8 @@ PUBLIC int do_sigreturn(struct proc * caller, message * m_ptr) } #endif + rp->p_misc_flags |= MF_CONTEXT_SET; + return(OK); } #endif /* USE_SIGRETURN */