From: Helge Deller <deller@kernel.org>
To: libc-alpha@sourceware.org, John David Anglin <dave.anglin@bell.net>
Cc: linux-parisc@vger.kernel.org
Subject: [PATCH] hppa: Wire up cacheflush syscall
Date: Mon, 8 Jul 2024 03:10:25 +0200 [thread overview]
Message-ID: <Zos8gVaGUcuaaNaI@carbonx1> (raw)
The hppa Linux kernel supports the cacheflush() syscall
since version 6.5. This adds the glibc syscall wrapper.
Signed-off-by: Helge Deller <deller@gmx.de>
---
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
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+/* Get the kernel definition for the op bits. */
+#include <asm/cachectl.h>
+
+__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
next reply other threads:[~2024-07-08 1:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 1:10 Helge Deller [this message]
2024-07-08 8:13 ` [PATCH] hppa: Wire up cacheflush syscall Florian Weimer
2024-07-08 8:58 ` Helge Deller
2024-07-08 16:00 ` Andreas K. Huettel
2024-07-08 18:26 ` Helge Deller
2024-07-09 13:41 ` Sam James
2024-08-03 8:57 ` John David Anglin
2024-09-26 19:08 ` Sam James
2024-09-27 7:16 ` Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zos8gVaGUcuaaNaI@carbonx1 \
--to=deller@kernel.org \
--cc=dave.anglin@bell.net \
--cc=libc-alpha@sourceware.org \
--cc=linux-parisc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox