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
This commit is contained in:
parent
69b8ce6ab2
commit
8991ca4e5a
1 changed files with 8 additions and 4 deletions
|
@ -34,9 +34,11 @@ ENTRY(_getcontext)
|
||||||
cmp $[_UC_IGNFPU|_UC_IGNSIGM], %eax
|
cmp $[_UC_IGNFPU|_UC_IGNSIGM], %eax
|
||||||
jz 5f /* Ignore both, skip getuctx */
|
jz 5f /* Ignore both, skip getuctx */
|
||||||
PIC_PROLOGUE
|
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) */
|
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
|
PIC_EPILOGUE
|
||||||
|
|
||||||
5:
|
5:
|
||||||
|
@ -96,9 +98,11 @@ ENTRY(setcontext)
|
||||||
* state and signal mask */
|
* state and signal mask */
|
||||||
|
|
||||||
PIC_PROLOGUE
|
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) */
|
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
|
PIC_EPILOGUE
|
||||||
|
|
||||||
5: /* Restore the registers (except EAX and EDX) */
|
5: /* Restore the registers (except EAX and EDX) */
|
||||||
|
|
Loading…
Reference in a new issue