From: David Schleef Date: Thu, 22 Mar 2001 20:55:18 +0000 (+0000) Subject: Fix to make rt_pend_tq work correctly on RTAI. X-Git-Tag: r0_7_58~40 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=5a817129a201e6ac04050c41f9b615ec92f61d76;p=comedi.git Fix to make rt_pend_tq work correctly on RTAI. --- diff --git a/comedi/Makefile b/comedi/Makefile index fbe9cfa9..18711f1f 100644 --- a/comedi/Makefile +++ b/comedi/Makefile @@ -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 diff --git a/comedi/rt.c b/comedi/rt.c index 619fbb5b..4792c31b 100644 --- a/comedi/rt.c +++ b/comedi/rt.c @@ -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 diff --git a/comedi/rt_pend_tq/rt_pend_tq.c b/comedi/rt_pend_tq/rt_pend_tq.c index 2c8822bd..7708695d 100644 --- a/comedi/rt_pend_tq/rt_pend_tq.c +++ b/comedi/rt_pend_tq/rt_pend_tq.c @@ -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 }