From: Kees Jongenburger Date: Wed, 2 Apr 2014 07:28:38 +0000 (+0200) Subject: libc:x86 fix for get and setcontext assembly calls. X-Git-Tag: v3.3.0~374 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc-confgen.html?a=commitdiff_plain;h=8991ca4e5afe07c197e25eefce1284bbe0d51497;p=minix.git libc:x86 fix for get and setcontext assembly calls. The get and set context calls where wrongly assuming that the value of arguments passed on the stack where kept unmodified. Change-Id: I779b08d7f5a6472c5e9dc351ae44abb2acafb3bd --- diff --git a/lib/libc/arch/i386/sys-minix/ucontext.S b/lib/libc/arch/i386/sys-minix/ucontext.S index 92ec539d6..e72331a47 100644 --- a/lib/libc/arch/i386/sys-minix/ucontext.S +++ b/lib/libc/arch/i386/sys-minix/ucontext.S @@ -34,9 +34,11 @@ ENTRY(_getcontext) cmp $[_UC_IGNFPU|_UC_IGNSIGM], %eax jz 5f /* Ignore both, skip getuctx */ PIC_PROLOGUE - push %edx + push %edx /* push a copy for us */ + push %edx /* push a copy as function argument */ call PIC_PLT(_C_LABEL(getuctx)) /* getuctx(ucp) */ - pop %edx /* clean up stack and restore edx */ + pop %edx /* clean up stack */ + pop %edx /* clean up stack and restore edx */ PIC_EPILOGUE 5: @@ -96,9 +98,11 @@ ENTRY(setcontext) * state and signal mask */ PIC_PROLOGUE - push %edx + push %edx /* push a copy for us */ + push %edx /* push a copy as function argument */ call PIC_PLT(_C_LABEL(setuctx)) /* setuctx(ucp) */ - pop %edx /* Clean up stack and restore edx */ + pop %edx /* clean up stack */ + pop %edx /* clean up stack and restore edx */ PIC_EPILOGUE 5: /* Restore the registers (except EAX and EDX) */