From: David Schleef Date: Wed, 6 Dec 2000 20:10:39 +0000 (+0000) Subject: fixed 2.2.17/rtl-2.2 compile X-Git-Tag: r0_7_53 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1b364eca718c4b544687678aaaddfcfa949e133c;p=comedi.git fixed 2.2.17/rtl-2.2 compile --- diff --git a/comedi/comedi_rt.h b/comedi/comedi_rt.h index 09a47ee5..f7a04d53 100644 --- a/comedi/comedi_rt.h +++ b/comedi/comedi_rt.h @@ -37,6 +37,11 @@ #ifdef CONFIG_COMEDI_RTAI #include #endif +#ifdef CONFIG_COMEDI_RTL +#include +#include +#define rt_printk rtl_printf +#endif int comedi_request_irq(unsigned int irq,void (*handler)(int,void *, struct pt_regs *regs),unsigned long flags,const char *device, diff --git a/comedi/rt.c b/comedi/rt.c index eff38dc4..3339f042 100644 --- a/comedi/rt.c +++ b/comedi/rt.c @@ -45,13 +45,15 @@ #define RT_spin_unlock_irq(x) rt_spin_unlock_irq(x) #endif -#ifdef CONFIG_COMEDI_RTLINUX +#ifdef CONFIG_COMEDI_RTL #include #define RT_protect() rtl_make_rt_system_active() #define RT_unprotect() rtl_make_rt_system_idle() -#define RT_spin_lock_irq(x) rt_spin_lock_irq(x) -#define RT_spin_unlock_irq(x) rt_spin_unlock_irq(x) +/* RTL doesn't have the necessary primitives, so we have to hack + * it, dealing with the race */ +#define RT_spin_lock_irq(x) do{RT_protect();rtl_spin_lock(x);}while(0) +#define RT_spin_unlock_irq(x) do{rtl_spin_unlock(x);RT_unprotect();}while(0) #endif @@ -247,13 +249,14 @@ static int rt_release_irq(struct comedi_irq_struct *it) /* RTLinux section */ -#ifdef CONFIG_COMEDI_RTLINUX +#ifdef CONFIG_COMEDI_RTL static unsigned int handle_rtl_irq(unsigned int irq,struct pt_regs *regs) { struct comedi_irq_struct *it=comedi_irqs[irq]; it->handler(irq,it->dev_id,regs); rtl_hard_enable_irq(irq); + return 0; } static int rt_get_irq(struct comedi_irq_struct *it)