public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/fw/libpthread-20210318b] nptl: Move the internal thread priority protection symbols into libc
@ 2021-03-18 22:08 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2021-03-18 22:08 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=68d17f475dc02aa27fdf145d16e1fab284cb719e

commit 68d17f475dc02aa27fdf145d16e1fab284cb719e
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Mar 16 18:05:39 2021 +0100

    nptl: Move the internal thread priority protection symbols into libc
    
    This is a prerequisite for moving the mutex implementation.

Diff:
---
 nptl/Makefile   |  4 ++--
 nptl/Versions   |  5 +++++
 nptl/pthreadP.h | 16 ++++++++++------
 nptl/tpp.c      |  6 +++++-
 4 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/nptl/Makefile b/nptl/Makefile
index 06a1e36773..dcb75ffcf6 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -93,6 +93,7 @@ routines = \
   pthread_setschedparam \
   pthread_setspecific \
   pthread_sigmask \
+  tpp \
   unwind \
 
 shared-only-routines = forward
@@ -118,6 +119,7 @@ libpthread-routines = \
   ftrylockfile \
   funlockfile \
   herrno \
+  libc_sigaction \
   libpthread-compat \
   nptl-init \
   nptlfreeres \
@@ -228,8 +230,6 @@ libpthread-routines = \
   sem_unlink \
   sem_wait \
   sigaction \
-  libc_sigaction \
-  tpp \
   vars \
   version \
 
diff --git a/nptl/Versions b/nptl/Versions
index f9438bb282..8eae7c04ad 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -121,6 +121,7 @@ libc {
   GLIBC_PRIVATE {
     __futex_abstimed_wait64;
     __futex_abstimed_wait_cancelable64;
+    __init_sched_fifo_prio;
     __libc_alloca_cutoff;
     __libc_allocate_rtsig_private;
     __libc_cleanup_pop_restore;
@@ -147,13 +148,17 @@ libc {
     __pthread_cleanup_upto;
     __pthread_cond_destroy; # Used by the C11 threads.
     __pthread_cond_init; # Used by the C11 threads.
+    __pthread_current_priority;
     __pthread_exit;
     __pthread_force_elision;
     __pthread_getattr_default_np;
     __pthread_key_delete;
     __pthread_keys;
     __pthread_setcancelstate;
+    __pthread_tpp_change_priority;
     __pthread_unwind;
+    __sched_fifo_max_prio;
+    __sched_fifo_min_prio;
   }
 }
 
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 527e4acd4f..7fd290e004 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -231,12 +231,16 @@ rtld_hidden_proto (__nptl_set_robust_list_avail)
 #endif
 
 /* Thread Priority Protection.  */
-extern int __sched_fifo_min_prio attribute_hidden;
-extern int __sched_fifo_max_prio attribute_hidden;
-extern void __init_sched_fifo_prio (void) attribute_hidden;
-extern int __pthread_tpp_change_priority (int prev_prio, int new_prio)
-     attribute_hidden;
-extern int __pthread_current_priority (void) attribute_hidden;
+extern int __sched_fifo_min_prio;
+libc_hidden_proto (__sched_fifo_min_prio)
+extern int __sched_fifo_max_prio;
+libc_hidden_proto (__sched_fifo_max_prio)
+extern void __init_sched_fifo_prio (void);
+libc_hidden_proto (__init_sched_fifo_prio)
+extern int __pthread_tpp_change_priority (int prev_prio, int new_prio);
+libc_hidden_proto (__pthread_tpp_change_priority)
+extern int __pthread_current_priority (void);
+libc_hidden_proto (__pthread_current_priority)
 
 /* The library can run in debugging mode where it performs a lot more
    tests.  */
diff --git a/nptl/tpp.c b/nptl/tpp.c
index 8b7d9a2d23..7f58a75731 100644
--- a/nptl/tpp.c
+++ b/nptl/tpp.c
@@ -25,9 +25,10 @@
 #include <stdlib.h>
 #include <atomic.h>
 
-
 int __sched_fifo_min_prio = -1;
+libc_hidden_data_def (__sched_fifo_min_prio)
 int __sched_fifo_max_prio = -1;
+libc_hidden_data_def (__sched_fifo_max_prio)
 
 /* We only want to initialize __sched_fifo_min_prio and __sched_fifo_max_prio
    once.  The standard solution would be similar to pthread_once, but then
@@ -47,6 +48,7 @@ __init_sched_fifo_prio (void)
   atomic_store_relaxed (&__sched_fifo_min_prio,
 			__sched_get_priority_min (SCHED_FIFO));
 }
+libc_hidden_def (__init_sched_fifo_prio)
 
 int
 __pthread_tpp_change_priority (int previous_prio, int new_prio)
@@ -155,6 +157,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio)
 
   return result;
 }
+libc_hidden_def (__pthread_tpp_change_priority)
 
 int
 __pthread_current_priority (void)
@@ -193,3 +196,4 @@ __pthread_current_priority (void)
 
   return result;
 }
+libc_hidden_def (__pthread_current_priority)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-18 22:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 22:08 [glibc/fw/libpthread-20210318b] nptl: Move the internal thread priority protection symbols into libc Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).