aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/mips
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-05-23 16:33:32 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-09-17 17:09:01 -0300
commitb8386c2859e61c5c80ca98e987665a3179bd7e52 (patch)
tree325390efdfff3a436d65f9abfd15ee0ed57a7063 /sysdeps/unix/sysv/linux/mips
parentb881217f1716cc02a6606c44f0e436c3a4e70a9e (diff)
downloadglibc-b8386c2859e61c5c80ca98e987665a3179bd7e52.tar
glibc-b8386c2859e61c5c80ca98e987665a3179bd7e52.tar.gz
glibc-b8386c2859e61c5c80ca98e987665a3179bd7e52.tar.bz2
glibc-b8386c2859e61c5c80ca98e987665a3179bd7e52.zip
Remove PREPARE_VERSION and PREPARE_VERSION_KNOW
This patch removes the PREPARE_VERSION and PREPARE_VERSION_KNOW macro and uses a static inline function instead, get_vdso_symbol. Each architecture that supports vDSO must define the Linux version and its hash for symbol resolution (VDSO_NAME and VDSO_HASH macro respectively). It also organizes the HAVE_*_VSYSCALL for mips, powerpc, and s390 to define them on a common header. The idea is to require less code to configure and enable vDSO support for newer ports. No semantic changes are expected. Checked with a build against all affected architectures. * sysdeps/unix/make-syscalls.sh: Make vDSO call use get_vdso_symbol. * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c (__gettimeofday): Use get_vdso_symbol instead of _dl_vdso_vsym. * sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise. * sysdeps/unix/sysv/linux/riscv/flush-icache.c (__lookup_riscv_flush_icache): Likewise. * sysdeps/unix/sysv/linux/x86/gettimeofday.c (__gettimeofday): Likewise. * sysdeps/unix/sysv/linux/x86/time.c (time): Likewise. * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/init-first.c: Likewise. * sysdeps/unix/sysv/linux/arm/init-first.c: Likewise. * sysdeps/unix/sysv/linux/i386/init-first.c: Likewise. * sysdeps/unix/sysv/linux/mips/init-first.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/init-first.c: Likewise. * sysdeps/unix/sysv/linux/riscv/init-first.c: Likewise. * sysdeps/unix/sysv/linux/sparc/init-first.c: Likewise. * sysdeps/unix/sysv/linux/s390/init-first.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/init-first.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h (VDSO_NAME, VDSO_HASH): Define. * sysdeps/unix/sysv/linux/arm/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/riscv/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/sparc/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Remove definition. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (HAVE_CLOCK_GETRES_VSYSCALL, HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL, HAVE_GETCPU_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (HAVE_CLOCK_GETRES_VSYSCALL, HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL, HAVE_GETCPU_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep.h: New file. * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION, PREPARE_VERSION_KNOWN, VDSO_NAME_LINUX_2_6, VDSO_HASH_LINUX_2_6, VDSO_NAME_LINUX_2_6_15, VDSO_HASH_LINUX_2_6_15, VDSO_NAME_LINUX_2_6_29, VDSO_HASH_LINUX_2_6_29, VDSO_NAME_LINUX_4_15, VDSO_HASH_LINUX_4_15): Remove defines. (get_vdso_symbol): New function.
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips')
-rw-r--r--sysdeps/unix/sysv/linux/mips/init-first.c6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sysdep.h5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h5
-rw-r--r--sysdeps/unix/sysv/linux/mips/sysdep.h24
5 files changed, 29 insertions, 16 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/init-first.c b/sysdeps/unix/sysv/linux/mips/init-first.c
index ea5433a9e4..05cf438eb1 100644
--- a/sysdeps/unix/sysv/linux/mips/init-first.c
+++ b/sysdeps/unix/sysv/linux/mips/init-first.c
@@ -26,13 +26,11 @@ int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
static inline void
_libc_vdso_platform_setup (void)
{
- PREPARE_VERSION_KNOWN (linux26, LINUX_2_6);
-
- void *p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux26);
+ void *p = get_vdso_symbol ("__vdso_gettimeofday");
PTR_MANGLE (p);
VDSO_SYMBOL (gettimeofday) = p;
- p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26);
+ p = get_vdso_symbol ("__vdso_clock_gettime");
PTR_MANGLE (p);
VDSO_SYMBOL (clock_gettime) = p;
}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index f5312e8e2a..09d9040efd 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -19,6 +19,7 @@
#define _LINUX_MIPS_MIPS32_SYSDEP_H 1
/* There is some commonality. */
+#include <sysdeps/unix/sysv/linux/mips/sysdep.h>
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/mips/mips32/sysdep.h>
@@ -360,10 +361,6 @@ libc_hidden_proto (__mips_syscall7, nomips16)
_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. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 0c32cc3851..c276b0086a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -19,6 +19,7 @@
#define _LINUX_MIPS_SYSDEP_H 1
/* There is some commonality. */
+#include <sysdeps/unix/sysv/linux/mips/sysdep.h>
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/mips/mips64/n32/sysdep.h>
@@ -308,10 +309,6 @@
_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. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index c2fe86d1cd..9d574c720a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -19,6 +19,7 @@
#define _LINUX_MIPS_SYSDEP_H 1
/* There is some commonality. */
+#include <sysdeps/unix/sysv/linux/mips/sysdep.h>
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/mips/mips64/n64/sysdep.h>
@@ -304,10 +305,6 @@
_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. */
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h
new file mode 100644
index 0000000000..0f3399f82d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sysdep.h
@@ -0,0 +1,24 @@
+/* Syscall definitions, Linux MIPS generic version.
+ Copyright (C) 2019 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
+ <http://www.gnu.org/licenses/>. */
+
+#define VDSO_NAME "LINUX_2.6"
+#define VDSO_HASH 61765110
+
+/* List of system calls which are supported as vsyscalls. */
+#define HAVE_CLOCK_GETTIME_VSYSCALL 1
+#define HAVE_GETTIMEOFDAY_VSYSCALL 1