From patchwork Mon Jul 8 01:10:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 1957782 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=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=V8Fr7rq7; 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 4WHQzc3DmDz1xpd for ; Mon, 8 Jul 2024 11:10:52 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71FC53858D20 for ; Mon, 8 Jul 2024 01:10:50 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by sourceware.org (Postfix) with ESMTPS id 8513C385B505 for ; Mon, 8 Jul 2024 01:10:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8513C385B505 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8513C385B505 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=139.178.84.217 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720401033; cv=none; b=l0KBzXVVRRe4+scxMXd7dRcxek6DqcfJLyBzg9jG0x2Js22gPKhJbTk9Kzdo+gSO01Lw1BXEHeIkZm2CQYUD1EudqmsETbqkEF3+4W3BL106U4OODEMsqcFjb8dj9lyFiz06+ZDjVjdD7yWpCBKzLKByg5k7MWmEdq+ZVA4usLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720401033; c=relaxed/simple; bh=yVcIRsdTQoqOQqMflHSWTdjt59qVq2V2sIdDSeiGZmI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=BHwkNStNIYnin7wq1qzlvBYOsER0RxElFqcRg8g8Co9/nMiG1WBqpu8S6Ox8GMu7S8WkXzousX1nmiUX1vGznGTtLzU59lWJl2j6v94QkEv9Nj5jgkZt4rg9itTcUOuplQ3KkR0cND8DoD6ehu67GOUsMDgk6Xx6vTE9vRlGY4Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1586A602E0; Mon, 8 Jul 2024 01:10:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B2F2C3277B; Mon, 8 Jul 2024 01:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720401029; bh=yVcIRsdTQoqOQqMflHSWTdjt59qVq2V2sIdDSeiGZmI=; h=Date:From:To:Cc:Subject:From; b=V8Fr7rq7rnRde7KVLn64CkMcCkBa8RetMeL73jLWkYeKhD6CzLgp8C+JW2Myr3dVj FY0737eb9JQmIdD6sZLg1n8kR/5lgyzJqtgdXNh+zWwa7NTmZuiJ7md1Fkna3RFY3V coyL74qFDMDzxSpzG0GUMk87vLCBVeEWCglwz6l5c9D/Lj8o3V3WuI/Ca4mFriQbZw 30tdZbH6V/7Pc4YOHfRE3X8CngXQzO/Wb2HwnrIaKn/rm9noUAywKfAakK0d8fYh3h yARENDIGXF26vd+Ac31n1B1mnh3/6afaRtnLh8l74bNMT3vA5pV+5DVPuEF9/RwFZQ XbnBdoo2zUM0g== Date: Mon, 8 Jul 2024 03:10:25 +0200 From: Helge Deller To: libc-alpha@sourceware.org, John David Anglin Cc: linux-parisc@vger.kernel.org Subject: [PATCH] hppa: Wire up cacheflush syscall Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 The hppa Linux kernel supports the cacheflush() syscall since version 6.5. This adds the glibc syscall wrapper. Signed-off-by: Helge Deller diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile index 2e031e2f8a..9eebe8e0e7 100644 --- a/sysdeps/unix/sysv/linux/hppa/Makefile +++ b/sysdeps/unix/sysv/linux/hppa/Makefile @@ -15,6 +15,11 @@ test-xfail-check-wx-segment = * endif # $(subdir) == elf +ifeq ($(subdir),misc) +sysdep_routines += cacheflush +sysdep_headers += sys/cachectl.h +endif + ifeq ($(subdir),debug) test-xfail-tst-ssp-1 = $(have-ssp) endif # $(subdir) == debug diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions index 78528e5fa2..f7ac20ab7e 100644 --- a/sysdeps/unix/sysv/linux/hppa/Versions +++ b/sysdeps/unix/sysv/linux/hppa/Versions @@ -23,4 +23,7 @@ libc { GLIBC_2.19 { fanotify_mark; } + GLIBC_2.40 { + cacheflush; + } } diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index fbcd60c2b3..965b946ab0 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2821,6 +2821,7 @@ GLIBC_2.4 sys_errlist D 0x400 GLIBC_2.4 sys_nerr D 0x4 GLIBC_2.4 unlinkat F GLIBC_2.4 unshare F +GLIBC_2.40 cacheflush F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/unix/sysv/linux/hppa/sys/cachectl.h b/sysdeps/unix/sysv/linux/hppa/sys/cachectl.h new file mode 100644 index 0000000000..16e47d1329 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/sys/cachectl.h @@ -0,0 +1,36 @@ +/* HPPA cache flushing interface. + Copyright (C) 2018-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_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#include + +/* Get the kernel definition for the op bits. */ +#include + +__BEGIN_DECLS + +#ifdef __USE_MISC +extern int cacheflush (void *__addr, const int __nbytes, + const int __op) __THROW; +#endif + +__END_DECLS + +#endif /* sys/cachectl.h */ diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 12e4adeccc..b3020114d6 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -8,5 +8,6 @@ listen - listen i:ii __listen listen shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair +cacheflush - cacheflush i:pii _flush_cache cacheflush personality EXTRA personality Ei:i __personality personality