summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-07-16 07:32:48 +0000
committerUlrich Drepper <drepper@redhat.com>2001-07-16 07:32:48 +0000
commit778e0ef71de6430ca6af4410453e675bd96b040f (patch)
treea83bd35f37465b24654ae211e61f668092a3822a
parent3c204435e91ba20fbfef438e52fdc147e679ca58 (diff)
downloadglibc-778e0ef71de6430ca6af4410453e675bd96b040f.tar.gz
glibc-778e0ef71de6430ca6af4410453e675bd96b040f.tar.xz
glibc-778e0ef71de6430ca6af4410453e675bd96b040f.zip
Update.
2001-07-15  Ulrich Drepper  <drepper@redhat.com>

	* malloc/obstack.c: Define __attribute__ for non-gcc compilers.
	Patch by Jim Meyering <jim@meyering.net>.

2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h: Reorder
	fields in the sigaction struct to match the definition in the kernel.

2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Correct the
	test for ENOSYS.

2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/s390/s390-32/bits/setjmp.h: Add leading underscores
	to the entries in the __jmp_buf structure.
	* sysdeps/s390/s390-64/bits/setjmp.h: Likewise.

2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/s390/s390-32/bcopy.S: Use mvcle for big blocks
	(> 64K) and a mvc loop for small blocks.
	* sysdeps/s390/s390-32/memcpy.S: Likewise.
	* sysdeps/s390/s390-64/bcopy.S: Likewise.
	* sysdeps/s390/s390-64/memcpy.S: Likewise.
-rw-r--r--ChangeLog29
-rw-r--r--linuxthreads/ChangeLog7
-rw-r--r--linuxthreads/pthread.c78
-rw-r--r--malloc/obstack.c7
-rw-r--r--sysdeps/s390/s390-32/bits/setjmp.h6
-rw-r--r--sysdeps/s390/s390-64/bits/setjmp.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h3
8 files changed, 96 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b9e06961b..ac2c57caa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2001-07-15  Ulrich Drepper  <drepper@redhat.com>
+
+	* malloc/obstack.c: Define __attribute__ for non-gcc compilers.
+	Patch by Jim Meyering <jim@meyering.net>.
+
+2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+	* sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h: Reorder
+	fields in the sigaction struct to match the definition in the kernel.
+
+2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+	* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Correct the
+	test for ENOSYS.
+
+2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+	* sysdeps/s390/s390-32/bits/setjmp.h: Add leading underscores
+	to the entries in the __jmp_buf structure.
+	* sysdeps/s390/s390-64/bits/setjmp.h: Likewise.
+
+2001-07-12  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+	* sysdeps/s390/s390-32/bcopy.S: Use mvcle for big blocks
+	(> 64K) and a mvc loop for small blocks.
+	* sysdeps/s390/s390-32/memcpy.S: Likewise.
+	* sysdeps/s390/s390-64/bcopy.S: Likewise.
+	* sysdeps/s390/s390-64/memcpy.S: Likewise.
+
 2001-07-15  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/unix/sysv/linux/m68k/sys/procfs.h: New file.
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index efc0143549..b4bab43888 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-16  Ulrich Drepper  <drepper@redhat.com>
+
+	* pthread.c (pthread_initialize): For FLOATING_STACKS do't bother
+	to find the right value for __pthread_initial_thread_bos, it's not
+	used.  If not FLOATING_STACKS first run
+	__pthread_init_max_stacksize.
+
 2001-06-16  H.J. Lu  <hjl@gnu.org>
 
 	* internals.h: Include <stackinfo.h>.
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 88fbf0ce0f..1321bd488b 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -401,6 +401,40 @@ __pthread_initialize_minimal(void)
 }
 
 
+void
+__pthread_init_max_stacksize(void)
+{
+  struct rlimit limit;
+  size_t max_stack;
+
+  getrlimit(RLIMIT_STACK, &limit);
+#ifdef FLOATING_STACKS
+  if (limit.rlim_cur == RLIM_INFINITY)
+    limit.rlim_cur = ARCH_STACK_MAX_SIZE;
+# ifdef NEED_SEPARATE_REGISTER_STACK
+  max_stack = limit.rlim_cur / 2;
+# else
+  max_stack = limit.rlim_cur;
+# endif
+#else
+  /* Play with the stack size limit to make sure that no stack ever grows
+     beyond STACK_SIZE minus one page (to act as a guard page). */
+# ifdef NEED_SEPARATE_REGISTER_STACK
+  /* STACK_SIZE bytes hold both the main stack and register backing
+     store. The rlimit value applies to each individually.  */
+  max_stack = STACK_SIZE/2 - __getpagesize ();
+# else
+  max_stack = STACK_SIZE - __getpagesize();
+# endif
+  if (limit.rlim_cur > max_stack) {
+    limit.rlim_cur = max_stack;
+    setrlimit(RLIMIT_STACK, &limit);
+  }
+#endif
+  __pthread_max_stacksize = max_stack;
+}
+
+
 static void pthread_initialize(void)
 {
   struct sigaction sa;
@@ -412,16 +446,24 @@ static void pthread_initialize(void)
   /* Test if compare-and-swap is available */
   __pthread_has_cas = compare_and_swap_is_available();
 #endif
-#ifdef _STACK_GROWS_UP
+#ifdef FLOATING_STACKS
+  /* We don't need to know the bottom of the stack.  Give the pointer some
+     value to signal that initialization happened.  */
+  __pthread_initial_thread_bos = (void *) -1l;
+#else
+  /* Determine stack size limits .  */
+  __pthread_init_max_stacksize ();
+# ifdef _STACK_GROWS_UP
   /* The initial thread already has all the stack it needs */
   __pthread_initial_thread_bos = (char *)
     ((long)CURRENT_STACK_FRAME &~ (STACK_SIZE - 1));
-#else
+# else
   /* For the initial stack, reserve at least STACK_SIZE bytes of stack
      below the current stack address, and align that on a
      STACK_SIZE boundary. */
   __pthread_initial_thread_bos =
     (char *)(((long)CURRENT_STACK_FRAME - 2 * STACK_SIZE) & ~(STACK_SIZE - 1));
+# endif
 #endif
   /* Update the descriptor for the initial thread. */
   __pthread_initial_thread.p_pid = __getpid();
@@ -470,38 +512,6 @@ void __pthread_initialize(void)
   pthread_initialize();
 }
 
-void __pthread_init_max_stacksize(void)
-{
-  struct rlimit limit;
-  size_t max_stack;
-
-  getrlimit(RLIMIT_STACK, &limit);
-#ifdef FLOATING_STACKS
-  if (limit.rlim_cur == RLIM_INFINITY)
-    limit.rlim_cur = ARCH_STACK_MAX_SIZE;
-# ifdef NEED_SEPARATE_REGISTER_STACK
-  max_stack = limit.rlim_cur / 2;
-# else
-  max_stack = limit.rlim_cur;
-# endif
-#else
-  /* Play with the stack size limit to make sure that no stack ever grows
-     beyond STACK_SIZE minus one page (to act as a guard page). */
-# ifdef NEED_SEPARATE_REGISTER_STACK
-  /* STACK_SIZE bytes hold both the main stack and register backing
-     store. The rlimit value applies to each individually.  */
-  max_stack = STACK_SIZE/2 - __getpagesize ();
-# else
-  max_stack = STACK_SIZE - __getpagesize();
-# endif
-  if (limit.rlim_cur > max_stack) {
-    limit.rlim_cur = max_stack;
-    setrlimit(RLIMIT_STACK, &limit);
-  }
-#endif
-  __pthread_max_stacksize = max_stack;
-}
-
 int __pthread_initialize_manager(void)
 {
   int manager_pipe[2];
diff --git a/malloc/obstack.c b/malloc/obstack.c
index 30e908d981..dcc5cce386 100644
--- a/malloc/obstack.c
+++ b/malloc/obstack.c
@@ -470,6 +470,13 @@ _obstack_memory_used (h)
 # define fputs(s, f) _IO_fputs (s, f)
 #endif
 
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+#  define __attribute__(Spec) /* empty */
+# endif
+#endif
+
 static void
 __attribute__ ((noreturn))
 print_and_abort ()
diff --git a/sysdeps/s390/s390-32/bits/setjmp.h b/sysdeps/s390/s390-32/bits/setjmp.h
index 07ca86574a..fa6e03b4be 100644
--- a/sysdeps/s390/s390-32/bits/setjmp.h
+++ b/sysdeps/s390/s390-32/bits/setjmp.h
@@ -36,10 +36,10 @@
 
 typedef struct {
     /* We save registers 6-15.  */
-    long int gregs[10];
+    long int __gregs[10];
 
     /* We save fpu registers 4 and 6.  */
-    long fpregs[4];
+    long __fpregs[4];
 } __jmp_buf[1];
 
 #endif
@@ -47,6 +47,6 @@ typedef struct {
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
 #define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((int) (address) < (jmpbuf)->gregs[__JB_GPR15])
+  ((int) (address) < (jmpbuf)->__gregs[__JB_GPR15])
 
 #endif /* __S390_SETJMP_H__ */
diff --git a/sysdeps/s390/s390-64/bits/setjmp.h b/sysdeps/s390/s390-64/bits/setjmp.h
index 5e77572da3..4cb4d791e8 100644
--- a/sysdeps/s390/s390-64/bits/setjmp.h
+++ b/sysdeps/s390/s390-64/bits/setjmp.h
@@ -36,10 +36,10 @@
 
 typedef struct {
     /* We save registers 6-15.  */
-    long int gregs[10];
+    long int __gregs[10];
 
     /* We save fpu registers 4 and 6.  */
-    long fpregs[8];
+    long __fpregs[8];
 } __jmp_buf[1];
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S b/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S
index 35338aabd0..c0652cae83 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S
@@ -51,7 +51,7 @@ ENTRY(__mmap64)
 	svc	SYS_ify(mmap2)		/* Do the system call trap.  */
 
 #ifndef __ASSUME_MMAP2_SYSCALL
-	chi	%r0,-ENOSYS
+	chi	%r2,-ENOSYS
 	je	1f
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h b/sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h
index fbbfd30b9a..43738b2654 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h
@@ -43,6 +43,9 @@ struct sigaction
     /* Special flags.  */
     unsigned long int sa_flags;
 
+    /* Restore handler.  */
+    void (*sa_restorer) (void);
+
     /* Additional set of signals to be blocked.	 */
     __sigset_t sa_mask;
   };