about summary refs log tree commit diff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-07 09:55:05 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-07 09:55:05 +0000
commitbc6389ad568e161987060470c0f512b8a5853824 (patch)
treead341bc60841d26c42dfe7ea4af5e1731ba2fcd2 /nptl/allocatestack.c
parent923e02eae45c3e4c9b6bdd2b8e5613718e8cb54b (diff)
downloadglibc-bc6389ad568e161987060470c0f512b8a5853824.tar.gz
glibc-bc6389ad568e161987060470c0f512b8a5853824.tar.xz
glibc-bc6389ad568e161987060470c0f512b8a5853824.zip
Update.
2003-03-07  Ulrich Drepper  <drepper@redhat.com>

	* init.c (__static_tls_align_m1): Renamed from __static_tls_align.
	(__pthread_initialize_minimal_internal): Change initialization of
	__static_tls_align_m1 appropriately.
	* pthreadP.h (__static_tls_align_m1): Renamed from
	__static_tls_align.
	* allocatestack.c (allocate_stack): Use __static_tls_align_m1
	instead of __static_tls_align-1.
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index b0d7ea641a..4aec875548 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -248,7 +248,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	return EINVAL;
 
       /* Adjust stack size for alignment of the TLS block.  */
-      adj = ((uintptr_t) attr->stackaddr) & (__static_tls_align - 1);
+      adj = ((uintptr_t) attr->stackaddr) & __static_tls_align_m1;
       assert (size > adj);
 
       /* The user provided some memory.  Let's hope it matches the
@@ -308,7 +308,6 @@ 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
@@ -318,7 +317,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 #endif
 
       /* Adjust the stack size for alignment.  */
-      size &= ~(__static_tls_align - 1);
+      size &= ~__static_tls_align_m1;
       assert (size != 0);
 
       /* Make sure the size of the stack is enough for the guard and
@@ -359,9 +358,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 
 	  /* Make sure the coloring offsets does not disturb the alignment
 	     of the TCB and static TLS block.  */
-	  if (__builtin_expect ((coloring & (__static_tls_align - 1)) != 0, 0))
-	    coloring = (((coloring + __static_tls_align - 1)
-			 & ~(__static_tls_align - 1))
+	  if (__builtin_expect ((coloring & __static_tls_align_m1) != 0, 0))
+	    coloring = (((coloring + __static_tls_align_m1)
+			 & ~(__static_tls_align_m1))
 			& ~pagesize_m1);
 #else
 	  /* Unless specified we do not make any adjustments.  */