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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jan 11 17:23:17 2010 +0100

wrappers: introduce rthal_irqdesc_lock/unlock()

Starting from 2.6.33, irq descriptors are protected by raw spinlocks.
Introduce a wrapper to cope with older kernel releases.

Unfortunately, we cannot get rid of the crappy rthal_irq_host*
services, since old legacy kernels 2.5.x still supports, do not
implement the generic clockevent infrastructure.

---

 include/asm-generic/wrappers.h |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index a21ac84..dbdd6b1 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -561,8 +561,16 @@ static inline void wrap_proc_dir_entry_owner(struct 
proc_dir_entry *entry)
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
 #define rthal_irq_descp(irq)   (irq_desc + (irq))
-#else
+#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)                               \
+       raw_spin_unlock_irqrestore(&rthal_irq_descp(irq)->lock, flags)
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) */
 
 #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */


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

Reply via email to