|
Packit Service |
82fcde |
/* vDSO common definition for Linux.
|
|
Packit Service |
82fcde |
Copyright (C) 2015-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library; if not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#ifndef SYSDEP_VDSO_LINUX_H
|
|
Packit Service |
82fcde |
# define SYSDEP_VDSO_LINUX_H
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#define VDSO_SYMBOL(__name) __vdso_##__name
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#ifndef INTERNAL_VSYSCALL_CALL
|
|
Packit Service |
82fcde |
# define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
|
|
Packit Service |
82fcde |
funcptr (args)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#ifdef SHARED
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# ifdef HAVE_VSYSCALL
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# include <libc-vdso.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# define INLINE_VSYSCALL(name, nr, args...) \
|
|
Packit Service |
82fcde |
({ \
|
|
Packit Service |
82fcde |
__label__ out; \
|
|
Packit Service |
82fcde |
__label__ iserr; \
|
|
Packit Service |
82fcde |
INTERNAL_SYSCALL_DECL (sc_err); \
|
|
Packit Service |
82fcde |
long int sc_ret; \
|
|
Packit Service |
82fcde |
\
|
|
Packit Service |
82fcde |
__typeof (__vdso_##name) vdsop = __vdso_##name; \
|
|
Packit Service |
82fcde |
PTR_DEMANGLE (vdsop); \
|
|
Packit Service |
82fcde |
if (vdsop != NULL) \
|
|
Packit Service |
82fcde |
{ \
|
|
Packit Service |
82fcde |
sc_ret = INTERNAL_VSYSCALL_CALL (vdsop, sc_err, nr, ##args); \
|
|
Packit Service |
82fcde |
if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
|
|
Packit Service |
82fcde |
goto out; \
|
|
Packit Service |
82fcde |
if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \
|
|
Packit Service |
82fcde |
goto iserr; \
|
|
Packit Service |
82fcde |
} \
|
|
Packit Service |
82fcde |
\
|
|
Packit Service |
82fcde |
sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, ##args); \
|
|
Packit Service |
82fcde |
if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
|
|
Packit Service |
82fcde |
{ \
|
|
Packit Service |
82fcde |
iserr: \
|
|
Packit Service |
82fcde |
__set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
|
|
Packit Service |
82fcde |
sc_ret = -1L; \
|
|
Packit Service |
82fcde |
} \
|
|
Packit Service |
82fcde |
out: \
|
|
Packit Service |
82fcde |
sc_ret; \
|
|
Packit Service |
82fcde |
})
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# define INTERNAL_VSYSCALL(name, err, nr, args...) \
|
|
Packit Service |
82fcde |
({ \
|
|
Packit Service |
82fcde |
__label__ out; \
|
|
Packit Service |
82fcde |
long v_ret; \
|
|
Packit Service |
82fcde |
\
|
|
Packit Service |
82fcde |
__typeof (__vdso_##name) vdsop = __vdso_##name; \
|
|
Packit Service |
82fcde |
PTR_DEMANGLE (vdsop); \
|
|
Packit Service |
82fcde |
if (vdsop != NULL) \
|
|
Packit Service |
82fcde |
{ \
|
|
Packit Service |
82fcde |
v_ret = INTERNAL_VSYSCALL_CALL (vdsop, err, nr, ##args); \
|
|
Packit Service |
82fcde |
if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \
|
|
Packit Service |
82fcde |
|| INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \
|
|
Packit Service |
82fcde |
goto out; \
|
|
Packit Service |
82fcde |
} \
|
|
Packit Service |
82fcde |
v_ret = INTERNAL_SYSCALL (name, err, nr, ##args); \
|
|
Packit Service |
82fcde |
out: \
|
|
Packit Service |
82fcde |
v_ret; \
|
|
Packit Service |
82fcde |
})
|
|
Packit Service |
82fcde |
# else
|
|
Packit Service |
82fcde |
# define INLINE_VSYSCALL(name, nr, args...) \
|
|
Packit Service |
82fcde |
INLINE_SYSCALL (name, nr, ##args)
|
|
Packit Service |
82fcde |
# define INTERNAL_VSYSCALL(name, err, nr, args...) \
|
|
Packit Service |
82fcde |
INTERNAL_SYSCALL (name, err, nr, ##args)
|
|
Packit Service |
82fcde |
# endif /* HAVE_VSYSCALL */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# else /* SHARED */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# define INLINE_VSYSCALL(name, nr, args...) \
|
|
Packit Service |
82fcde |
INLINE_SYSCALL (name, nr, ##args)
|
|
Packit Service |
82fcde |
# define INTERNAL_VSYSCALL(name, err, nr, args...) \
|
|
Packit Service |
82fcde |
INTERNAL_SYSCALL (name, err, nr, ##args)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#endif /* SHARED */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#endif /* SYSDEP_VDSO_LINUX_H */
|