From: Ben Gras Date: Sun, 4 Jul 2010 23:09:24 +0000 (+0000) Subject: kernel: use MF_KCALL_RESUME instead of RTS_VMREQUEST for memcopy retry. X-Git-Tag: v3.1.8~288 X-Git-Url: http://zhaoyanbai.com/repos/doc/mandoc_char.7.html?a=commitdiff_plain;h=545054c608daa6b05a891305ffd1ec0dc7470eab;p=minix.git kernel: use MF_KCALL_RESUME instead of RTS_VMREQUEST for memcopy retry. solves tracker item 499, submitted by Roman Ignatov. --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index cdff15981..b5e9f4add 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -570,6 +570,8 @@ PRIVATE void vm_suspend(struct proc *caller, const struct proc *target, */ assert(!RTS_ISSET(caller, RTS_VMREQUEST)); assert(!RTS_ISSET(target, RTS_VMREQUEST)); + assert(!(caller->p_misc_flags & MF_KCALL_RESUME)); + assert(!(target->p_misc_flags & MF_KCALL_RESUME)); RTS_SET(caller, RTS_VMREQUEST); @@ -819,9 +821,8 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ if(vm_running) { int r; - if(caller && RTS_ISSET(caller, RTS_VMREQUEST)) { + if(caller && (caller->p_misc_flags & MF_KCALL_RESUME)) { assert(caller->p_vmrequest.vmresult != VMSUSPEND); - RTS_UNSET(caller, RTS_VMREQUEST); if(caller->p_vmrequest.vmresult != OK) { return caller->p_vmrequest.vmresult; } diff --git a/kernel/system.c b/kernel/system.c index ac89638cd..e3a1b769a 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -591,11 +591,14 @@ PUBLIC void kernel_call_resume(struct proc *caller) caller->p_rts_flags, caller->p_misc_flags); */ + /* re-execute the kernel call, with MF_KCALL_RESUME still set so + * the call knows this is a retry. + */ + result = kernel_call_dispatch(caller, &caller->p_vmrequest.saved.reqmsg); /* * we are resuming the kernel call so we have to remove this flag so it * can be set again */ caller->p_misc_flags &= ~MF_KCALL_RESUME; - result = kernel_call_dispatch(caller, &caller->p_vmrequest.saved.reqmsg); kernel_call_finish(caller, &caller->p_vmrequest.saved.reqmsg, result); }