From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E6E971F4B4 for ; Fri, 16 Apr 2021 09:23:35 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B7EF63969015; Fri, 16 Apr 2021 09:23:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7EF63969015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618565013; bh=JkvdnfEcEOgNAmkpTrOb4q04odlJ4rolTqrVtNXmvEU=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XESVtF8/E9z6cfKXsJ48P4p+trN/sCSFaw6iOe0xO4GOg0BsO5kf6CLcMzxdUuyjD DBpzQ/1oev+1+xOGmA71NWDK7xBuTabVX9wnZKLrp3h4BLND265XaritnuYRcxBhw1 /onPhLB/ok4wfE15cfb+YV0YdOEZidIblmKd4eJ4= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 0CAEE3969015 for ; Fri, 16 Apr 2021 09:23:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CAEE3969015 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-lhMZXMFVP3S4Wec7-OHxDA-1; Fri, 16 Apr 2021 05:23:29 -0400 X-MC-Unique: lhMZXMFVP3S4Wec7-OHxDA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31BF36D246 for ; Fri, 16 Apr 2021 09:23:29 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B36A437F for ; Fri, 16 Apr 2021 09:23:28 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v4 29/37] nptl: Move the internal thread priority protection symbols into libc In-Reply-To: References: Message-Id: <54a191e2d23a371c5f7c1ca55761f9adff6c909f.1618564630.git.fweimer@redhat.com> Date: Fri, 16 Apr 2021 11:23:46 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This is a prerequisite for moving the mutex implementation. Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 2 +- nptl/Versions | 5 +++++ nptl/pthreadP.h | 16 ++++++++++------ nptl/tpp.c | 6 +++++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/nptl/Makefile b/nptl/Makefile index feb79e0e7b..d595598cb8 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -94,6 +94,7 @@ routines = \ pthread_setschedparam \ pthread_setspecific \ pthread_sigmask \ + tpp \ unwind \ shared-only-routines = forward @@ -214,7 +215,6 @@ libpthread-routines = \ sem_timedwait \ sem_unlink \ sem_wait \ - tpp \ vars \ version \ diff --git a/nptl/Versions b/nptl/Versions index b14f76aa41..f51110da8d 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -120,6 +120,7 @@ libc { GLIBC_PRIVATE { __futex_abstimed_wait64; __futex_abstimed_wait_cancelable64; + __init_sched_fifo_prio; __libc_alloca_cutoff; __libc_cleanup_pop_restore; __libc_cleanup_push_defer; @@ -143,13 +144,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 2c59a1dc84..5cd5d69c53 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 #include - 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) -- 2.30.2