about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/gettimeofday.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/init-first.c51
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/libc-vdso.h12
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sysdep.h16
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/time.c2
5 files changed, 30 insertions, 54 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index 40549fe6dd..13a1fd292a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -28,6 +28,7 @@
 # include <dl-vdso.h>
 # include <libc-vdso.h>
 # include <dl-machine.h>
+# include <sysdep.h>
 
 # ifndef __powerpc64__
 #  undef __gettimeofday
@@ -58,7 +59,7 @@ __gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
 }
 
 # define INIT_ARCH() \
-  void *vdso_gettimeofday = get_vdso_symbol ("__kernel_gettimeofday")
+  void *vdso_gettimeofday = get_vdso_symbol (HAVE_GETTIMEOFDAY_VSYSCALL)
 
 /* If the vDSO is not available we fall back syscall.  */
 libc_ifunc_hidden (__redirect___gettimeofday, __gettimeofday,
diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
index b1618ed0b1..92a4af83af 100644
--- a/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -19,47 +19,18 @@
 #include <dl-vdso.h>
 #include <libc-vdso.h>
 
-int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
-  attribute_hidden;
-int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
-int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
-unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void);
-int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *);
-time_t (*VDSO_SYMBOL(time)) (time_t *);
-
+unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void) attribute_hidden;
 #if defined(__PPC64__) || defined(__powerpc64__)
-void *VDSO_SYMBOL(sigtramp_rt64);
+void *VDSO_SYMBOL(sigtramp_rt64) attribute_hidden;
 #else
-void *VDSO_SYMBOL(sigtramp32);
-void *VDSO_SYMBOL(sigtramp_rt32);
+void *VDSO_SYMBOL(sigtramp32) attribute_hidden;
+void *VDSO_SYMBOL(sigtramp_rt32) attribute_hidden;
 #endif
 
 static inline void
-_libc_vdso_platform_setup (void)
+__libc_vdso_platform_setup_arch (void)
 {
-  void *p = get_vdso_symbol ("__kernel_gettimeofday");
-  PTR_MANGLE (p);
-  VDSO_SYMBOL (gettimeofday) = p;
-
-  p = get_vdso_symbol ("__kernel_clock_gettime");
-  PTR_MANGLE (p);
-  VDSO_SYMBOL (clock_gettime) = p;
-
-  p = get_vdso_symbol ("__kernel_clock_getres");
-  PTR_MANGLE (p);
-  VDSO_SYMBOL (clock_getres) = p;
-
-  p = get_vdso_symbol ("__kernel_get_tbfreq");
-  PTR_MANGLE (p);
-  VDSO_SYMBOL (get_tbfreq) = p;
-
-  p = get_vdso_symbol ("__kernel_getcpu");
-  PTR_MANGLE (p);
-  VDSO_SYMBOL (getcpu) = p;
-
-  p = get_vdso_symbol ("__kernel_time");
-  PTR_MANGLE (p);
-  VDSO_SYMBOL (time) = p;
+  VDSO_SYMBOL (get_tbfreq) = get_vdso_mangle_symbol (HAVE_GET_TBFREQ);
 
   /* PPC64 uses only one signal trampoline symbol, while PPC32 will use
      two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not
@@ -67,13 +38,13 @@ _libc_vdso_platform_setup (void)
      There is no need to pointer mangle these symbol because they will
      used only for pointer comparison.  */
 #if defined(__PPC64__) || defined(__powerpc64__)
-  VDSO_SYMBOL(sigtramp_rt64) =  get_vdso_symbol ("__kernel_sigtramp_rt64");
+  VDSO_SYMBOL(sigtramp_rt64) =  get_vdso_symbol (HAVE_SIGTRAMP_RT64);
 #else
-  VDSO_SYMBOL(sigtramp32) = get_vdso_symbol ("__kernel_sigtramp32");
-  VDSO_SYMBOL(sigtramp_rt32) = get_vdso_symbol ("__kernel_sigtramp_rt32");
+  VDSO_SYMBOL(sigtramp32) = get_vdso_symbol (HAVE_SIGTRAMP_32);
+  VDSO_SYMBOL(sigtramp_rt32) = get_vdso_symbol (HAVE_SIGTRAMP_RT32);
 #endif
 }
 
-#define VDSO_SETUP _libc_vdso_platform_setup
+#define VDSO_SETUP_ARCH __libc_vdso_platform_setup_arch
 
-#include <csu/init-first.c>
+#include <sysdeps/unix/sysv/linux/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
index 13da28abaf..5c1f8de1c6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
@@ -17,20 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 
-#ifndef _LIBC_VDSO_H
-#define _LIBC_VDSO_H
+#ifndef _LIBC_POWERPC_VDSO_H
+#define _LIBC_POWERPC_VDSO_H
 
 #include <sysdep.h>
 #include <sysdep-vdso.h>
+#include_next <libc-vdso.h>
 
-extern int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
-  attribute_hidden;
-extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
-extern int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
 extern unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void);
-extern int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *);
-extern time_t (*VDSO_SYMBOL(time)) (time_t *);
-
 #if defined(__PPC64__) || defined(__powerpc64__)
 extern void *VDSO_SYMBOL(sigtramp_rt64);
 #else
diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/sysdep.h
index c72c93dfa0..a29f286ad7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.h
@@ -20,6 +20,16 @@
 #define VDSO_HASH  123718565
 
 /* List of system calls which are supported as vsyscalls.  */
-#define HAVE_CLOCK_GETRES_VSYSCALL	1
-#define HAVE_CLOCK_GETTIME_VSYSCALL	1
-#define HAVE_GETCPU_VSYSCALL		1
+#define HAVE_CLOCK_GETRES_VSYSCALL	"__kernel_clock_getres"
+#define HAVE_CLOCK_GETTIME_VSYSCALL	"__kernel_clock_gettime"
+#define HAVE_GETCPU_VSYSCALL		"__kernel_getcpu"
+#define HAVE_TIME_VSYSCALL		"__kernel_time"
+#define HAVE_GETTIMEOFDAY_VSYSCALL      "__kernel_gettimeofday"
+#define HAVE_GET_TBFREQ                 "__kernel_get_tbfreq"
+
+#if defined(__PPC64__) || defined(__powerpc64__)
+# define HAVE_SIGTRAMP_RT64		"__kernel_sigtramp_rt64"
+#else
+# define HAVE_SIGTRAMP_32		"__kernel_sigtramp32"
+# define HAVE_SIGTRAMP_RT32		"__kernel_sigtramp_rt32"
+#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
index 2a0b776927..c35b80fad1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/time.c
+++ b/sysdeps/unix/sysv/linux/powerpc/time.c
@@ -67,7 +67,7 @@ time_syscall (time_t *t)
 }
 
 # define INIT_ARCH() \
-  void *vdso_time = get_vdso_symbol ("__kernel_time");
+  void *vdso_time = get_vdso_symbol (HAVE_TIME_VSYSCALL);
 
 /* If the vDSO is not available we fall back to the syscall.  */
 libc_ifunc_hidden (__redirect_time, time,