From patchwork Fri Nov 1 19:23:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 2005282 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=o/xp/e39; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4Xg9lv1BRFz1xxJ for ; Sat, 2 Nov 2024 06:24:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5DAB63858283 for ; Fri, 1 Nov 2024 19:24:25 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtpout.efficios.com (smtpout.efficios.com [IPv6:2607:5300:203:b2ee::31e5]) by sourceware.org (Postfix) with ESMTPS id F31373858420 for ; Fri, 1 Nov 2024 19:23:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F31373858420 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 F31373858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:5300:203:b2ee::31e5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730489034; cv=none; b=uQsBAUDjzD2IqbVUY1oMj57qZYgZ4qe2BiBD5NI2VvyDUct5vlwBKpEXoJhX+0YOtW3mAPK4zH7aagDHxpYXeb6MYAyVbyiLlZxosLmnaTNrFCuIdQ/e3VyHsjTRLdfvX2JdyhYhUSyXkQnEp57GLN39ribMUfgDMlZ1MCkwFjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730489034; c=relaxed/simple; bh=XwuF7C5NswaJblgI09I8ffzcu9Kq+Vxjc5ch3HxH00E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rhzbPIeCaSo7wIMe1AyEQvECzbAMWZey5WqXdSArs5G4ztXoEGUlDRUHnZXRqTSwX2cC67CfJi+3snKp3ql8HGyjyJmKQxGIgQdSglQo5LYTd6lGKn/F3YSbM0Jx2AhhN5lZtqP/SojoCcG/RTI8iIVxFuZiUOlqeYQ/YEQoixg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1730489031; bh=XwuF7C5NswaJblgI09I8ffzcu9Kq+Vxjc5ch3HxH00E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/xp/e39iVJuIeru8m06tsfBjQpgebT8jAo1XhELNEeOH55LN+VOt1bWpyLZ6zu9G 72Bgn8iM7N1lPPIQ3rZD81DT8pH2e0CId6U6QVecwlVBOgH8IFuzBBGWPtN9yQCn2u Ez0QZdfwgiqiX7was2o2lnxeoigP3UZWuLDXmEIuZINPv2nXn7gnGJgVY3Ga04mdoE Mmo1DjXqJJvmfjaReGBHlIovksKiALRyC6p7A9IodI83B0PWXjvhNCX41V3AY+FH9g 8OMJDV7xSmV1Rg1bvLKRfbYWGsM3oB0D6vB8LrFZEZ3xShZkSbtcHv6PKedkAPVGDV +ZMjQd06ad0/g== 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 4Xg9lC3stMzqh2; Fri, 1 Nov 2024 15:23:51 -0400 (EDT) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson , Florian Weimer , Mao Han , Cooper Qu , Stafford Horne Subject: [PATCH] nptl: Add for or1k Date: Fri, 1 Nov 2024 15:23:24 -0400 Message-ID: <20241101192339.123141-5-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: Stafford Horne --- sysdeps/or1k/nptl/thread_pointer.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sysdeps/or1k/nptl/thread_pointer.h diff --git a/sysdeps/or1k/nptl/thread_pointer.h b/sysdeps/or1k/nptl/thread_pointer.h new file mode 100644 index 0000000000..1012794c48 --- /dev/null +++ b/sysdeps/or1k/nptl/thread_pointer.h @@ -0,0 +1,30 @@ +/* __thread_pointer definition. or1k 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__ ("l.or %0, r10, r0" : "=r" (__thread_register)); + return __thread_register; +} + +#endif /* _SYS_THREAD_POINTER_H */