about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
index 94760e0c2b..29c8640e92 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
@@ -37,6 +37,8 @@
                +-----------------------+
              n | overflow parameters   | 96
                +-----------------------+
+             8 | trampoline            | 96+n
+               +-----------------------+
    The registers are set up like this:
      %r2-%r6: parameters 1 to 5
      %r7    : (*func) pointer
@@ -53,16 +55,18 @@
 void
 __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 {
-  extern void __makecontext_ret (void);
   unsigned long *sp;
   va_list ap;
   int i;
 
-  sp = (unsigned long *) (((unsigned long) ucp->uc_stack.ss_sp
-			   + ucp->uc_stack.ss_size) & -8L);
+  sp = (long *) (((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & -8L);
+
+  /* Setup the trampoline.  */
+  *--sp = 0x07f90000;
+  *--sp = 0x0de71828;
 
   /* Set the return address to trampoline.  */
-  ucp->uc_mcontext.gregs[14] = (long) __makecontext_ret;
+  ucp->uc_mcontext.gregs[14] = (long) sp;
 
   /* Set register parameters.  */
   va_start (ap, argc);
@@ -94,12 +98,4 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
   ucp->uc_mcontext.gregs[15] = (long) sp;
 }
 
-asm(".text\n"
-    ".type __makecontext_ret,@function\n"
-    "__makecontext_ret:\n"
-    "      basr  %r14,%r7\n"
-    "      lr    %r2,%r8\n"
-    "      br    %r9\n"
-    ".size __makecontext_ret, .-__makecontext_ret");
-
 weak_alias (__makecontext, makecontext)