From: David Schleef Date: Tue, 16 Jan 2001 17:13:09 +0000 (+0000) Subject: added spinlock stuff (frank) X-Git-Tag: r0_7_55~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c384dd64d6411e9c39309905b0a6e10f14618b5a;p=comedi.git added spinlock stuff (frank) --- 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