about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/s390/s390-32
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-09-20 14:31:00 +0000
committerUlrich Drepper <drepper@redhat.com>2006-09-20 14:31:00 +0000
commit60cb50c7b678a1cd2d794f134b81bea53dcf84b0 (patch)
treec68d146f5e46a0dd9022c51afb768f3816b58ba5 /sysdeps/unix/sysv/linux/s390/s390-32
parent33315cedf5da9c1974a0dff0097af074cf8dbb42 (diff)
downloadglibc-60cb50c7b678a1cd2d794f134b81bea53dcf84b0.tar.gz
glibc-60cb50c7b678a1cd2d794f134b81bea53dcf84b0.tar.xz
glibc-60cb50c7b678a1cd2d794f134b81bea53dcf84b0.zip
* sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c (__makecontext):
	Cast sp to unsigned long to avoid compiler warning.
	Use __makecontext_ret function instead of a trampoline on the stack.
	(__makecontext_ret): New function.
	* sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-32')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
index 29c8640e92..94760e0c2b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
@@ -37,8 +37,6 @@
                +-----------------------+
              n | overflow parameters   | 96
                +-----------------------+
-             8 | trampoline            | 96+n
-               +-----------------------+
    The registers are set up like this:
      %r2-%r6: parameters 1 to 5
      %r7    : (*func) pointer
@@ -55,18 +53,16 @@
 void
 __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 {
+  extern void __makecontext_ret (void);
   unsigned long *sp;
   va_list ap;
   int i;
 
-  sp = (long *) (((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & -8L);
-
-  /* Setup the trampoline.  */
-  *--sp = 0x07f90000;
-  *--sp = 0x0de71828;
+  sp = (unsigned long *) (((unsigned long) ucp->uc_stack.ss_sp
+			   + ucp->uc_stack.ss_size) & -8L);
 
   /* Set the return address to trampoline.  */
-  ucp->uc_mcontext.gregs[14] = (long) sp;
+  ucp->uc_mcontext.gregs[14] = (long) __makecontext_ret;
 
   /* Set register parameters.  */
   va_start (ap, argc);
@@ -98,4 +94,12 @@ __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)