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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Feb  3 13:56:37 2010 +0100

asm-generic: use irq_to_desc() when available

Directly referring to irq_desc[] may not be valid, depending on the
architecture and/or particular configuration switches
(e.g. x86/CONFIG_SPARSE_IRQ, or 2.6.33 as a whole).  Use the
irq_to_desc() accessor instead, starting from 2.6.32.

---

 include/asm-generic/wrappers.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index dbdd6b1..15d9837 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -559,14 +559,18 @@ static inline void wrap_proc_dir_entry_owner(struct 
proc_dir_entry *entry)
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */
 #endif /* CONFIG_PROC_FS */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 #define rthal_irq_descp(irq)   (irq_desc + (irq))
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) */
+#define rthal_irq_descp(irq)   irq_to_desc(irq)
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
 #define rthal_irqdesc_lock(irq, flags)                                 \
        spin_lock_irqsave(&rthal_irq_descp(irq)->lock, flags)
 #define rthal_irqdesc_unlock(irq, flags)                               \
        spin_unlock_irqrestore(&rthal_irq_descp(irq)->lock, flags)
 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) */
-#define rthal_irq_descp(irq)   irq_to_desc(irq)
 #define rthal_irqdesc_lock(irq, flags)                                 \
        raw_spin_lock_irqsave(&rthal_irq_descp(irq)->lock, flags)
 #define rthal_irqdesc_unlock(irq, flags)                               \


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

Reply via email to