From patchwork Sun Feb 9 17:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 37795 Received: (qmail 71226 invoked by alias); 9 Feb 2020 17:32:12 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 71203 invoked by uid 89); 9 Feb 2020 17:32:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1676, HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited 1/2] htl: Fix default guard size Date: Sun, 9 Feb 2020 18:32:01 +0100 Message-Id: <20200209173202.287052-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 When it is not hardcoded by the architecture with PAGESIZE, we need to use the dynamic values from __vm_page_size. --- htl/pt-internal.h | 2 +- sysdeps/htl/pt-attr.c | 2 +- sysdeps/mach/hurd/htl/pt-sysdep.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htl/pt-internal.h b/htl/pt-internal.h index 9147b87740..064e795157 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -304,7 +304,7 @@ extern error_t __pthread_sigstate (struct __pthread *__restrict thread, int how, /* Default thread attributes. */ -extern const struct __pthread_attr __pthread_default_attr; +extern struct __pthread_attr __pthread_default_attr; /* Default barrier attributes. */ extern const struct __pthread_barrierattr __pthread_default_barrierattr; diff --git a/sysdeps/htl/pt-attr.c b/sysdeps/htl/pt-attr.c index 1426fac67e..fb41e4859f 100644 --- a/sysdeps/htl/pt-attr.c +++ b/sysdeps/htl/pt-attr.c @@ -23,7 +23,7 @@ #include -const struct __pthread_attr __pthread_default_attr = { +struct __pthread_attr __pthread_default_attr = { __schedparam: { sched_priority: 0 }, __stacksize: 0, __stackaddr: NULL, diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c index 32a290c4ee..84d191475d 100644 --- a/sysdeps/mach/hurd/htl/pt-sysdep.c +++ b/sysdeps/mach/hurd/htl/pt-sysdep.c @@ -78,6 +78,10 @@ _init_routine (void *stack) valid if the main thread terminates. */ thread->stack = 0; +#ifndef PAGESIZE + __pthread_default_attr.__guardsize = __vm_page_size; +#endif + ___pthread_self = thread; /* Decrease the number of threads, to take into account that the