Module: xenomai-head
Branch: master
Commit: 2a2ce3ed6d3d0b879d3cb0dd201d28ab00180194
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=2a2ce3ed6d3d0b879d3cb0dd201d28ab00180194

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Tue Feb 15 22:33:05 2011 +0100

wrappers: only use new chip handler accessors above 2.6.37

CONFIG_GENERIC_HARDIRQS was already defined with previous versions whereas
the chip-specific function names were different.

---

 include/asm-arm/wrappers.h      |    3 ++-
 include/asm-blackfin/wrappers.h |    3 ++-
 include/asm-generic/wrappers.h  |    2 +-
 include/asm-nios2/wrappers.h    |    3 ++-
 include/asm-powerpc/wrappers.h  |    3 ++-
 include/asm-x86/wrappers_32.h   |    5 +++--
 include/asm-x86/wrappers_64.h   |    3 ++-
 7 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index 321c207..ddd5faf 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -65,7 +65,8 @@ typedef irqreturn_t (*rthal_irq_host_handler_t)(int irq,
 
 extern void (*fp_init)(union fp_state *);
 #else /* >= 2.6.19 */
-#ifndef CONFIG_GENERIC_HARDIRQS
+#if !defined(CONFIG_GENERIC_HARDIRQS) \
+       || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define rthal_irq_chip_enable(irq)   ({ 
rthal_irq_descp(irq)->chip->unmask(irq); 0; })
 #define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->mask(irq); 
0; })
 #endif
diff --git a/include/asm-blackfin/wrappers.h b/include/asm-blackfin/wrappers.h
index ccfc3fc..b0cae4d 100644
--- a/include/asm-blackfin/wrappers.h
+++ b/include/asm-blackfin/wrappers.h
@@ -35,7 +35,8 @@
 
 #define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
 
-#ifndef CONFIG_GENERIC_HARDIRQS
+#if !defined(CONFIG_GENERIC_HARDIRQS) \
+       || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define rthal_irq_chip_enable(irq)     ({ 
rthal_irq_descp(irq)->chip->enable(irq); 0; })
 #define rthal_irq_chip_disable(irq)    ({ 
rthal_irq_descp(irq)->chip->disable(irq); 0; })
 #endif
diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index 3554002..e2640ed 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -609,7 +609,7 @@ static inline void wrap_proc_dir_entry_owner(struct 
proc_dir_entry *entry)
 #define DEFINE_SEMAPHORE(sem) DECLARE_MUTEX(sem)
 #endif
 
-#ifdef CONFIG_GENERIC_HARDIRQS
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) && 
defined(CONFIG_GENERIC_HARDIRQS)
 /*
  * The irq chip descriptor has been heavily revamped in
  * 2.6.37. Provide generic accessors to the chip handlers we need for
diff --git a/include/asm-nios2/wrappers.h b/include/asm-nios2/wrappers.h
index 5216a21..13a03af 100644
--- a/include/asm-nios2/wrappers.h
+++ b/include/asm-nios2/wrappers.h
@@ -31,7 +31,8 @@
 
 #define wrap_strncpy_from_user(dstP, srcP, n)  strncpy_from_user(dstP, srcP, n)
 
-#ifndef CONFIG_GENERIC_HARDIRQS
+#if !defined(CONFIG_GENERIC_HARDIRQS) \
+       || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define rthal_irq_chip_enable(irq)     ({ 
rthal_irq_descp(irq)->chip->enable(irq); 0; })
 #define rthal_irq_chip_disable(irq)    ({ 
rthal_irq_descp(irq)->chip->disable(irq); 0; })
 #endif
diff --git a/include/asm-powerpc/wrappers.h b/include/asm-powerpc/wrappers.h
index 32dea29..7437f31 100644
--- a/include/asm-powerpc/wrappers.h
+++ b/include/asm-powerpc/wrappers.h
@@ -166,7 +166,8 @@ typedef irq_handler_t rthal_irq_host_handler_t;
                __err__;                                                        
\
        })
 #else /* > 2.6.19 */
-#ifndef CONFIG_GENERIC_HARDIRQS
+#if !defined(CONFIG_GENERIC_HARDIRQS) \
+       || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define rthal_irq_chip_enable(irq)                                     \
        ({                                                              \
                int __err__ = 0;                                        \
diff --git a/include/asm-x86/wrappers_32.h b/include/asm-x86/wrappers_32.h
index ff8d461..15496c3 100644
--- a/include/asm-x86/wrappers_32.h
+++ b/include/asm-x86/wrappers_32.h
@@ -90,7 +90,7 @@ typedef phys_addr_t resource_size_t;
        unsigned long flag,sum; \
        asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
                :"=&r" (flag), "=r" (sum) \
-               :"1" (addr),"g" ((int)(size)),"g" 
(task_thread_info(task)->addr_limit.seg)); \
+               :"1" (addr),"g" ((int)(size)),"g" 
(task_thread_info(task)->addr_limit.seg)); \
        flag == 0; })
 
 #define wrap_test_fpu_used(task)  \
@@ -182,7 +182,8 @@ typedef irqreturn_t (*rthal_irq_host_handler_t)(int irq,
 
 #define rthal_irq_chip_end(irq)        rthal_irq_chip_enable(irq)
 #else /* >= 2.6.19 */
-#ifndef CONFIG_GENERIC_HARDIRQS
+#if !defined(CONFIG_GENERIC_HARDIRQS) \
+       || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define rthal_irq_chip_enable(irq)   ({ 
rthal_irq_descp(irq)->chip->unmask(irq); 0; })
 #define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->mask(irq); 
0; })
 #endif
diff --git a/include/asm-x86/wrappers_64.h b/include/asm-x86/wrappers_64.h
index 9d16455..f1ef185 100644
--- a/include/asm-x86/wrappers_64.h
+++ b/include/asm-x86/wrappers_64.h
@@ -34,7 +34,8 @@
 
 #define rthal_irq_desc_status(irq)     (rthal_irq_descp(irq)->status)
 
-#ifndef CONFIG_GENERIC_HARDIRQS
+#if !defined(CONFIG_GENERIC_HARDIRQS) \
+       || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define rthal_irq_chip_enable(irq)   ({ 
rthal_irq_descp(irq)->chip->unmask(irq); 0; })
 #define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->mask(irq); 
0; })
 #endif


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to