]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
mips: Consolidate INTERNAL_VSYSCALL_CALL
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 4 Jun 2019 17:29:42 +0000 (17:29 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 17 Sep 2019 20:09:26 +0000 (17:09 -0300)
This patch consolidates the mips, mips64, and mips64-n32
INTERNAL_VSYSCALL_CALL on a single implementation.

No semantic changes. I checked against a build for mips-linux-gnu,
mips64-linux-gnu, and mips64-n32-linux-gnu.

* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
(INTERNAL_VSYSCALL_CALL): Remove.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
(INTERNAL_VSYSCALL_CALL): Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
(INTERNAL_VSYSCALL_CALL): Likewise.
* sysdeps/unix/sysv/linux/mips/sysdep.h (INTERNAL_VSYSCALL_CALL):
New macro.

ChangeLog
sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
sysdeps/unix/sysv/linux/mips/sysdep.h

index 71cfb3f2dc83808e93c4cd397ba2177501713b5a..c9acb336691dccc56b2aa032e254f4513a383a8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2019-09-17  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+       (INTERNAL_VSYSCALL_CALL): Remove.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+       (INTERNAL_VSYSCALL_CALL): Likewise.
+       * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+       (INTERNAL_VSYSCALL_CALL): Likewise.
+       * sysdeps/unix/sysv/linux/mips/sysdep.h (INTERNAL_VSYSCALL_CALL):
+       New macro.
+
        * sysdeps/unix/sysv/linux/libc-vdso.h (VDSO_IFUNC_RET): Define if not
        defined.
        * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c
index 09d9040efdd440f8355cffd516dc660f8f037ad3..86347fe91ac3408e89f08768051aa739f4c2a1eb 100644 (file)
@@ -349,18 +349,6 @@ libc_hidden_proto (__mips_syscall7, nomips16)
 #define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
        "$14", "$15", "$24", "$25", "hi", "lo", "memory"
 
-/* Standard MIPS syscalls have an error flag, and return a positive errno
-   when the error flag is set. Emulate this behaviour for vsyscalls so that
-   the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly.  */
-#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...)              \
-  ({                                                                   \
-    long _ret = funcptr (args);                                                \
-    err = ((unsigned long) (_ret) >= (unsigned long) -4095L);          \
-    if (err)                                                           \
-      _ret = -_ret;                                                    \
-    _ret;                                                              \
-  })
-
 #endif /* __ASSEMBLER__ */
 
 /* Pointer mangling is not yet supported for MIPS.  */
index c276b0086a315c9826249360f4bdb1e035e2bab0..ca7a60e3d7149941f251a98258a5621c9c74168b 100644 (file)
 #define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
        "$14", "$15", "$24", "$25", "hi", "lo", "memory"
 
-/* Standard MIPS syscalls have an error flag, and return a positive errno
-   when the error flag is set. Emulate this behaviour for vsyscalls so that
-   the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly.  */
-#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...)              \
-  ({                                                                   \
-    long _ret = funcptr (args);                                                \
-    err = ((unsigned long) (_ret) >= (unsigned long) -4095L);          \
-    if (err)                                                           \
-      _ret = -_ret;                                                    \
-    _ret;                                                              \
-  })
-
 #endif /* __ASSEMBLER__ */
 
 /* Pointer mangling is not yet supported for MIPS.  */
index 9d574c720a0ae66d3f6efe214ba2c3165f8c1967..821dec920ae14d6912c14a87c0203351c2505704 100644 (file)
 #define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
        "$14", "$15", "$24", "$25", "hi", "lo", "memory"
 
-/* Standard MIPS syscalls have an error flag, and return a positive errno
-   when the error flag is set. Emulate this behaviour for vsyscalls so that
-   the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly.  */
-#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...)              \
-  ({                                                                   \
-    long _ret = funcptr (args);                                                \
-    err = ((unsigned long) (_ret) >= (unsigned long) -4095L);          \
-    if (err)                                                           \
-      _ret = -_ret;                                                    \
-    _ret;                                                              \
-  })
-
 #endif /* __ASSEMBLER__ */
 
 /* Pointer mangling is not yet supported for MIPS.  */
index 5d05c907803f256df66ef5e24550c1c0475a0111..b2045fcc55b9334d57a660232cae99944a82dfa1 100644 (file)
 /* List of system calls which are supported as vsyscalls.  */
 #define HAVE_CLOCK_GETTIME_VSYSCALL     "__vdso_gettimeofday"
 #define HAVE_GETTIMEOFDAY_VSYSCALL      "__vdso_clock_gettime"
+
+#ifndef __ASSEMBLER__
+
+/* Standard MIPS syscalls have an error flag, and return a positive errno
+   when the error flag is set. Emulate this behaviour for vsyscalls so that
+   the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly.  */
+#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...)              \
+  ({                                                                   \
+    long _ret = funcptr (args);                                                \
+    err = ((unsigned long) (_ret) >= (unsigned long) -4095L);          \
+    if (err)                                                           \
+      _ret = -_ret;                                                    \
+    _ret;                                                              \
+  })
+
+#endif /* __ASSEMBLER__  */