about summary refs log tree commit diff
path: root/nptl/descr.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-11 11:08:00 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-11 11:22:33 +0200
commitc79a31fb36fe265f7566bea622849b06c94b4022 (patch)
tree59bd2a7dde0670f24c0170a49038111c99008e65 /nptl/descr.h
parent249bd833a08e2689e28ff9a094730f0b048a8442 (diff)
downloadglibc-c79a31fb36fe265f7566bea622849b06c94b4022.tar.gz
glibc-c79a31fb36fe265f7566bea622849b06c94b4022.tar.xz
glibc-c79a31fb36fe265f7566bea622849b06c94b4022.zip
nptl: Move stack cache management, __libpthread_freeres into libc
This replaces the FREE_P macro with the __nptl_stack_in_use inline
function.  stack_list_del is renamed to __nptl_stack_list_del,
stack_list_add to __nptl_stack_list_add, __deallocate_stack to
__nptl_deallocate_stack, free_stacks to __nptl_free_stacks.

It is convenient to move __libpthread_freeres into libc at the
same time.  This removes the temporary __default_pthread_attr_freeres
export and restores full freeres coverage for __default_pthread_attr.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/descr.h')
-rw-r--r--nptl/descr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/nptl/descr.h b/nptl/descr.h
index d423a53bbf..3de9535449 100644
--- a/nptl/descr.h
+++ b/nptl/descr.h
@@ -416,5 +416,11 @@ struct pthread
   (sizeof (struct pthread) - offsetof (struct pthread, end_padding))
 } __attribute ((aligned (TCB_ALIGNMENT)));
 
+/* This yields the pointer that TLS support code calls the thread pointer.  */
+#if TLS_TCB_AT_TP
+# define TLS_TPADJ(pd) (pd)
+#elif TLS_DTV_AT_TP
+# define TLS_TPADJ(pd) ((struct pthread *)((char *) (pd) + TLS_PRE_TCB_SIZE))
+#endif
 
 #endif	/* descr.h */