Commit 2f39970a authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/kernel: y2038: switch to new legacy type names

Since 5.6-rc3, former 32bit compatibility types for time-related
structs have been renamed as follows:

compat_timeval -> old_timeval32
compat_timespec -> old_timespec32
compat_itimerspec -> old_itimerspec32

Apply the same changes to the tree, providing backward compatibility
wrappers for pre-5.7 kernels.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 84c45651
......@@ -29,13 +29,13 @@ struct mq_attr;
struct __compat_sched_ss_param {
int __sched_low_priority;
struct compat_timespec __sched_repl_period;
struct compat_timespec __sched_init_budget;
struct old_timespec32 __sched_repl_period;
struct old_timespec32 __sched_init_budget;
int __sched_max_repl;
};
struct __compat_sched_rr_param {
struct compat_timespec __sched_rr_quantum;
struct old_timespec32 __sched_rr_quantum;
};
struct compat_sched_param_ex {
......@@ -56,8 +56,8 @@ struct compat_mq_attr {
};
struct compat_sched_tp_window {
struct compat_timespec offset;
struct compat_timespec duration;
struct old_timespec32 offset;
struct old_timespec32 duration;
int ptid;
};
......@@ -87,21 +87,21 @@ struct compat_rtdm_mmap_request {
};
int sys32_get_timespec(struct timespec64 *ts,
const struct compat_timespec __user *cts);
const struct old_timespec32 __user *cts);
int sys32_put_timespec(struct compat_timespec __user *cts,
int sys32_put_timespec(struct old_timespec32 __user *cts,
const struct timespec64 *ts);
int sys32_get_itimerspec(struct itimerspec64 *its,
const struct compat_itimerspec __user *cits);
const struct old_itimerspec32 __user *cits);
int sys32_put_itimerspec(struct compat_itimerspec __user *cits,
int sys32_put_itimerspec(struct old_itimerspec32 __user *cits,
const struct itimerspec64 *its);
int sys32_get_timeval(struct __kernel_old_timeval *tv,
const struct compat_timeval __user *ctv);
const struct old_timeval32 __user *ctv);
int sys32_put_timeval(struct compat_timeval __user *ctv,
int sys32_put_timeval(struct old_timeval32 __user *ctv,
const struct __kernel_old_timeval *tv);
int sys32_get_timex(struct __kernel_timex *tx,
......
......@@ -205,6 +205,9 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name,
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)
#define pci_aer_clear_nonfatal_status pci_cleanup_aer_uncorrect_error_status
#define old_timespec32 compat_timespec
#define old_itimerspec32 compat_itimerspec
#define old_timeval32 compat_timeval
#endif
#endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
......@@ -23,9 +23,9 @@
#include <xenomai/posix/mqueue.h>
int sys32_get_timespec(struct timespec64 *ts,
const struct compat_timespec __user *u_cts)
const struct old_timespec32 __user *u_cts)
{
struct compat_timespec cts;
struct old_timespec32 cts;
if (u_cts == NULL || !access_rok(u_cts, sizeof(*u_cts)))
return -EFAULT;
......@@ -41,10 +41,10 @@ int sys32_get_timespec(struct timespec64 *ts,
}
EXPORT_SYMBOL_GPL(sys32_get_timespec);
int sys32_put_timespec(struct compat_timespec __user *u_cts,
int sys32_put_timespec(struct old_timespec32 __user *u_cts,
const struct timespec64 *ts)
{
struct compat_timespec cts;
struct old_timespec32 cts;
if (u_cts == NULL || !access_wok(u_cts, sizeof(*u_cts)))
return -EFAULT;
......@@ -61,7 +61,7 @@ int sys32_put_timespec(struct compat_timespec __user *u_cts,
EXPORT_SYMBOL_GPL(sys32_put_timespec);
int sys32_get_itimerspec(struct itimerspec64 *its,
const struct compat_itimerspec __user *cits)
const struct old_itimerspec32 __user *cits)
{
int ret = sys32_get_timespec(&its->it_value, &cits->it_value);
......@@ -69,7 +69,7 @@ int sys32_get_itimerspec(struct itimerspec64 *its,
}
EXPORT_SYMBOL_GPL(sys32_get_itimerspec);
int sys32_put_itimerspec(struct compat_itimerspec __user *cits,
int sys32_put_itimerspec(struct old_itimerspec32 __user *cits,
const struct itimerspec64 *its)
{
int ret = sys32_put_timespec(&cits->it_value, &its->it_value);
......@@ -79,7 +79,7 @@ int sys32_put_itimerspec(struct compat_itimerspec __user *cits,
EXPORT_SYMBOL_GPL(sys32_put_itimerspec);
int sys32_get_timeval(struct __kernel_old_timeval *tv,
const struct compat_timeval __user *ctv)
const struct old_timeval32 __user *ctv)
{
return (ctv == NULL ||
!access_rok(ctv, sizeof(*ctv)) ||
......@@ -88,7 +88,7 @@ int sys32_get_timeval(struct __kernel_old_timeval *tv,
}
EXPORT_SYMBOL_GPL(sys32_get_timeval);
int sys32_put_timeval(struct compat_timeval __user *ctv,
int sys32_put_timeval(struct old_timeval32 __user *ctv,
const struct __kernel_old_timeval *tv)
{
return (ctv == NULL ||
......
......@@ -124,14 +124,14 @@ COBALT_SYSCALL32emu(sem_open, lostage,
COBALT_SYSCALL32emu(sem_timedwait, primary,
(struct cobalt_sem_shadow __user *u_sem,
struct compat_timespec __user *u_ts))
struct old_timespec32 __user *u_ts))
{
return __cobalt_sem_timedwait(u_sem, u_ts, sys32_fetch_timeout);
}
COBALT_SYSCALL32emu(clock_getres, current,
(clockid_t clock_id,
struct compat_timespec __user *u_ts))
struct old_timespec32 __user *u_ts))
{
struct timespec64 ts;
int ret;
......@@ -145,7 +145,7 @@ COBALT_SYSCALL32emu(clock_getres, current,
COBALT_SYSCALL32emu(clock_gettime, current,
(clockid_t clock_id,
struct compat_timespec __user *u_ts))
struct old_timespec32 __user *u_ts))
{
struct timespec64 ts;
int ret;
......@@ -159,7 +159,7 @@ COBALT_SYSCALL32emu(clock_gettime, current,
COBALT_SYSCALL32emu(clock_settime, current,
(clockid_t clock_id,
const struct compat_timespec __user *u_ts))
const struct old_timespec32 __user *u_ts))
{
struct timespec64 ts;
int ret;
......@@ -190,8 +190,8 @@ COBALT_SYSCALL32emu(clock_adjtime, current,
COBALT_SYSCALL32emu(clock_nanosleep, nonrestartable,
(clockid_t clock_id, int flags,
const struct compat_timespec __user *u_rqt,
struct compat_timespec __user *u_rmt))
const struct old_timespec32 __user *u_rqt,
struct old_timespec32 __user *u_rmt))
{
struct timespec64 rqt, rmt, *rmtp = NULL;
int ret;
......@@ -212,7 +212,7 @@ COBALT_SYSCALL32emu(clock_nanosleep, nonrestartable,
COBALT_SYSCALL32emu(mutex_timedlock, primary,
(struct cobalt_mutex_shadow __user *u_mx,
const struct compat_timespec __user *u_ts))
const struct old_timespec32 __user *u_ts))
{
return __cobalt_mutex_timedlock_break(u_mx, u_ts, sys32_fetch_timeout);
}
......@@ -222,7 +222,7 @@ COBALT_SYSCALL32emu(cond_wait_prologue, nonrestartable,
struct cobalt_mutex_shadow __user *u_mx,
int *u_err,
unsigned int timed,
struct compat_timespec __user *u_ts))
struct old_timespec32 __user *u_ts))
{
return __cobalt_cond_wait_prologue(u_cnd, u_mx, u_err, u_ts,
timed ? sys32_fetch_timeout : NULL);
......@@ -261,7 +261,7 @@ COBALT_SYSCALL32emu(mq_getattr, current,
COBALT_SYSCALL32emu(mq_timedsend, primary,
(mqd_t uqd, const void __user *u_buf, size_t len,
unsigned int prio,
const struct compat_timespec __user *u_ts))
const struct old_timespec32 __user *u_ts))
{
return __cobalt_mq_timedsend(uqd, u_buf, len, prio,
u_ts, u_ts ? sys32_fetch_timeout : NULL);
......@@ -271,7 +271,7 @@ COBALT_SYSCALL32emu(mq_timedreceive, primary,
(mqd_t uqd, void __user *u_buf,
compat_ssize_t __user *u_len,
unsigned int __user *u_prio,
const struct compat_timespec __user *u_ts))
const struct old_timespec32 __user *u_ts))
{
compat_ssize_t clen;
ssize_t len;
......@@ -511,8 +511,8 @@ COBALT_SYSCALL32emu(timer_create, current,
COBALT_SYSCALL32emu(timer_settime, primary,
(timer_t tm, int flags,
const struct compat_itimerspec __user *u_newval,
struct compat_itimerspec __user *u_oldval))
const struct old_itimerspec32 __user *u_newval,
struct old_itimerspec32 __user *u_oldval))
{
struct itimerspec64 newv, oldv, *oldvp = &oldv;
int ret;
......@@ -538,7 +538,7 @@ COBALT_SYSCALL32emu(timer_settime, primary,
}
COBALT_SYSCALL32emu(timer_gettime, current,
(timer_t tm, struct compat_itimerspec __user *u_val))
(timer_t tm, struct old_itimerspec32 __user *u_val))
{
struct itimerspec64 val;
int ret;
......@@ -550,8 +550,8 @@ COBALT_SYSCALL32emu(timer_gettime, current,
COBALT_SYSCALL32emu(timerfd_settime, primary,
(int fd, int flags,
const struct compat_itimerspec __user *new_value,
struct compat_itimerspec __user *old_value))
const struct old_itimerspec32 __user *new_value,
struct old_itimerspec32 __user *old_value))
{
struct itimerspec64 ovalue, value;
int ret;
......@@ -575,7 +575,7 @@ COBALT_SYSCALL32emu(timerfd_settime, primary,
}
COBALT_SYSCALL32emu(timerfd_gettime, current,
(int fd, struct compat_itimerspec __user *curr_value))
(int fd, struct old_itimerspec32 __user *curr_value))
{
struct itimerspec64 value;
int ret;
......@@ -606,7 +606,7 @@ COBALT_SYSCALL32emu(sigwait, primary,
COBALT_SYSCALL32emu(sigtimedwait, nonrestartable,
(const compat_sigset_t __user *u_set,
struct compat_siginfo __user *u_si,
const struct compat_timespec __user *u_timeout))
const struct old_timespec32 __user *u_timeout))
{
struct timespec64 timeout;
sigset_t set;
......@@ -658,7 +658,7 @@ COBALT_SYSCALL32emu(sigqueue, conforming,
COBALT_SYSCALL32emu(monitor_wait, nonrestartable,
(struct cobalt_monitor_shadow __user *u_mon,
int event, const struct compat_timespec __user *u_ts,
int event, const struct old_timespec32 __user *u_ts,
int __user *u_ret))
{
struct timespec64 ts, *tsp = NULL;
......@@ -678,7 +678,7 @@ COBALT_SYSCALL32emu(event_wait, primary,
(struct cobalt_event_shadow __user *u_event,
unsigned int bits,
unsigned int __user *u_bits_r,
int mode, const struct compat_timespec __user *u_ts))
int mode, const struct old_timespec32 __user *u_ts))
{
struct timespec64 ts, *tsp = NULL;
int ret;
......@@ -698,7 +698,7 @@ COBALT_SYSCALL32emu(select, nonrestartable,
compat_fd_set __user *u_rfds,
compat_fd_set __user *u_wfds,
compat_fd_set __user *u_xfds,
struct compat_timeval __user *u_tv))
struct old_timeval32 __user *u_tv))
{
compat_fd_set __user *ufd_sets[XNSELECT_MAX_TYPES] = {
[XNSELECT_READ] = u_rfds,
......@@ -829,7 +829,7 @@ static int put_mmsg32(void __user **u_mmsg_p, const struct mmsghdr *mmsg)
COBALT_SYSCALL32emu(recvmmsg, primary,
(int ufd, struct compat_mmsghdr __user *u_msgvec, unsigned int vlen,
unsigned int flags, struct compat_timespec *u_timeout))
unsigned int flags, struct old_timespec32 *u_timeout))
{
return __rtdm_fd_recvmmsg(ufd, u_msgvec, vlen, flags, u_timeout,
get_mmsg32, put_mmsg32,
......
......@@ -53,15 +53,15 @@ COBALT_SYSCALL32emu_DECL(thread_setschedprio,
COBALT_SYSCALL32emu_DECL(clock_getres,
(clockid_t clock_id,
struct compat_timespec __user *u_ts));
struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(clock_gettime,
(clockid_t clock_id,
struct compat_timespec __user *u_ts));
struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(clock_settime,
(clockid_t clock_id,
const struct compat_timespec __user *u_ts));
const struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(clock_adjtime,
(clockid_t clock_id,
......@@ -69,19 +69,19 @@ COBALT_SYSCALL32emu_DECL(clock_adjtime,
COBALT_SYSCALL32emu_DECL(clock_nanosleep,
(clockid_t clock_id, int flags,
const struct compat_timespec __user *u_rqt,
struct compat_timespec __user *u_rmt));
const struct old_timespec32 __user *u_rqt,
struct old_timespec32 __user *u_rmt));
COBALT_SYSCALL32emu_DECL(mutex_timedlock,
(struct cobalt_mutex_shadow __user *u_mx,
const struct compat_timespec __user *u_ts));
const struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(cond_wait_prologue,
(struct cobalt_cond_shadow __user *u_cnd,
struct cobalt_mutex_shadow __user *u_mx,
int *u_err,
unsigned int timed,
struct compat_timespec __user *u_ts));
struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(mq_open,
(const char __user *u_name, int oflags,
......@@ -93,13 +93,13 @@ COBALT_SYSCALL32emu_DECL(mq_getattr,
COBALT_SYSCALL32emu_DECL(mq_timedsend,
(mqd_t uqd, const void __user *u_buf, size_t len,
unsigned int prio,
const struct compat_timespec __user *u_ts));
const struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(mq_timedreceive,
(mqd_t uqd, void __user *u_buf,
compat_ssize_t __user *u_len,
unsigned int __user *u_prio,
const struct compat_timespec __user *u_ts));
const struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32x_DECL(mq_timedreceive,
(mqd_t uqd, void __user *u_buf,
......@@ -143,20 +143,20 @@ COBALT_SYSCALL32emu_DECL(timer_create,
COBALT_SYSCALL32emu_DECL(timer_settime,
(timer_t tm, int flags,
const struct compat_itimerspec __user *u_newval,
struct compat_itimerspec __user *u_oldval));
const struct old_itimerspec32 __user *u_newval,
struct old_itimerspec32 __user *u_oldval));
COBALT_SYSCALL32emu_DECL(timer_gettime,
(timer_t tm,
struct compat_itimerspec __user *u_val));
struct old_itimerspec32 __user *u_val));
COBALT_SYSCALL32emu_DECL(timerfd_settime,
(int fd, int flags,
const struct compat_itimerspec __user *new_value,
struct compat_itimerspec __user *old_value));
const struct old_itimerspec32 __user *new_value,
struct old_itimerspec32 __user *old_value));
COBALT_SYSCALL32emu_DECL(timerfd_gettime,
(int fd, struct compat_itimerspec __user *value));
(int fd, struct old_itimerspec32 __user *value));
COBALT_SYSCALL32emu_DECL(sigwait,
(const compat_sigset_t __user *u_set,
......@@ -165,7 +165,7 @@ COBALT_SYSCALL32emu_DECL(sigwait,
COBALT_SYSCALL32emu_DECL(sigtimedwait,
(const compat_sigset_t __user *u_set,
struct compat_siginfo __user *u_si,
const struct compat_timespec __user *u_timeout));
const struct old_timespec32 __user *u_timeout));
COBALT_SYSCALL32emu_DECL(sigwaitinfo,
(const compat_sigset_t __user *u_set,
......@@ -180,21 +180,21 @@ COBALT_SYSCALL32emu_DECL(sigqueue,
COBALT_SYSCALL32emu_DECL(monitor_wait,
(struct cobalt_monitor_shadow __user *u_mon,
int event, const struct compat_timespec __user *u_ts,
int event, const struct old_timespec32 __user *u_ts,
int __user *u_ret));
COBALT_SYSCALL32emu_DECL(event_wait,
(struct cobalt_event_shadow __user *u_event,
unsigned int bits,
unsigned int __user *u_bits_r,
int mode, const struct compat_timespec __user *u_ts));
int mode, const struct old_timespec32 __user *u_ts));
COBALT_SYSCALL32emu_DECL(select,
(int nfds,
compat_fd_set __user *u_rfds,
compat_fd_set __user *u_wfds,
compat_fd_set __user *u_xfds,
struct compat_timeval __user *u_tv));
struct old_timeval32 __user *u_tv));
COBALT_SYSCALL32emu_DECL(recvmsg,
(int fd, struct compat_msghdr __user *umsg,
......@@ -203,7 +203,7 @@ COBALT_SYSCALL32emu_DECL(recvmsg,
COBALT_SYSCALL32emu_DECL(recvmmsg,
(int fd, struct compat_mmsghdr __user *u_msgvec,
unsigned int vlen,
unsigned int flags, struct compat_timespec *u_timeout));
unsigned int flags, struct old_timespec32 *u_timeout));
COBALT_SYSCALL32emu_DECL(sendmsg,
(int fd, struct compat_msghdr __user *umsg,
......@@ -229,6 +229,6 @@ COBALT_SYSCALL32emu_DECL(sem_open,
COBALT_SYSCALL32emu_DECL(sem_timedwait,
(struct cobalt_sem_shadow __user *u_sem,
struct compat_timespec __user *u_ts));
struct old_timespec32 __user *u_ts));
#endif /* !_COBALT_POSIX_SYSCALL32_H */
......@@ -273,7 +273,7 @@ int rtipc_get_timeval(struct rtdm_fd *fd, struct __kernel_old_timeval *tv,
{
#ifdef CONFIG_XENO_ARCH_SYS3264
if (rtdm_fd_is_compat(fd)) {
if (arglen != sizeof(struct compat_timeval))
if (arglen != sizeof(struct old_timeval32))
return -EINVAL;
return sys32_get_timeval(tv, arg);
}
......@@ -295,7 +295,7 @@ int rtipc_put_timeval(struct rtdm_fd *fd, void *arg,
{
#ifdef CONFIG_XENO_ARCH_SYS3264
if (rtdm_fd_is_compat(fd)) {
if (arglen != sizeof(struct compat_timeval))
if (arglen != sizeof(struct old_timeval32))
return -EINVAL;
return sys32_put_timeval(arg, tv);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment