]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hppa: add cacheflush() syscall wrapper
authorJohn David Anglin <danglin@gcc.gnu.org>
Sun, 22 Dec 2024 14:51:54 +0000 (09:51 -0500)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 22 Dec 2024 14:51:54 +0000 (09:51 -0500)
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>
---
v2: This patch was too late in release cycle for GLIBC_2.40,
    so update now to GLIBC_2.41 instead.

sysdeps/unix/sysv/linux/hppa/Makefile
sysdeps/unix/sysv/linux/hppa/Versions
sysdeps/unix/sysv/linux/hppa/libc.abilist
sysdeps/unix/sysv/linux/hppa/sys/cachectl.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/hppa/syscalls.list

index 2e031e2f8a951cf6ca55b496ee85381439cb38bd..9eebe8e0e78196b195cace724e6a3b2f33516eae 100644 (file)
@@ -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
index 78528e5fa20e6591866d2b00148de62782c984e5..1f83840d2f6812b8ce0a0cdd5875e2f079c818a4 100644 (file)
@@ -23,4 +23,7 @@ libc {
   GLIBC_2.19 {
     fanotify_mark;
   }
+  GLIBC_2.41 {
+    cacheflush;
+  }
 }
index 8de7644a59b928b6150a4c11e153300ca71997d8..991475380ca51a11821247f0bacde69cf5acd4bb 100644 (file)
@@ -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.41 cacheflush F
 GLIBC_2.41 sched_getattr F
 GLIBC_2.41 sched_setattr F
 GLIBC_2.5 __readlinkat_chk 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 (file)
index 0000000..16e47d1
--- /dev/null
@@ -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 */
index 12e4adeccc78144df5e3a207f120e837d0f20a65..b3020114d6fd2446ed8986bf1a957cb9e0693ef7 100644 (file)
@@ -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