mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
powerpc: Simplify vsyscall internal macros
This patch simplifies the powerpc internal macros for vDSO calls
by:
- Removing INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, used solely on
get_timebase_freq.
- Adjust INTERNAL_VSYSCALL_CALL_TYPE powerpc32 to follow powerpc64
argument ordering.
- Use HAVE_*_VSYSCALL instead of explicit strings.
- Make powerpc libc-vdso.h include generic implementation.
No semantic change expected, checked on powerpc-linux-gnu-power4,
powerpc64-linux-gnu, and powerpc64le-linux-gnu.
* sysdeps/unix/sysv/linux/libc-vdso.h (VDSO_IFUNC_RET): Define if not
defined.
* sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c
(__get_timebase_freq): Remove use of
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK.
(get_timebase_freq_fallback): New symbol.
* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (time): Use
HAVE_GETTIMEOFDAY_VSYSCALL.
* sysdeps/unix/sysv/linux/powerpc/time.c (gettimeofday): Use
HAVE_TIME_VSYSCALL.
* sysdeps/unix/sysv/linux/powerpc/libc-vdso.h: Include generic
implementation.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
(INTERNAL_VSYSCALL_CALL_TYPE): Make calling convention similar to
powerpc64.
(INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Remove macro.
* .../sysv/linux/powerpc/powerpc64/sysdep.h
(INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Likewise.
* sysdeps/unix/sysv/linux/powerpc/sysdep.h
(HAVE_GETTIMEOFDAY_VSYSCALL): Define.
This commit is contained in:
@@ -22,17 +22,9 @@
|
||||
|
||||
#include <sysdep.h>
|
||||
#include <sysdep-vdso.h>
|
||||
#include_next <libc-vdso.h>
|
||||
|
||||
extern unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void);
|
||||
#if defined(__PPC64__) || defined(__powerpc64__)
|
||||
extern void *VDSO_SYMBOL(sigtramp_rt64);
|
||||
#else
|
||||
extern void *VDSO_SYMBOL(sigtramp32);
|
||||
extern void *VDSO_SYMBOL(sigtramp_rt32);
|
||||
#endif
|
||||
|
||||
#if (defined(__PPC64__) || defined(__powerpc64__)) && _CALL_ELF != 2
|
||||
# include <dl-machine.h>
|
||||
/* The correct solution is for _dl_vdso_vsym to return the address of the OPD
|
||||
for the kernel VDSO function. That address would then be stored in the
|
||||
__vdso_* variables and returned as the result of the IFUNC resolver function.
|
||||
@@ -51,7 +43,7 @@ extern void *VDSO_SYMBOL(sigtramp_rt32);
|
||||
are processed immediately at startup the resolver functions and this code need
|
||||
not be thread-safe, but if the caller writes to a PLT slot it must do so in a
|
||||
thread-safe manner with all the required barriers. */
|
||||
#define VDSO_IFUNC_RET(value) \
|
||||
# define VDSO_IFUNC_RET(value) \
|
||||
({ \
|
||||
static Elf64_FuncDesc vdso_opd = { .fd_toc = ~0x0 }; \
|
||||
vdso_opd.fd_func = (Elf64_Addr)value; \
|
||||
@@ -59,7 +51,17 @@ extern void *VDSO_SYMBOL(sigtramp_rt32);
|
||||
})
|
||||
|
||||
#else
|
||||
#define VDSO_IFUNC_RET(value) ((void *) (value))
|
||||
# define VDSO_IFUNC_RET(value) ((void *) (value))
|
||||
#endif
|
||||
|
||||
#include_next <libc-vdso.h>
|
||||
|
||||
extern unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void);
|
||||
#if defined(__PPC64__) || defined(__powerpc64__)
|
||||
extern void *VDSO_SYMBOL(sigtramp_rt64);
|
||||
#else
|
||||
extern void *VDSO_SYMBOL(sigtramp32);
|
||||
extern void *VDSO_SYMBOL(sigtramp_rt32);
|
||||
#endif
|
||||
|
||||
#endif /* _LIBC_VDSO_H */
|
||||
|
||||
Reference in New Issue
Block a user