fixed 2.2.17/rtl-2.2 compile r0_7_53
authorDavid Schleef <ds@schleef.org>
Wed, 6 Dec 2000 20:10:39 +0000 (20:10 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 6 Dec 2000 20:10:39 +0000 (20:10 +0000)
comedi/comedi_rt.h
comedi/rt.c

index 09a47ee5cf006f1c6dac71bd3ddcf2059e9bfafb..f7a04d5317250b9d3216110c34f89971d0d5fa8d 100644 (file)
 #ifdef CONFIG_COMEDI_RTAI
 #include <rtai/rtai.h>
 #endif
+#ifdef CONFIG_COMEDI_RTL
+#include <rtl_core.h>
+#include <asm/rtl_sync.h>
+#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,
index eff38dc41a769ecee6d4b5997f68d85388381b04..3339f04202c44115c763a0c00a06cdc8a40daca4 100644 (file)
 #define RT_spin_unlock_irq(x)  rt_spin_unlock_irq(x)
 #endif
 
-#ifdef CONFIG_COMEDI_RTLINUX
+#ifdef CONFIG_COMEDI_RTL
 #include <rtl_core.h>
 
 #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)