Module: xenomai-3
Branch: next
Commit: 3049dc0340af2c908b5d59558792c7440f69034d
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3049dc0340af2c908b5d59558792c7440f69034d

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Oct 31 11:14:44 2014 +0100

cobalt/kernel: check for ARCH_SYS3264 instead of COMPAT

Some 64bit architectures for which we don't implement the 32bit ABI
model may define CONFIG_COMPAT nevertheless (e.g. ppc64), so we want
to check for CONFIG_XENO_ARCH_SYS3264 instead of CONFIG_COMPAT to
enable this model when available.

---

 include/cobalt/kernel/compat.h       |    4 ++--
 include/cobalt/kernel/rtdm/compat.h  |    6 +++---
 include/cobalt/kernel/rtdm/fd.h      |    4 ++--
 include/cobalt/kernel/rtdm/testing.h |    4 ++--
 kernel/cobalt/arch/x86/mayday.c      |    8 ++++----
 kernel/cobalt/rtdm/fd.c              |    6 +++---
 kernel/drivers/ipc/rtipc.c           |   20 ++++++++++----------
 kernel/drivers/testing/timerbench.c  |    6 +++---
 8 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/include/cobalt/kernel/compat.h b/include/cobalt/kernel/compat.h
index 6a2e838..6304a85 100644
--- a/include/cobalt/kernel/compat.h
+++ b/include/cobalt/kernel/compat.h
@@ -18,7 +18,7 @@
 #ifndef _COBALT_KERNEL_COMPAT_H
 #define _COBALT_KERNEL_COMPAT_H
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 
 #include <linux/compat.h>
 #include <net/compat.h>
@@ -148,6 +148,6 @@ int sys32_put_iovec(struct compat_iovec __user *u_ciov,
                    const struct iovec *iov,
                    int iovlen);
 
-#endif /* CONFIG_COMPAT */
+#endif /* CONFIG_XENO_ARCH_SYS3264 */
 
 #endif /* !_COBALT_KERNEL_COMPAT_H */
diff --git a/include/cobalt/kernel/rtdm/compat.h 
b/include/cobalt/kernel/rtdm/compat.h
index 974f9bd..2c81a33 100644
--- a/include/cobalt/kernel/rtdm/compat.h
+++ b/include/cobalt/kernel/rtdm/compat.h
@@ -18,7 +18,7 @@
 #ifndef _COBALT_RTDM_COMPAT_H
 #define _COBALT_RTDM_COMPAT_H
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 
 #include <cobalt/kernel/compat.h>
 #include <rtdm/rtdm.h>
@@ -64,11 +64,11 @@ struct compat_rtdm_setsockaddr_args {
 
 #define __COMPAT_CASE(__op)            : case __op
 
-#else  /* !CONFIG_COMPAT */
+#else  /* !CONFIG_XENO_ARCH_SYS3264 */
 
 #define __COMPAT_CASE(__op)
 
-#endif /* !CONFIG_COMPAT */
+#endif /* !CONFIG_XENO_ARCH_SYS3264 */
 
 #define COMPAT_CASE(__op)      case __op __COMPAT_CASE(__op  ## _COMPAT)
 
diff --git a/include/cobalt/kernel/rtdm/fd.h b/include/cobalt/kernel/rtdm/fd.h
index 5685b3a..1c0fe9e 100644
--- a/include/cobalt/kernel/rtdm/fd.h
+++ b/include/cobalt/kernel/rtdm/fd.h
@@ -300,7 +300,7 @@ struct rtdm_fd {
        unsigned int refs;
        int minor;
        int oflags;
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        int compat;
 #endif
        struct list_head cleanup;
@@ -330,7 +330,7 @@ static inline int rtdm_fd_flags(const struct rtdm_fd *fd)
        return fd->oflags;
 }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 static inline int rtdm_fd_is_compat(const struct rtdm_fd *fd)
 {
        return fd->compat;
diff --git a/include/cobalt/kernel/rtdm/testing.h 
b/include/cobalt/kernel/rtdm/testing.h
index 2cf96a2..9c69428 100644
--- a/include/cobalt/kernel/rtdm/testing.h
+++ b/include/cobalt/kernel/rtdm/testing.h
@@ -22,7 +22,7 @@
 #include <rtdm/rtdm.h>
 #include <rtdm/uapi/testing.h>
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 
 #include <rtdm/compat.h>
 
@@ -36,6 +36,6 @@ struct compat_rttst_overall_bench_res {
 #define RTTST_RTIOC_TMBENCH_STOP_COMPAT \
        _IOWR(RTIOC_TYPE_TESTING, 0x11, struct compat_rttst_overall_bench_res)
 
-#endif /* CONFIG_COMPAT */
+#endif /* CONFIG_XENO_ARCH_SYS3264 */
 
 #endif /* !_COBALT_RTDM_TESTING_H */
diff --git a/kernel/cobalt/arch/x86/mayday.c b/kernel/cobalt/arch/x86/mayday.c
index de52763..4b986c9 100644
--- a/kernel/cobalt/arch/x86/mayday.c
+++ b/kernel/cobalt/arch/x86/mayday.c
@@ -25,7 +25,7 @@
 #include <asm/ptrace.h>
 
 static void *mayday;
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 static void *mayday_compat;
 #endif
 
@@ -105,7 +105,7 @@ int xnarch_init_mayday(void)
        setup_mayday32(mayday);
 #else
        setup_mayday64(mayday);
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        mayday_compat = vmalloc(PAGE_SIZE);
        if (mayday_compat == NULL) {
                vfree(mayday);
@@ -120,14 +120,14 @@ int xnarch_init_mayday(void)
 void xnarch_cleanup_mayday(void)
 {
        vfree(mayday);
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        vfree(mayday_compat);
 #endif
 }
 
 void *xnarch_get_mayday_page(void)
 {
-#if defined(CONFIG_X86_32) || !defined(CONFIG_COMPAT)
+#if defined(CONFIG_X86_32) || !defined(CONFIG_XENO_ARCH_SYS3264)
        return mayday;
 #else
        return test_thread_flag(TIF_IA32) ? mayday_compat : mayday;
diff --git a/kernel/cobalt/rtdm/fd.c b/kernel/cobalt/rtdm/fd.c
index 7e64457..7e4e99a 100644
--- a/kernel/cobalt/rtdm/fd.c
+++ b/kernel/cobalt/rtdm/fd.c
@@ -118,7 +118,7 @@ static struct rtdm_fd *fetch_fd(struct cobalt_ppd *p, int 
ufd)
                }                                                       \
        while (0)
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 
 static inline void set_compat_bit(struct rtdm_fd *fd)
 {
@@ -133,13 +133,13 @@ static inline void set_compat_bit(struct rtdm_fd *fd)
        }
 }
 
-#else  /* !CONFIG_COMPAT */
+#else  /* !CONFIG_XENO_ARCH_SYS3264 */
 
 static inline void set_compat_bit(struct rtdm_fd *fd)
 {
 }
 
-#endif /* !CONFIG_COMPAT */
+#endif /* !CONFIG_XENO_ARCH_SYS3264 */
 
 int rtdm_fd_enter(struct rtdm_fd *fd, int ufd, unsigned int magic,
                  struct rtdm_fd_ops *ops)
diff --git a/kernel/drivers/ipc/rtipc.c b/kernel/drivers/ipc/rtipc.c
index 1c705c4..c09584f 100644
--- a/kernel/drivers/ipc/rtipc.c
+++ b/kernel/drivers/ipc/rtipc.c
@@ -73,7 +73,7 @@ int rtipc_get_iovec(struct rtdm_fd *fd, struct iovec *iov,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd))
                return sys32_get_iovec(iov,
                               (struct compat_iovec __user *)msg->msg_iov,
@@ -93,7 +93,7 @@ int rtipc_put_iovec(struct rtdm_fd *fd, const struct iovec 
*iov,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd))
                return sys32_put_iovec((struct compat_iovec __user 
*)msg->msg_iov,
                                       iov, msg->msg_iovlen);
@@ -123,7 +123,7 @@ int rtipc_get_sockaddr(struct rtdm_fd *fd, struct 
sockaddr_ipc **saddrp,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                struct compat_rtdm_setsockaddr_args csreq;
                ret = rtdm_safe_copy_from_user(fd, &csreq, arg, sizeof(csreq));
@@ -179,7 +179,7 @@ int rtipc_put_sockaddr(struct rtdm_fd *fd, void *arg,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                struct compat_rtdm_getsockaddr_args csreq;
                ret = rtdm_safe_copy_from_user(fd, &csreq, arg, sizeof(csreq));
@@ -234,7 +234,7 @@ int rtipc_get_sockoptout(struct rtdm_fd *fd, struct 
_rtdm_getsockopt_args *sopt,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                struct compat_rtdm_getsockopt_args csopt;
                int ret;
@@ -260,7 +260,7 @@ int rtipc_put_sockoptout(struct rtdm_fd *fd, void *arg,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                struct compat_rtdm_getsockopt_args csopt;
                int ret;
@@ -286,7 +286,7 @@ int rtipc_get_sockoptin(struct rtdm_fd *fd, struct 
_rtdm_setsockopt_args *sopt,
                return 0;
        }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                struct compat_rtdm_setsockopt_args csopt;
                int ret;
@@ -307,7 +307,7 @@ int rtipc_get_sockoptin(struct rtdm_fd *fd, struct 
_rtdm_setsockopt_args *sopt,
 int rtipc_get_timeval(struct rtdm_fd *fd, struct timeval *tv,
                      const void *arg, size_t arglen)
 {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                if (arglen != sizeof(struct compat_timeval))
                        return -EINVAL;
@@ -329,7 +329,7 @@ int rtipc_get_timeval(struct rtdm_fd *fd, struct timeval 
*tv,
 int rtipc_put_timeval(struct rtdm_fd *fd, void *arg,
                      const struct timeval *tv, size_t arglen)
 {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                if (arglen != sizeof(struct compat_timeval))
                        return -EINVAL;
@@ -351,7 +351,7 @@ int rtipc_put_timeval(struct rtdm_fd *fd, void *arg,
 int rtipc_get_length(struct rtdm_fd *fd, size_t *lenp,
                     const void *arg, size_t arglen)
 {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
        if (rtdm_fd_is_compat(fd)) {
                const compat_size_t *csz;
                if (arglen != sizeof(*csz))
diff --git a/kernel/drivers/testing/timerbench.c 
b/kernel/drivers/testing/timerbench.c
index 2253bf5..2efa14e 100644
--- a/kernel/drivers/testing/timerbench.c
+++ b/kernel/drivers/testing/timerbench.c
@@ -361,7 +361,7 @@ static int user_copy_results(struct rt_tmbench_context *ctx,
        return 0;
 }
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
 
 static int compat_user_copy_results(struct rt_tmbench_context *ctx,
                                    struct compat_rttst_overall_bench_res 
__user *u_res)
@@ -390,7 +390,7 @@ static int compat_user_copy_results(struct 
rt_tmbench_context *ctx,
        return 0;
 }
 
-#endif /* CONFIG_COMPAT */
+#endif /* CONFIG_XENO_ARCH_SYS3264 */
 
 static int rt_tmbench_stop(struct rt_tmbench_context *ctx, void *u_res)
 {
@@ -419,7 +419,7 @@ static int rt_tmbench_stop(struct rt_tmbench_context *ctx, 
void *u_res)
                    ctx->result.overall.test_loops : 2) - 1);
 
        if (rtdm_fd_is_user(fd)) {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_XENO_ARCH_SYS3264
                if (rtdm_fd_is_compat(fd))
                        ret = compat_user_copy_results(ctx, u_res);
                else


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to