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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Apr  8 09:33:14 2014 +0200

cobalt: assume kernel >= v3.10

---

 .../arch/arm/include/asm/xenomai/calibration.h     |    2 -
 .../cobalt/arch/arm/include/asm/xenomai/wrappers.h |   26 -----------
 .../arch/blackfin/include/asm/xenomai/wrappers.h   |    6 ---
 .../arch/nios2/include/asm/xenomai/wrappers.h      |    6 ---
 .../arch/powerpc/include/asm/xenomai/wrappers.h    |   47 --------------------
 .../cobalt/arch/sh/include/asm/xenomai/wrappers.h  |    6 ---
 .../cobalt/arch/x86/include/asm/xenomai/thread.h   |    3 ++
 .../cobalt/arch/x86/include/asm/xenomai/wrappers.h |   12 -----
 .../cobalt/include/asm-generic/xenomai/syscall.h   |    2 +-
 kernel/drivers/can/mscan/rtcan_mscan_mpc5xxx.c     |    5 +++
 kernel/drivers/can/mscan/rtcan_mscan_regs.h        |    4 --
 kernel/drivers/can/rtcan_flexcan.c                 |   40 -----------------
 kernel/drivers/serial/mpc52xx_uart.c               |    6 ---
 13 files changed, 9 insertions(+), 156 deletions(-)

diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h 
b/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h
index 97e9226..28d641d 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h
@@ -26,10 +26,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
 extern unsigned omap_rev(void);
 #define cpu_is_omap44xx() ((omap_rev() & 0xff) == 0x44)
-#endif
 
 static inline unsigned long xnarch_get_sched_latency (void)
 {
diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/arm/include/asm/xenomai/wrappers.h
index bad2e27..fe59896 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/wrappers.h
@@ -19,35 +19,9 @@
 #ifndef _COBALT_ARM_ASM_WRAPPERS_H
 #define _COBALT_ARM_ASM_WRAPPERS_H
 
-#ifndef __KERNEL__
-#error "Pure kernel header included from user-space!"
-#endif
-
-#include <linux/version.h>
 #include <asm-generic/xenomai/wrappers.h> /* Read the generic portion. */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
-#define wrap_strncpy_from_user(dstP, srcP, n)  __strncpy_from_user(dstP, srcP, 
n)
-#else
-#define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
-#endif
-
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) && 
!defined(CONFIG_VFP_3_2_BACKPORT)
-#define vfp_current_hw_state last_VFP_context
-#endif /* Linux < 3.1 */
-
-#if defined(CONFIG_SMP) && !defined(CONFIG_XENO_HW_UNLOCKED_SWITCH) && \
-       LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
-#error "ARM/smp requires CONFIG_XENO_HW_UNLOCKED_SWITCH for kernel < 3.8.0"
-#endif
-
-static inline void fp_init(union fp_state *state)
-{
-       /* FIXME: This is insufficient. */
-       memset(state, 0, sizeof(*state));
-}
-
 #endif /* _COBALT_ARM_ASM_WRAPPERS_H */
diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/blackfin/include/asm/xenomai/wrappers.h
index 099daa1..236a553 100644
--- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/wrappers.h
@@ -19,15 +19,9 @@
 #ifndef _COBALT_BLACKFIN_ASM_WRAPPERS_H
 #define _COBALT_BLACKFIN_ASM_WRAPPERS_H
 
-#ifndef __KERNEL__
-#error "Pure kernel header included from user-space!"
-#endif
-
 #include <asm-generic/xenomai/wrappers.h> /* Read the generic portion. */
 
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
-#define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
-
 #endif /* _COBALT_BLACKFIN_ASM_WRAPPERS_H */
diff --git a/kernel/cobalt/arch/nios2/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/nios2/include/asm/xenomai/wrappers.h
index 0acd1ed..a2c0a1b 100644
--- a/kernel/cobalt/arch/nios2/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/nios2/include/asm/xenomai/wrappers.h
@@ -19,14 +19,8 @@
 #ifndef _COBALT_NIOS2_ASM_WRAPPERS_H
 #define _COBALT_NIOS2_ASM_WRAPPERS_H
 
-#ifndef __KERNEL__
-#error "Pure kernel header included from user-space!"
-#endif
-
 #include <asm-generic/xenomai/wrappers.h> /* Read the generic portion. */
 
-#define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
-
 #define PAGE_SHARED  __pgprot(0)
 
 #endif /* _COBALT_NIOS2_ASM_WRAPPERS_H */
diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/powerpc/include/asm/xenomai/wrappers.h
index e8f0aa6..f0ae0e4 100644
--- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/wrappers.h
@@ -19,53 +19,6 @@
 #ifndef _COBALT_POWERPC_ASM_WRAPPERS_H
 #define _COBALT_POWERPC_ASM_WRAPPERS_H
 
-#ifndef __KERNEL__
-#error "Pure kernel header included from user-space!"
-#endif
-
-#include <linux/version.h>
-#include <asm/uaccess.h>
-
-#ifdef CONFIG_PPC64
-#define wrap_range_ok(task,addr,size) \
-    __access_ok(((__force unsigned long)(addr)),(size),(task->thread.fs))
-#else /* !CONFIG_PPC64 */
-#define wrap_range_ok(task,addr,size) \
-    ((unsigned long)(addr) <= (task)->thread.fs.seg                    \
-     && ((size) == 0 || (size) - 1 <= (task)->thread.fs.seg - (unsigned 
long)(addr)))
-#endif /* !CONFIG_PPC64 */
-
 #include <asm-generic/xenomai/wrappers.h>      /* Read the generic portion. */
 
-/* from linux/include/asm-powerpc/uaccess.h */
-#define wrap_get_user(x, ptr)                                  \
-({                                                             \
-       int __gu_size = sizeof(*(ptr));                         \
-       long __gu_err;                                          \
-       unsigned long __gu_val;                                 \
-       const __typeof__(*(ptr)) __user *__gu_addr = (ptr);     \
-       __chk_user_ptr(ptr);                                    \
-       __get_user_size(__gu_val, __gu_addr, gu_size, __gu_err);\
-       (x) = (__typeof__(*(ptr)))__gu_val;                     \
-       __gu_err;                                               \
-})
-
-#define wrap_put_user(x, ptr)                                  \
-({                                                             \
-       int __pu_size = sizeof(*(ptr));                         \
-       long __pu_err;                                          \
-       __typeof__(*(ptr)) __user *__pu_addr = (ptr);           \
-       __chk_user_ptr(ptr);                                    \
-       __put_user_size((__typeof__(*(ptr)))(x),                \
-                       __pu_addr, __pu_size, __pu_err);        \
-       __pu_err;                                               \
-})
-
-#define of_device platform_device
-#define of_platform_driver platform_driver
-#define of_register_platform_driver platform_driver_register
-#define of_unregister_platform_driver platform_driver_unregister
-
-#define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
-
 #endif /* _COBALT_POWERPC_ASM_WRAPPERS_H */
diff --git a/kernel/cobalt/arch/sh/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/sh/include/asm/xenomai/wrappers.h
index 3cdba53..1b4c4ae 100644
--- a/kernel/cobalt/arch/sh/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/sh/include/asm/xenomai/wrappers.h
@@ -19,12 +19,6 @@
 #ifndef _COBALT_SH_ASM_WRAPPERS_H
 #define _COBALT_SH_ASM_WRAPPERS_H
 
-#ifndef __KERNEL__
-#error "Pure kernel header included from user-space!"
-#endif
-
 #include <asm-generic/xenomai/wrappers.h> /* Read the generic portion. */
 
-#define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
-
 #endif /* _COBALT_SH_ASM_WRAPPERS_H */
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
index 750fd41..8730018 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
@@ -27,6 +27,9 @@
 #include <asm-generic/xenomai/thread.h>
 #include <asm/xenomai/wrappers.h>
 
+typedef union thread_xstate x86_fpustate;
+#define x86_fpustate_ptr(t) ((t)->fpu.state)
+
 struct xnarchtcb {
        x86_fpustate i387 __attribute__ ((aligned (16)));
        struct xntcb core;
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
index 232f74c..28ea71d 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
@@ -18,22 +18,10 @@
  */
 #ifndef _COBALT_X86_ASM_WRAPPERS_H
 #define _COBALT_X86_ASM_WRAPPERS_H
-#define _COBALT_X86_ASM_WRAPPERS_H
-
-#ifndef __KERNEL__
-#error "Pure kernel header included from user-space!"
-#endif
 
-#include <linux/version.h>
 #include <asm-generic/xenomai/wrappers.h> /* Read the generic portion. */
 
 #define __get_user_inatomic __get_user
 #define __put_user_inatomic __put_user
 
-#define wrap_strncpy_from_user(dstP, srcP, n)          \
-       strncpy_from_user_nocheck(dstP, srcP, n)
-
-typedef union thread_xstate x86_fpustate;
-#define x86_fpustate_ptr(t) ((t)->fpu.state)
-
 #endif /* _COBALT_X86_ASM_WRAPPERS_H */
diff --git a/kernel/cobalt/include/asm-generic/xenomai/syscall.h 
b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
index 4f2b22d..0962d19 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/syscall.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
@@ -98,7 +98,7 @@ struct xnsyscall {
 #define __xn_copy_to_user(dstP, srcP, n)       __copy_to_user_inatomic(dstP, 
srcP, n)
 #define __xn_put_user(src, dstP)               __put_user_inatomic(src, dstP)
 #define __xn_get_user(dst, srcP)               __get_user_inatomic(dst, srcP)
-#define __xn_strncpy_from_user(dstP, srcP, n)  wrap_strncpy_from_user(dstP, 
srcP, n)
+#define __xn_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
 
 static inline int __xn_safe_copy_from_user(void *dst, const void __user *src,
                                           size_t size)
diff --git a/kernel/drivers/can/mscan/rtcan_mscan_mpc5xxx.c 
b/kernel/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
index af6c09b..e43e1cf 100644
--- a/kernel/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
+++ b/kernel/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
@@ -35,6 +35,11 @@
 #include "rtcan_mscan_regs.h"
 #include "rtcan_mscan.h"
 
+#define of_device platform_device
+#define of_platform_driver platform_driver
+#define of_register_platform_driver platform_driver_register
+#define of_unregister_platform_driver platform_driver_unregister
+
 static char mscan_ctrl_name_mpc5200[] = "MSCAN-MPC5200";
 static char mscan_ctrl_name_mpc512x[] = "MSCAN-MPC512x";
 static char mscan_board_name[] = "unkown";
diff --git a/kernel/drivers/can/mscan/rtcan_mscan_regs.h 
b/kernel/drivers/can/mscan/rtcan_mscan_regs.h
index 2f2fa41..11b85a9 100644
--- a/kernel/drivers/can/mscan/rtcan_mscan_regs.h
+++ b/kernel/drivers/can/mscan/rtcan_mscan_regs.h
@@ -41,11 +41,7 @@ static inline void __iomem *mpc5xxx_gpio_find_and_map(void)
 #define MPC5xxx_GPIO   mpc5xxx_gpio_find_and_map()
 #define mpc5xxx_gpio   mpc52xx_gpio
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
 #define mpc5xxx_get_of_node(ofdev) (ofdev)->dev.of_node
-#else
-#define mpc5xxx_get_of_node(ofdev) (ofdev)->node
-#endif
 
 #define MSCAN_CAN1_ADDR        (MSCAN_MBAR + 0x0900) /* MSCAN Module 1 */
 #define MSCAN_CAN2_ADDR        (MSCAN_MBAR + 0x0980) /* MSCAN Module 2 */
diff --git a/kernel/drivers/can/rtcan_flexcan.c 
b/kernel/drivers/can/rtcan_flexcan.c
index 6f744bd..38e6d73 100644
--- a/kernel/drivers/can/rtcan_flexcan.c
+++ b/kernel/drivers/can/rtcan_flexcan.c
@@ -32,9 +32,7 @@
 #include <linux/version.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
 #include <linux/pinctrl/consumer.h>
-#endif
 
 #include <rtdm/driver.h>
 
@@ -216,7 +214,6 @@ static struct can_bittiming_const flexcan_bittiming_const = 
{
 };
 
 /* Compatibility functions to support old kernel versions */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
 static inline void flexcan_clk_enable(struct flexcan_priv *priv)
 {
        clk_prepare_enable(priv->clk);
@@ -225,16 +222,6 @@ static inline void flexcan_clk_disable(struct flexcan_priv 
*priv)
 {
        clk_disable_unprepare(priv->clk);
 }
-#else
-static inline void flexcan_clk_enable(struct flexcan_priv *priv)
-{
-       clk_enable(priv->clk);
-}
-static inline void flexcan_clk_disable(struct flexcan_priv *priv)
-{
-       clk_disable(priv->clk);
-}
-#endif
 
 /*
  * Abstract off the read/write for arm versus ppc.
@@ -967,9 +954,7 @@ static int flexcan_probe(struct platform_device *pdev)
        struct flexcan_priv *priv;
        struct resource *mem;
        struct clk *clk = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
        struct pinctrl *pinctrl;
-#endif
        void __iomem *base;
        resource_size_t mem_size;
        int err, irq;
@@ -978,18 +963,13 @@ static int flexcan_probe(struct platform_device *pdev)
        if (!realtime_core_enabled())
                return -ENODEV;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
        pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
        if (IS_ERR(pinctrl))
                return PTR_ERR(pinctrl);
-#endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
        if (pdev->dev.of_node)
                of_property_read_u32(pdev->dev.of_node,
                                                "clock-frequency", &clock_freq);
-#endif
-
        if (!clock_freq) {
                clk = clk_get(&pdev->dev, NULL);
                if (IS_ERR(clk)) {
@@ -1113,27 +1093,7 @@ static struct platform_driver flexcan_driver = {
        .remove = flexcan_remove,
 };
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
-static int __init flexcan_init(void)
-{
-       if (!realtime_core_enabled())
-               return 0;
-       pr_info("%s netdevice driver\n", DRV_NAME);
-       return platform_driver_register(&flexcan_driver);
-}
-
-static void __exit flexcan_exit(void)
-{
-       if (realtime_core_enabled()) {
-               platform_driver_unregister(&flexcan_driver);
-               pr_info("%s: driver removed\n", DRV_NAME);
-       }
-}
-module_init(flexcan_init);
-module_exit(flexcan_exit);
-#else
 module_platform_driver(flexcan_driver);
-#endif
 
 MODULE_AUTHOR("Wolfgang Grandegger <w...@denx.de>, "
              "Sascha Hauer <ker...@pengutronix.de>, "
diff --git a/kernel/drivers/serial/mpc52xx_uart.c 
b/kernel/drivers/serial/mpc52xx_uart.c
index cb1950d..10cd3b4 100644
--- a/kernel/drivers/serial/mpc52xx_uart.c
+++ b/kernel/drivers/serial/mpc52xx_uart.c
@@ -1268,13 +1268,7 @@ static const struct rtdm_device device_tmpl = {
        .provider_name          = "Wolfgang Grandegger",
 };
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
-
 static int rt_mpc52xx_uart_of_probe(struct platform_device *op)
-#else
-static int rt_mpc52xx_uart_of_probe(struct platform_device *op,
-                                   const struct of_device_id *match)
-#endif
 {
        struct rt_mpc52xx_uart_port *port;
        struct rtdm_device *dev;


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

Reply via email to