about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-04 20:55:08 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-04 20:55:08 +0000
commit518b53086ca3c10b3587e1162602c8f2aacccbde (patch)
tree3273fb920f07195dd01a64ea92627530da2ee806 /nptl
parente2b80a5802e58d8922faf4b56d275897cf0f6f18 (diff)
downloadglibc-518b53086ca3c10b3587e1162602c8f2aacccbde.tar.gz
glibc-518b53086ca3c10b3587e1162602c8f2aacccbde.tar.xz
glibc-518b53086ca3c10b3587e1162602c8f2aacccbde.zip
Update.
	* pthread_create.c: Define __pthread_keys using nocommon
	attribute, not by placing it explicitly in bss.
	Remove DEFINE_DEALLOC definition.  Not needed anymore.

	* allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
	Use it in mmap call to allocate stacks.

	* sysdeps/pthread/createthread.c (create_thread): Fix comment.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog9
-rw-r--r--nptl/allocatestack.c8
-rw-r--r--nptl/pthread_create.c3
3 files changed, 17 insertions, 3 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 92183629aa..8756489cad 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,14 @@
 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
 
+	* pthread_create.c: Define __pthread_keys using nocommon
+	attribute, not by placing it explicitly in bss.
+	Remove DEFINE_DEALLOC definition.  Not needed anymore.
+
+	* allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
+	Use it in mmap call to allocate stacks.
+
+	* sysdeps/pthread/createthread.c (create_thread): Fix comment.
+
 	* pthread_create.c (start_thread): Use THREAD_SETMEM to store
 	result of the thread function.
 
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 94d05b2721..b0d7ea641a 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -52,6 +52,11 @@
 #endif
 
 
+/* Let the architecture add some flags to the mmap() call used to
+   allocate stacks.  */
+#ifndef ARCH_MAP_FLAGS
+# define ARCH_MAP_FLAGS 0
+#endif
 
 
 /* Cache handling for not-yet free stacks.  */
@@ -303,6 +308,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       size_t reqsize;
       void *mem;
 
+#undef COLORING_INCREMENT
 #if COLORING_INCREMENT != 0
       /* Add one more page for stack coloring.  Don't to it for stacks
 	 with 16 times pagesize or larger.  This might just cause
@@ -330,7 +336,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       if (pd == NULL)
 	{
 	  mem = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-		      MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+		      MAP_PRIVATE | MAP_ANONYMOUS | ARCH_MAP_FLAGS, -1, 0);
 
 	  if (__builtin_expect (mem == MAP_FAILED, 0))
 	    return errno;
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 1d342786f4..2ec70ea32e 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -50,7 +50,6 @@ unsigned int __nptl_nthreads = 1;
 
 
 /* Code to allocate and deallocate a stack.  */
-#define DEFINE_DEALLOC
 #include "allocatestack.c"
 
 /* Code to create the thread.  */
@@ -59,7 +58,7 @@ unsigned int __nptl_nthreads = 1;
 
 /* Table of the key information.  */
 struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]
-  __attribute__ ((section (".bss")));
+  __attribute__ ((nocommon));
 hidden_def (__pthread_keys)
 
 /* This is for libthread_db only.  */