hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
 * Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>
 *
 * Xenomai is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Xenomai 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
#ifndef _COBALT_KERNEL_COMPAT_H
#define _COBALT_KERNEL_COMPAT_H
 
#ifdef CONFIG_XENO_ARCH_SYS3264
 
#include <linux/compat.h>
#include <net/compat.h>
#include <asm/xenomai/wrappers.h>
#include <cobalt/uapi/sched.h>
 
struct mq_attr;
 
struct __compat_sched_ss_param {
   int __sched_low_priority;
   struct old_timespec32 __sched_repl_period;
   struct old_timespec32 __sched_init_budget;
   int __sched_max_repl;
};
 
struct __compat_sched_rr_param {
   struct old_timespec32 __sched_rr_quantum;
};
 
struct compat_sched_param_ex {
   int sched_priority;
   union {
       struct __compat_sched_ss_param ss;
       struct __compat_sched_rr_param rr;
       struct __sched_tp_param tp;
       struct __sched_quota_param quota;
   } sched_u;
};
 
struct compat_mq_attr {
   compat_long_t mq_flags;
   compat_long_t mq_maxmsg;
   compat_long_t mq_msgsize;
   compat_long_t mq_curmsgs;
};
 
struct compat_sched_tp_window {
   struct old_timespec32 offset;
   struct old_timespec32 duration;
   int ptid;
};
 
struct __compat_sched_config_tp {
   int op;
   int nr_windows;
   struct compat_sched_tp_window windows[0];
};
 
union compat_sched_config {
   struct __compat_sched_config_tp tp;
   struct __sched_config_quota quota;
};
 
#define compat_sched_tp_confsz(nr_win) \
  (sizeof(struct __compat_sched_config_tp) + nr_win * sizeof(struct compat_sched_tp_window))
 
typedef struct {
   compat_ulong_t fds_bits[__FD_SETSIZE / (8 * sizeof(compat_long_t))];
} compat_fd_set;
 
struct compat_rtdm_mmap_request {
   u64 offset;
   compat_size_t length;
   int prot;
   int flags;
};
 
int sys32_get_timespec(struct timespec64 *ts,
              const struct old_timespec32 __user *cts);
 
int sys32_put_timespec(struct old_timespec32 __user *cts,
              const struct timespec64 *ts);
 
int sys32_get_itimerspec(struct itimerspec64 *its,
            const struct old_itimerspec32 __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 old_timeval32 __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,
           const struct old_timex32 __user *ctx);
 
int sys32_put_timex(struct old_timex32 __user *ctx,
           const struct __kernel_timex *tx);
 
int sys32_get_fdset(fd_set *fds, const compat_fd_set __user *cfds,
           size_t cfdsize);
 
int sys32_put_fdset(compat_fd_set __user *cfds, const fd_set *fds,
           size_t fdsize);
 
int sys32_get_param_ex(int policy,
              struct sched_param_ex *p,
              const struct compat_sched_param_ex __user *u_cp);
 
int sys32_put_param_ex(int policy,
              struct compat_sched_param_ex __user *u_cp,
              const struct sched_param_ex *p);
 
int sys32_get_mqattr(struct mq_attr *ap,
            const struct compat_mq_attr __user *u_cap);
 
int sys32_put_mqattr(struct compat_mq_attr __user *u_cap,
            const struct mq_attr *ap);
 
int sys32_get_sigevent(struct sigevent *ev,
              const struct compat_sigevent *__user u_cev);
 
int sys32_get_sigset(sigset_t *set, const compat_sigset_t *u_cset);
 
int sys32_put_sigset(compat_sigset_t *u_cset, const sigset_t *set);
 
int sys32_get_sigval(union sigval *val, const union compat_sigval *u_cval);
 
int sys32_put_siginfo(void __user *u_si, const struct siginfo *si,
             int overrun);
 
int sys32_get_msghdr(struct user_msghdr *msg,
            const struct compat_msghdr __user *u_cmsg);
 
int sys32_get_mmsghdr(struct mmsghdr *mmsg,
             const struct compat_mmsghdr __user *u_cmmsg);
 
int sys32_put_msghdr(struct compat_msghdr __user *u_cmsg,
            const struct user_msghdr *msg);
 
int sys32_put_mmsghdr(struct compat_mmsghdr __user *u_cmmsg,
            const struct mmsghdr *mmsg);
 
int sys32_get_iovec(struct iovec *iov,
           const struct compat_iovec __user *ciov,
           int ciovlen);
 
int sys32_put_iovec(struct compat_iovec __user *u_ciov,
           const struct iovec *iov,
           int iovlen);
 
#endif /* CONFIG_XENO_ARCH_SYS3264 */
 
#endif /* !_COBALT_KERNEL_COMPAT_H */