Xenomai  3.1
compat.h
1 /*
2  * Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>
3  *
4  * Xenomai is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 #ifndef _COBALT_RTDM_COMPAT_H
19 #define _COBALT_RTDM_COMPAT_H
20 
21 #ifdef CONFIG_XENO_ARCH_SYS3264
22 
23 #include <cobalt/kernel/compat.h>
24 #include <rtdm/rtdm.h>
25 
26 struct compat_rtdm_getsockopt_args {
27  int level;
28  int optname;
29  compat_uptr_t optval;
30  compat_uptr_t optlen;
31 };
32 
33 struct compat_rtdm_setsockopt_args {
34  int level;
35  int optname;
36  const compat_uptr_t optval;
37  socklen_t optlen;
38 };
39 
40 struct compat_rtdm_getsockaddr_args {
41  compat_uptr_t addr;
42  compat_uptr_t addrlen;
43 };
44 
45 struct compat_rtdm_setsockaddr_args {
46  const compat_uptr_t addr;
47  socklen_t addrlen;
48 };
49 
50 #define _RTIOC_GETSOCKOPT_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x20, \
51  struct compat_rtdm_getsockopt_args)
52 #define _RTIOC_SETSOCKOPT_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x21, \
53  struct compat_rtdm_setsockopt_args)
54 #define _RTIOC_BIND_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x22, \
55  struct compat_rtdm_setsockaddr_args)
56 #define _RTIOC_CONNECT_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x23, \
57  struct compat_rtdm_setsockaddr_args)
58 #define _RTIOC_ACCEPT_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x25, \
59  struct compat_rtdm_getsockaddr_args)
60 #define _RTIOC_GETSOCKNAME_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x26, \
61  struct compat_rtdm_getsockaddr_args)
62 #define _RTIOC_GETPEERNAME_COMPAT _IOW(RTIOC_TYPE_COMMON, 0x27, \
63  struct compat_rtdm_getsockaddr_args)
64 
65 #define __COMPAT_CASE(__op) : case __op
66 
67 #else /* !CONFIG_XENO_ARCH_SYS3264 */
68 
69 #define __COMPAT_CASE(__op)
70 
71 #endif /* !CONFIG_XENO_ARCH_SYS3264 */
72 
73 #define COMPAT_CASE(__op) case __op __COMPAT_CASE(__op ## _COMPAT)
74 
75 #endif /* !_COBALT_RTDM_COMPAT_H */