Fix to make rt_pend_tq work correctly on RTAI.
authorDavid Schleef <ds@schleef.org>
Thu, 22 Mar 2001 20:55:18 +0000 (20:55 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 22 Mar 2001 20:55:18 +0000 (20:55 +0000)
comedi/Makefile
comedi/rt.c
comedi/rt_pend_tq/rt_pend_tq.c

index fbe9cfa9ae1272d9be84dbab9eba3de72093d3ce..18711f1f3aad0b4b9482db0020d5aa65d7be5998 100644 (file)
@@ -13,8 +13,8 @@ ifneq ($(CONFIG_COMEDI_KLIB),)
 endif
 
 ifeq ($(CONFIG_COMEDI_RT),y)
-       MOD_SUB_DIRS += realtime rt_pend_tq
-       SUB_DIRS += realtime rt_pend_tq
+       MOD_SUB_DIRS += realtime
+       SUB_DIRS += realtime
 endif
 
 MOD_LIST_NAME := MISC_MODULES
@@ -33,7 +33,7 @@ endif
 
 
 ifeq ($(CONFIG_COMEDI_RT),y)
-MI_OBJS += rt.o
+MI_OBJS += rt.o rt_pend_tq/rt_pend_tq.o
 endif
 
 
index 619fbb5bbb5e52082683a5aa9ab1c4f0c1359b69..4792c31b3183d4c170a22274f346cb18cc23f23e 100644 (file)
@@ -154,18 +154,14 @@ void comedi_switch_to_non_rt(comedi_device *dev)
        RT_spin_unlock_irq(&dev->spinlock);
 }
 
-#ifdef HAVE_RT_PEND_TQ
 void wake_up_int_handler(int arg1, void * arg2)
 {
        wake_up_interruptible((wait_queue_head_t*)arg2);
 }
-#endif
 
 void comedi_rt_pend_wakeup(wait_queue_head_t *q)
 {
-#ifdef HAVE_RT_PEND_TQ
        rt_pend_call(wake_up_int_handler,0,q);
-#endif
 }
 
 
@@ -253,11 +249,13 @@ static int rt_release_irq(struct comedi_irq_struct *it)
 void comedi_rt_init(void)
 {
        rt_mount_rtai();
+       rt_pend_tq_init();
 }
 
 void comedi_rt_cleanup(void)
 {
        rt_umount_rtai();
+       rt_pend_tq_cleanup();
 }
 
 #endif
@@ -286,8 +284,15 @@ static int rt_release_irq(struct comedi_irq_struct *it)
        return 0;
 }
 
-void comedi_rt_init(void) { }
-void comedi_rt_cleanup(void) { }
+void comedi_rt_init(void)
+{
+       rt_pend_tq_init();
+}
+
+void comedi_rt_cleanup(void)
+{
+       rt_pend_tq_cleanup();
+}
 
 #endif
 
index 2c8822bd245d541d6b10ba96fc2cea01d1e18004..7708695d35d2a003bb284ec2e71780ec2e23c24f 100644 (file)
@@ -74,17 +74,19 @@ int rt_pend_tq_init(void)
 #endif
 #ifdef CONFIG_COMEDI_RTL
        rt_pend_tq_irq=rtl_get_soft_irq(rt_pend_irq_handler,"rt_pend_irq");
+#endif
        if(rt_pend_tq_irq>0) 
                printk("rt_pend_tq: RT bottom half scheduler initialized OK\n");
        else
                printk("rt_pend_tq: rtl_get_soft_irq failed\n");
-#endif
        return 0;
 }
 
 void rt_pend_tq_cleanup(void)
 {
        printk("rt_pend_tq: unloading\n");
-       free_irq(rt_pend_tq_irq,NULL);
+#ifdef CONFIG_COMEDI_RTAI
+       rt_free_srq(rt_pend_tq_irq);
+#endif
 }