This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.11-371-g0dabf20
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 13 Apr 2010 17:24:11 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.11-371-g0dabf20
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 0dabf204ef2efaff8fa01a8d5d0f17eb8c0db796 (commit)
from ef634a94c7126bcd6ac02de495b598fb99ac544d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0dabf204ef2efaff8fa01a8d5d0f17eb8c0db796
commit 0dabf204ef2efaff8fa01a8d5d0f17eb8c0db796
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue Apr 13 10:23:22 2010 -0700
Fix makecontext on s390/s390x
diff --git a/ChangeLog b/ChangeLog
index be0dd16..60391d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-13 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c: Fix setup of
+ overflow area.
+ * sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c: Likewise.
+
2010-04-12 Andreas Schwab <schwab@redhat.com>
* stdlib/tst-makecontext3.c (main): Initialize ucontext_t objects
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
index 94760e0..0e309c3 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -28,15 +28,15 @@
double, complex and structure with sizes 0, 2, 4 or 8
won't work.
makecontext sets up a stack and the registers for the
- context. The stack looks like this:
- size offset
+ user context. The stack looks like this:
+ size offset
%r15 -> +-----------------------+
- 4 | back chain (zero) | 0
- 4 | reserved | 4
- 88 | save area for (*func) | 8
- +-----------------------+
- n | overflow parameters | 96
- +-----------------------+
+ 4 | back chain (zero) | 0
+ 4 | reserved | 4
+ 88 | save area for (*func) | 8
+ +-----------------------+
+ n | overflow parameters | 96
+ +-----------------------+
The registers are set up like this:
%r2-%r6: parameters 1 to 5
%r7 : (*func) pointer
@@ -54,27 +54,27 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __makecontext_ret (void);
- unsigned long *sp;
+ unsigned long int *sp;
va_list ap;
- int i;
- sp = (unsigned long *) (((unsigned long) ucp->uc_stack.ss_sp
- + ucp->uc_stack.ss_size) & -8L);
+ sp = (unsigned long int *) (((unsigned long int) ucp->uc_stack.ss_sp
+ + ucp->uc_stack.ss_size) & -8L);
/* Set the return address to trampoline. */
- ucp->uc_mcontext.gregs[14] = (long) __makecontext_ret;
+ ucp->uc_mcontext.gregs[14] = (long int) __makecontext_ret;
/* Set register parameters. */
va_start (ap, argc);
- for (i = 0; (i < argc) && (i < 5); i++)
- ucp->uc_mcontext.gregs[2+i] = va_arg (ap, long);
+ for (int i = 0; i < argc && i < 5; ++i)
+ ucp->uc_mcontext.gregs[2 + i] = va_arg (ap, long int);
/* The remaining arguments go to the overflow area. */
- if (argc > 5) {
- sp -= argc - 5;
- for (i = 5; i < argc; i++)
- sp[i] = va_arg(ap, long);
- }
+ if (argc > 5)
+ {
+ sp -= argc - 5;
+ for (int i = 5; i < argc; ++i)
+ sp[i - 5] = va_arg (ap, long int);
+ }
va_end (ap);
/* Make room for the save area and set the backchain. */
@@ -82,24 +82,24 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
*sp = 0;
/* Pass (*func) to __start_context in %r7. */
- ucp->uc_mcontext.gregs[7] = (long) func;
+ ucp->uc_mcontext.gregs[7] = (long int) func;
/* Pass ucp->uc_link to __start_context in %r8. */
- ucp->uc_mcontext.gregs[8] = (long) ucp->uc_link;
+ ucp->uc_mcontext.gregs[8] = (long int) ucp->uc_link;
/* Pass address of setcontext in %r9. */
- ucp->uc_mcontext.gregs[9] = (long) &setcontext;
+ ucp->uc_mcontext.gregs[9] = (long int) &setcontext;
/* Set stack pointer. */
- ucp->uc_mcontext.gregs[15] = (long) sp;
+ ucp->uc_mcontext.gregs[15] = (long int) 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");
+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)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c b/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
index b08f1b4..40ff3ee 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -29,14 +29,14 @@
won't work.
makecontext sets up a stack and the registers for the
user context. The stack looks like this:
- size offset
+ size offset
%r15 -> +-----------------------+
- 8 | back chain (zero) | 0
- 8 | reserved | 8
- 144 | save area for (*func) | 16
- +-----------------------+
- n | overflow parameters | 160
- +-----------------------+
+ 8 | back chain (zero) | 0
+ 8 | reserved | 8
+ 144 | save area for (*func) | 16
+ +-----------------------+
+ n | overflow parameters | 160
+ +-----------------------+
The registers are set up like this:
%r2-%r6: parameters 1 to 5
%r7 : (*func) pointer
@@ -54,27 +54,27 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __makecontext_ret (void);
- unsigned long *sp;
+ unsigned long int *sp;
va_list ap;
- int i;
- sp = (unsigned long *) (((unsigned long) ucp->uc_stack.ss_sp
- + ucp->uc_stack.ss_size) & -8L);
+ sp = (unsigned long int *) (((unsigned long int) ucp->uc_stack.ss_sp
+ + ucp->uc_stack.ss_size) & -8L);
/* Set the return address to trampoline. */
- ucp->uc_mcontext.gregs[14] = (long) __makecontext_ret;
+ ucp->uc_mcontext.gregs[14] = (long int) __makecontext_ret;
/* Set register parameters. */
va_start (ap, argc);
- for (i = 0; (i < argc) && (i < 5); i++)
- ucp->uc_mcontext.gregs[2+i] = va_arg (ap, long);
+ for (int i = 0; i < argc && i < 5; ++i)
+ ucp->uc_mcontext.gregs[2 + i] = va_arg (ap, long int);
/* The remaining arguments go to the overflow area. */
- if (argc > 5) {
- sp -= argc - 5;
- for (i = 5; i < argc; i++)
- sp[i] = va_arg(ap, long);
- }
+ if (argc > 5)
+ {
+ sp -= argc - 5;
+ for (int i = 5; i < argc; ++i)
+ sp[i - 5] = va_arg (ap, long int);
+ }
va_end (ap);
/* Make room for the save area and set the backchain. */
@@ -82,24 +82,24 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
*sp = 0;
/* Pass (*func) to __start_context in %r7. */
- ucp->uc_mcontext.gregs[7] = (long) func;
+ ucp->uc_mcontext.gregs[7] = (long int) func;
/* Pass ucp->uc_link to __start_context in %r8. */
- ucp->uc_mcontext.gregs[8] = (long) ucp->uc_link;
+ ucp->uc_mcontext.gregs[8] = (long int) ucp->uc_link;
/* Pass address of setcontext in %r9. */
- ucp->uc_mcontext.gregs[9] = (long) &setcontext;
+ ucp->uc_mcontext.gregs[9] = (long int) &setcontext;
/* Set stack pointer. */
- ucp->uc_mcontext.gregs[15] = (long) sp;
+ ucp->uc_mcontext.gregs[15] = (long int) sp;
}
-asm(".text\n"
- ".type __makecontext_ret,@function\n"
- "__makecontext_ret:\n"
- " basr %r14,%r7\n"
- " lgr %r2,%r8\n"
- " br %r9\n"
- ".size __makecontext_ret, .-__makecontext_ret");
+asm (".text\n"
+ ".type __makecontext_ret,@function\n"
+ "__makecontext_ret:\n"
+ " basr %r14,%r7\n"
+ " lgr %r2,%r8\n"
+ " br %r9\n"
+ ".size __makecontext_ret, .-__makecontext_ret");
weak_alias (__makecontext, makecontext)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++
sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c | 64 ++++++++++----------
sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c | 62 ++++++++++----------
3 files changed, 69 insertions(+), 63 deletions(-)
hooks/post-receive
--
GNU C Library master sources