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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sat Mar 23 21:42:53 2013 +0100

cobalt/nucleus: fixups for kernel 3.8

---

 include/asm-arm/calibration.h  |    5 +++++
 include/asm-arm/thread.h       |    2 ++
 include/asm-arm/wrappers.h     |    4 ++++
 include/asm-generic/wrappers.h |    4 ++++
 kernel/cobalt/nucleus/shadow.c |    2 +-
 5 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/include/asm-arm/calibration.h b/include/asm-arm/calibration.h
index d92b7c2..df12099 100644
--- a/include/asm-arm/calibration.h
+++ b/include/asm-arm/calibration.h
@@ -23,6 +23,11 @@
 #ifndef _XENO_ASM_ARM_CALIBRATION_H
 #define _XENO_ASM_ARM_CALIBRATION_H
 
+#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)
 {
 #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
diff --git a/include/asm-arm/thread.h b/include/asm-arm/thread.h
index 8e1bf67..3d8329d 100644
--- a/include/asm-arm/thread.h
+++ b/include/asm-arm/thread.h
@@ -36,7 +36,9 @@ struct arm_fpustate {
         */
        __u8                    used_cp[16];    /* thread used copro */
        unsigned long           tp_value;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) || defined(CONFIG_CRUNCH)
        struct crunch_state     crunchstate;
+#endif
        union fp_state          fpstate __attribute__((aligned(8)));
        union vfp_state         vfpstate;
 };
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index b877e9b..cf1f1cc 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -27,7 +27,11 @@
 #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
diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index d6e3d63..862d970 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -74,4 +74,8 @@ unsigned long vm_mmap(struct file *file, unsigned long addr,
 
 #endif /* LINUX_VERSION_CODE < 3.4.0 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+#define KGIDT_INIT(pid) (pid)
+#endif /* LINUX < 3.8.0 */
+
 #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
diff --git a/kernel/cobalt/nucleus/shadow.c b/kernel/cobalt/nucleus/shadow.c
index 72a7651..ce6ed9f 100644
--- a/kernel/cobalt/nucleus/shadow.c
+++ b/kernel/cobalt/nucleus/shadow.c
@@ -1310,7 +1310,7 @@ static int xnshadow_sys_bind(unsigned int magic,
                return -ENOEXEC;
 
        if (!capable(CAP_SYS_NICE) &&
-           (xn_gid_arg == -1 || !in_group_p(xn_gid_arg)))
+           (xn_gid_arg == -1 || !in_group_p(KGIDT_INIT(xn_gid_arg))))
                return -EPERM;
 
        /* Raise capabilities for the caller in case they are lacking yet. */


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

Reply via email to