]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/can_sysdep.h
Merge: Fix to behave correctly on latest real-time premptible kernels.
[lincan.git] / lincan / include / can_sysdep.h
index 3966e8fc4d6c595479d1b07b846c5e96342fdee3..539a38e78b563b7e8b761b858124cd98c2b04a4f 100644 (file)
 #define can_spin_unlock_irqrestore spin_unlock_irqrestore
 #define can_spin_lock_init         spin_lock_init
 
-#if defined(CONFIG_PREEMPT) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+#ifndef DEFINE_SPINLOCK
+#define CAN_DEFINE_SPINLOCK(x)     can_spinlock_t x = SPIN_LOCK_UNLOCKED
+#else /*DEFINE_SPINLOCK*/
+#define CAN_DEFINE_SPINLOCK        DEFINE_SPINLOCK
+#endif /*DEFINE_SPINLOCK*/
+
+#if !defined(CONFIG_PREEMPT_RT) && ( defined(CONFIG_PREEMPT) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) )
 #define can_preempt_disable        preempt_disable
 #define can_preempt_enable         preempt_enable
 #else /*CONFIG_PREEMPT*/
 #define can_spin_unlock_irqrestore rtl_spin_unlock_irqrestore
 #define can_spin_lock_init         rtl_spin_lock_init
 
+#define CAN_DEFINE_SPINLOCK(x)     can_spinlock_t x = SPIN_LOCK_UNLOCKED
+
 #define can_preempt_disable()      do { } while (0)
 #define can_preempt_enable()       do { } while (0)