summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h')
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 466dcdef80..8e3117d7a7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 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
@@ -295,6 +295,23 @@
#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; \
+ })
+
+/* List of system calls which are supported as vsyscalls. */
+#define HAVE_CLOCK_GETTIME_VSYSCALL 1
+#define HAVE_GETTIMEOFDAY_VSYSCALL 1
+
#endif /* __ASSEMBLER__ */
/* Pointer mangling is not yet supported for MIPS. */