From patchwork Fri Nov 1 19:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 2005280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.a=rsa-sha256 header.s=smtpout1 header.b=L04Wbg0m; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xg9lg3xk4z1xy1 for ; Sat, 2 Nov 2024 06:24:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59A093857830 for ; Fri, 1 Nov 2024 19:24:13 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by sourceware.org (Postfix) with ESMTPS id 016843858D33 for ; Fri, 1 Nov 2024 19:23:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 016843858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 016843858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=167.114.26.122 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730489031; cv=none; b=uXqdNp1Ktg31jBvOCWtrfE4d4vGp9puO7IZusGwY1c5hqrW3zHgi45M+bxgVlo2QkN+AjXEdcCe2GZ/4g0BPBck4HS8IvKw6hoM5znmhOc/qFwv7CW95/TzopkrMTgW6YApGL3yKP29pFxW0W1Kq2x98HmtD8wvFKRCkmMjwKxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730489031; c=relaxed/simple; bh=vHdtDaIZl2nE7nZ+roNMeDrQ/B28YLNylitSaLew27g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wUXjFenWPcQ1mrOqVNRqNENCF4Xt26+YahFGQFGeYgIjgp0MvOJk0WFBpvSCOu4Nl2pyWAPsEwMFyZ9gr5bRLy/zIUftBdOVXXSHB5yXZz1m/6/wL5bySmeRrt4ZNzN4Wqb2nfsoIz1Y3+YhCRhEH5cRmMH+cyFntS1p1nwAnLQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1730489028; bh=vHdtDaIZl2nE7nZ+roNMeDrQ/B28YLNylitSaLew27g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L04Wbg0mMlyGTcrKPqERd1VBKDjARTEK8s3lKpgLAKy3VUEXEQR5tbIzyuSSLf6uC IusmrSUk6AL12zrRJ3wVxHeUrHvVLzIWBDJYRa4/kItUs8x1t+hDgZch8K+/OQYULX 36EOmam+IsOGcbeipCAJxo1ULJeDOnX445CRObxTdWT+sR4tSn2FKm/shnKjHL0s3G HEtPBno9vftUIYa1XOE57FMmWz0ant9qn5CRoYzGhNlL3jH9w+3mBbm7w0MWynHhId VwV0ha/ucMhv7j9DQ2br48c2G0VCStatlMAOHYrG+hPVbk3XGvfMEZXQRJg72vEEiw 3sFmZIl0YUwhg== Received: from laptop-mjeanson.internal.efficios.com (96-127-217-162.qc.cable.ebox.net [96.127.217.162]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Xg9l83vtBzqN7; Fri, 1 Nov 2024 15:23:48 -0400 (EDT) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson , Florian Weimer , Mao Han , Cooper Qu , John David Anglin , Carlos O'Donell Subject: [PATCH] nptl: Add for hppa Date: Fri, 1 Nov 2024 15:23:21 -0400 Message-ID: <20241101192339.123141-2-mjeanson@efficios.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241101192339.123141-1-mjeanson@efficios.com> References: <20241101192339.123141-1-mjeanson@efficios.com> MIME-Version: 1.0 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Compile tested with build-many-glibcs.py but I don't have access to any hardware to run the tests. Signed-off-by: Michael Jeanson --- Cc: Florian Weimer Cc: John David Anglin Cc: Carlos O'Donell --- sysdeps/hppa/nptl/thread_pointer.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sysdeps/hppa/nptl/thread_pointer.h diff --git a/sysdeps/hppa/nptl/thread_pointer.h b/sysdeps/hppa/nptl/thread_pointer.h new file mode 100644 index 0000000000..96f5e9b4c0 --- /dev/null +++ b/sysdeps/hppa/nptl/thread_pointer.h @@ -0,0 +1,30 @@ +/* __thread_pointer definition. hppa version. + Copyright (C) 2021-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _SYS_THREAD_POINTER_H +#define _SYS_THREAD_POINTER_H + +static inline void * +__thread_pointer (void) +{ + void *__thread_register; + __asm__ ("mfctl %%cr27, %0" : "=r" (__thread_register)); + return __thread_register; +} + +#endif /* _SYS_THREAD_POINTER_H */