summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
committerJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
commit574e283890a6ca92325a06dafa76ff307a8019a2 (patch)
tree055e44e24a55fb4863e5d9cdc04e320cde52ffe9 /sysdeps/unix/sysv/linux/i386
parenta162e5955f7e324be82d9318bbcbe869c66ffb86 (diff)
Updated to fedora-glibc-20071212T1051
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386')
-rw-r--r--sysdeps/unix/sysv/linux/i386/makecontext.S16
1 files changed, 11 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
index 12ba4e2d67..89be1176f7 100644
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
@@ -35,11 +35,6 @@ ENTRY(__makecontext)
movl %ecx, oEIP(%eax)
addl oSS_SIZE(%eax), %edx
- /* Put the next context on the new stack (from the uc_link
- element). */
- movl oLINK(%eax), %ecx
- movl %ecx, -4(%edx)
-
/* Remember the number of parameters for the exit handler since
it has to remove them. We store the number in the EBX register
which the function we will call must preserve. */
@@ -50,9 +45,20 @@ ENTRY(__makecontext)
negl %ecx
leal -8(%edx,%ecx,4), %edx
negl %ecx
+
+ /* Align the stack. */
+ addl $16, %edx
+ andl $0xfffffff0, %edx
+ subl $4, %edx
+
/* Store the future stack pointer. */
movl %edx, oESP(%eax)
+ /* Put the next context on the new stack (from the uc_link
+ element). */
+ movl oLINK(%eax), %eax
+ movl %eax, 4(%edx,%ecx,4)
+
/* Copy all the parameters. */
jecxz 2f
1: movl 12(%esp,%ecx,4), %eax