From c384dd64d6411e9c39309905b0a6e10f14618b5a Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 16 Jan 2001 17:13:09 +0000 Subject: [PATCH] added spinlock stuff (frank) --- include/linux/comedi_rt.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/comedi_rt.h b/include/linux/comedi_rt.h index 57814848..fc0b9a82 100644 --- a/include/linux/comedi_rt.h +++ b/include/linux/comedi_rt.h @@ -67,5 +67,26 @@ void comedi_rt_pend_wakeup(wait_queue_head_t *q); #endif + +// define a spin_lock_irqsave function that will work with rt or without + +#if defined(CONFIG_COMEDI_RTAI) +#define comedi_spin_lock_irqsave(x, flags) rt_spin_lock_irqsave(x, flags) +#define comedi_spin_unlock_irqrestore(x, flags) rt_spin_unlock_irqrestore(x, flags) + +#elif defined(CONFIG_COMEDI_RTL) +#define comedi_spin_lock_irqsave(x, flags) rtl_spin_lock_irqsave(x, flags) +#define comedi_spin_unlock_irqrestore(x, flags) rtl_spin_unlock_irqrestore(x, flags) + +#elif defined(CONFIG_COMEDI_RTL_V1) +#define comedi_spin_lock_irqsave(x, flags) rtl_spin_lock_irqsave(x, flags) +#define comedi_spin_unlock_irqrestore(x, flags) rtl_spin_unlock_irqrestore(x, flags) + +#else +#define comedi_spin_lock_irqsave(x, flags) spin_lock_irqsave(x, flags); +#define comedi_spin_unlock_irqrestore(x, flags) spin_unlock_irqrestore(x, flags); + #endif + +#endif -- 2.26.2