[Xenomai-git] Philippe Gerum : hal/blackfin: fix up for kernel 3.5 series

2012-08-31 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 3363026295ee7c34f184a43fdc4b4ca464a3c44c
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3363026295ee7c34f184a43fdc4b4ca464a3c44c

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Aug 31 10:24:21 2012 +0200

hal/blackfin: fix up for kernel 3.5 series

---

 include/asm-blackfin/atomic.h |1 -
 include/asm-blackfin/hal.h|1 -
 include/asm-blackfin/system.h |1 -
 ksrc/arch/blackfin/hal.c  |1 -
 4 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/asm-blackfin/atomic.h b/include/asm-blackfin/atomic.h
index 3e34b2f..1e56d2b 100644
--- a/include/asm-blackfin/atomic.h
+++ b/include/asm-blackfin/atomic.h
@@ -25,7 +25,6 @@
 #include linux/version.h
 #include linux/bitops.h
 #include asm/atomic.h
-#include asm/system.h
 
 #define xnarch_atomic_xchg(ptr,v)  xchg(ptr,v)
 #define xnarch_memory_barrier()smp_mb()
diff --git a/include/asm-blackfin/hal.h b/include/asm-blackfin/hal.h
index 744e10c..84398a2 100644
--- a/include/asm-blackfin/hal.h
+++ b/include/asm-blackfin/hal.h
@@ -46,7 +46,6 @@ static inline __attribute_const__ unsigned long ffnz(unsigned 
long ul)
 
 #ifndef __cplusplus
 #include linux/irq.h
-#include asm/system.h
 #include asm/blackfin.h
 #include asm/processor.h
 #include asm/xenomai/atomic.h
diff --git a/include/asm-blackfin/system.h b/include/asm-blackfin/system.h
index b4be882..1c31b04 100644
--- a/include/asm-blackfin/system.h
+++ b/include/asm-blackfin/system.h
@@ -24,7 +24,6 @@
 
 #include linux/ptrace.h
 #include asm-generic/xenomai/system.h
-#include asm/system.h
 #include asm/processor.h
 
 #define XNARCH_THREAD_STACKSZ   8192
diff --git a/ksrc/arch/blackfin/hal.c b/ksrc/arch/blackfin/hal.c
index ad203a2..1c654c3 100644
--- a/ksrc/arch/blackfin/hal.c
+++ b/ksrc/arch/blackfin/hal.c
@@ -36,7 +36,6 @@
 #include linux/errno.h
 #include linux/module.h
 #include asm/time.h
-#include asm/system.h
 #include asm/atomic.h
 #include asm/io.h
 #include asm/uaccess.h


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


[Xenomai-git] Philippe Gerum : nucleus, skins: fix up for kernel 3.5 series

2012-08-31 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: a3bc2f1f5283c3979eac4ab25b69c6b4f12a9e85
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=a3bc2f1f5283c3979eac4ab25b69c6b4f12a9e85

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Aug 31 10:23:39 2012 +0200

nucleus, skins: fix up for kernel 3.5 series

---

 include/asm-generic/wrappers.h |   46 -
 include/nucleus/select.h   |   39 
 ksrc/nucleus/select.c  |   48 
 ksrc/nucleus/shadow.c  |4 +--
 ksrc/skins/posix/syscall.c |6 ++--
 ksrc/skins/rtdm/drvlib.c   |4 +--
 6 files changed, 83 insertions(+), 64 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index be01c4f..7f95f0f 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -700,44 +700,28 @@ static inline void wrap_proc_dir_entry_owner(struct 
proc_dir_entry *entry)
 #endif
 
 #if LINUX_VERSION_CODE  KERNEL_VERSION(3,4,0)
+
 #define cpu_online_mask (cpu_online_map)
-#endif
 
-#if LINUX_VERSION_CODE = KERNEL_VERSION(3,4,0)
-static inline void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp)
-{
-unsigned long __tmp = __fd / __NFDBITS;
-unsigned long __rem = __fd % __NFDBITS;
-__fdsetp-fds_bits[__tmp] |= (1UL__rem);
-}
+#include linux/sched.h
+#include linux/mm.h
 
-static inline void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp)
+static inline
+unsigned long vm_mmap(struct file *file, unsigned long addr,
+   unsigned long len, unsigned long prot,
+   unsigned long flag, unsigned long offset)
 {
-unsigned long __tmp = __fd / __NFDBITS;
-unsigned long __rem = __fd % __NFDBITS;
-__fdsetp-fds_bits[__tmp] = ~(1UL__rem);
-}
+   struct mm_struct *mm = current-mm;
+   int ret;
 
-static inline int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p)
-{
-unsigned long __tmp = __fd / __NFDBITS;
-unsigned long __rem = __fd % __NFDBITS;
-return (__p-fds_bits[__tmp]  (1UL__rem)) != 0;
-}
+   down_write(mm-mmap_sem);
+   ret = do_mmap(file, addr, len, prot, flag, offset);
+   up_write(mm-mmap_sem);
 
-static inline void __FD_ZERO(__kernel_fd_set *__p)
-{
-   unsigned long *__tmp = __p-fds_bits;
-   int __i;
-
-   __i = __FDSET_LONGS;
-   while (__i) {
-   __i--;
-   *__tmp = 0;
-   __tmp++;
-   }
+   return ret;
 }
-#endif
+
+#endif /* LINUX_VERSION_CODE  3.4.0 */
 
 #ifdef CONFIG_IPIPE_CORE
 #if IPIPE_CORE_APIREV = 2
diff --git a/include/nucleus/select.h b/include/nucleus/select.h
index bda4cba..d9ee5cf 100644
--- a/include/nucleus/select.h
+++ b/include/nucleus/select.h
@@ -45,6 +45,45 @@ struct xnselector {
xnqueue_t bindings; /* only used by xnselector_destroy */
 };
 
+#define __NFDBITS__(8 * sizeof(unsigned long))
+#define __FDSET_LONGS__(__FD_SETSIZE/__NFDBITS__)
+#define__FDELT__(d)((d) / __NFDBITS__)
+#define__FDMASK__(d)   (1UL  ((d) % __NFDBITS__))
+
+static inline void __FD_SET__(unsigned long __fd, __kernel_fd_set *__fdsetp)
+{
+unsigned long __tmp = __fd / __NFDBITS__;
+unsigned long __rem = __fd % __NFDBITS__;
+__fdsetp-fds_bits[__tmp] |= (1UL__rem);
+}
+
+static inline void __FD_CLR__(unsigned long __fd, __kernel_fd_set *__fdsetp)
+{
+unsigned long __tmp = __fd / __NFDBITS__;
+unsigned long __rem = __fd % __NFDBITS__;
+__fdsetp-fds_bits[__tmp] = ~(1UL__rem);
+}
+
+static inline int __FD_ISSET__(unsigned long __fd, const __kernel_fd_set *__p)
+{
+unsigned long __tmp = __fd / __NFDBITS__;
+unsigned long __rem = __fd % __NFDBITS__;
+return (__p-fds_bits[__tmp]  (1UL__rem)) != 0;
+}
+
+static inline void __FD_ZERO__(__kernel_fd_set *__p)
+{
+   unsigned long *__tmp = __p-fds_bits;
+   int __i;
+
+   __i = __FDSET_LONGS__;
+   while (__i) {
+   __i--;
+   *__tmp = 0;
+   __tmp++;
+   }
+}
+
 #ifdef CONFIG_XENO_OPT_SELECT
 
 struct xnselect {
diff --git a/ksrc/nucleus/select.c b/ksrc/nucleus/select.c
index 2dd38c5..e25dd38 100644
--- a/ksrc/nucleus/select.c
+++ b/ksrc/nucleus/select.c
@@ -126,13 +126,13 @@ int xnselect_bind(struct xnselect *select_block,
 
appendq(selector-bindings, binding-slink);
appendq(select_block-bindings, binding-link);
-   __FD_SET(index, selector-fds[type].expected);
+   __FD_SET__(index, selector-fds[type].expected);
if (state) {
-   __FD_SET(index, selector-fds[type].pending);
+   __FD_SET__(index, selector-fds[type].pending);
if (xnselect_wakeup(selector))
xnpod_schedule();
} else
-   __FD_CLR(index, selector-fds[type].pending);
+   __FD_CLR__(index, selector-fds[type].pending);