public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/syscall-refactor] mips: Move Linux syscalls.list to syscalls.def
@ 2020-06-29 21:49 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2020-06-29 21:49 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5eb38d33872fab8a5d91ad71597aa6bcc5c47c96

commit 5eb38d33872fab8a5d91ad71597aa6bcc5c47c96
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 18 11:09:31 2020 -0300

    mips: Move Linux syscalls.list to syscalls.def

Diff:
---
 .../unix/sysv/linux/mips/mips64/n64/syscalls.def   |  6 +++
 .../unix/sysv/linux/mips/mips64/n64/syscalls.list  |  6 ---
 sysdeps/unix/sysv/linux/mips/syscalls.def          |  4 ++
 sysdeps/unix/sysv/linux/mips/syscalls.list         |  9 -----
 sysdeps/unix/sysv/linux/mips/sysmips.c             | 47 ++++++++++++++++++++++
 5 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.def b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.def
new file mode 100644
index 0000000000..c161de5135
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.def
@@ -0,0 +1,6 @@
+# Symbol name     Syscall name      Arguments                                               Strong                    Aliases                                Includes            Flags
+
+fstatfs           fstatfs           [int, struct statfs *]                                  fstatfs                   __fstatfs,fstatfs64,__fstatfs64        sys/vfs.h
+statfs            statfs            [const char *, struct statfs *]                         statfs                    $__statfs,statfs64,__statfs64          sys/vfs.h
+
+sendfile          sendfile          [int, int, off_t *, size_t]:ssize_t                     sendfile                  sendfile64                             sys/sendfile.h
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
deleted file mode 100644
index 50ab64d3c2..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+++ /dev/null
@@ -1,6 +0,0 @@
-# File name	Caller	Syscall name	# args	Strong name	Weak names
-
-fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
-statfs		-	statfs		i:sp	__statfs	statfs statfs64 __statfs64
-
-sendfile	-	sendfile	i:iipi	sendfile	sendfile64
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.def b/sysdeps/unix/sysv/linux/mips/syscalls.def
new file mode 100644
index 0000000000..9472e6ecd0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.def
@@ -0,0 +1,4 @@
+# Symbol name     Syscall name      Arguments                                               Strong                    Aliases                                Includes            Flags
+
+cachectl          cachectl          [void *, const int, const int]                          cachectl                  __cachectl                             sys/cachectl.h
+cacheflush        cacheflush        [void *, const int, const int]                          cacheflush                _flush_cache                           sys/cachectl.h
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
deleted file mode 100644
index 4b72434b57..0000000000
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ /dev/null
@@ -1,9 +0,0 @@
-# File name	Caller	Syscall name	Args	Strong name	Weak names
-
-#
-# Calls for compatibility with existing MIPS OS implementations and
-# compilers.
-#
-cachectl	-	cachectl	i:pii	__cachectl	cachectl
-cacheflush	-	cacheflush	i:pii	_flush_cache	cacheflush
-sysmips		-	sysmips		i:iiii	__sysmips	sysmips
diff --git a/sysdeps/unix/sysv/linux/mips/sysmips.c b/sysdeps/unix/sysv/linux/mips/sysmips.c
new file mode 100644
index 0000000000..aa10bb790f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sysmips.c
@@ -0,0 +1,47 @@
+/* sysmips system call for Linux/MIPS.
+   Copyright (C) 2020 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/>.  */
+
+#include <sys/sysmips.h>
+#include <sysdep.h>
+#include <stdarg.h>
+
+int
+sysmips (const int cmd, ...)
+{
+  va_list va;
+  long int arg1 = 0;
+  long int arg2 = 0;
+
+  switch (cmd)
+    {
+    case MIPS_ATOMIC_SET:
+      va_start (va, cmd);
+      arg1 = va_arg (va, long int);
+      arg2 = va_arg (va, long int);
+      va_end (va);
+      break;
+    case MIPS_FIXADE:
+      va_start (va, cmd);
+      arg1 = va_arg (va, long int);
+      va_end (va);
+      break;
+    default:
+      break;
+    }
+  return inline_syscall (__NR_sysmips, cmd, arg1, arg2);
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-29 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 21:49 [glibc/azanella/syscall-refactor] mips: Move Linux syscalls.list to syscalls.def Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).